42 #include <pcl/common/generate.h>
43 #include <pcl/console/print.h>
52 template <
typename Po
intT,
typename GeneratorT>
60 template <
typename Po
intT,
typename GeneratorT>
63 setParameters (params);
67 template <
typename Po
intT,
typename GeneratorT>
71 : x_generator_ (x_params)
72 , y_generator_ (y_params)
73 , z_generator_ (z_params)
77 template <
typename Po
intT,
typename GeneratorT>
void
84 x_generator_.setParameters (params);
85 y_generator_.setParameters (y_params);
86 z_generator_.setParameters (z_params);
90 template <
typename Po
intT,
typename GeneratorT>
void
93 x_generator_.setParameters (x_params);
97 template <
typename Po
intT,
typename GeneratorT>
void
100 y_generator_.setParameters (y_params);
104 template <
typename Po
intT,
typename GeneratorT>
void
107 z_generator_.setParameters (z_params);
114 x_generator_.getParameters ();
121 y_generator_.getParameters ();
128 z_generator_.getParameters ();
132 template <
typename Po
intT,
typename GeneratorT>
PointT
136 p.x = x_generator_.run ();
137 p.y = y_generator_.run ();
138 p.z = z_generator_.run ();
143 template <
typename Po
intT,
typename GeneratorT>
int
150 template <
typename Po
intT,
typename GeneratorT>
int
155 PCL_ERROR (
"[pcl::common::CloudGenerator] Cloud width must be >= 1!\n");
161 PCL_ERROR (
"[pcl::common::CloudGenerator] Cloud height must be >= 1!\n");
167 PCL_WARN (
"[pcl::common::CloudGenerator] Cloud data will be erased with new data!\n");
174 for (
auto& point: cloud)
176 point.x = x_generator_.run ();
177 point.y = y_generator_.run ();
178 point.z = z_generator_.run ();
184 template <
typename GeneratorT>
191 template <
typename GeneratorT>
194 : x_generator_ (x_params)
195 , y_generator_ (y_params)
199 template <
typename GeneratorT>
206 template <
typename GeneratorT>
void
209 x_generator_.setParameters (params);
212 y_generator_.setParameters (y_params);
216 template <
typename GeneratorT>
void
219 x_generator_.setParameters (x_params);
223 template <
typename GeneratorT>
void
226 y_generator_.setParameters (y_params);
233 x_generator_.getParameters ();
240 y_generator_.getParameters ();
248 p.
x = x_generator_.run ();
249 p.
y = y_generator_.run ();
254 template <
typename GeneratorT>
int
261 template <
typename GeneratorT>
int
266 PCL_ERROR (
"[pcl::common::CloudGenerator] Cloud width must be >= 1\n!");
272 PCL_ERROR (
"[pcl::common::CloudGenerator] Cloud height must be >= 1\n!");
277 PCL_WARN (
"[pcl::common::CloudGenerator] Cloud data will be erased with new data\n!");
284 for (
auto &point : cloud)
286 point.x = x_generator_.run ();
287 point.y = y_generator_.run ();