40 #ifndef PCL_COMMON_GENERATE_HPP_
41 #define PCL_COMMON_GENERATE_HPP_
43 #include <pcl/console/print.h>
46 template <
typename Po
intT,
typename GeneratorT>
54 template <
typename Po
intT,
typename GeneratorT>
57 setParameters (params);
62 template <
typename Po
intT,
typename GeneratorT>
66 : x_generator_ (x_params)
67 , y_generator_ (y_params)
68 , z_generator_ (z_params)
72 template <
typename Po
intT,
typename GeneratorT>
void
79 x_generator_.setParameters (params);
80 y_generator_.setParameters (y_params);
81 z_generator_.setParameters (z_params);
85 template <
typename Po
intT,
typename GeneratorT>
void
88 x_generator_.setParameters (x_params);
92 template <
typename Po
intT,
typename GeneratorT>
void
95 y_generator_.setParameters (y_params);
99 template <
typename Po
intT,
typename GeneratorT>
void
102 z_generator_.setParameters (z_params);
109 x_generator_.getParameters ();
116 y_generator_.getParameters ();
123 z_generator_.getParameters ();
127 template <
typename Po
intT,
typename GeneratorT>
PointT
131 p.x = x_generator_.run ();
132 p.y = y_generator_.run ();
133 p.z = z_generator_.run ();
138 template <
typename Po
intT,
typename GeneratorT>
int
145 template <
typename Po
intT,
typename GeneratorT>
int
150 PCL_ERROR (
"[pcl::common::CloudGenerator] Cloud width must be >= 1!\n");
156 PCL_ERROR (
"[pcl::common::CloudGenerator] Cloud height must be >= 1!\n");
162 PCL_WARN (
"[pcl::common::CloudGenerator] Cloud data will be erased with new data!\n");
170 points_it != cloud.
end ();
173 points_it->x = x_generator_.run ();
174 points_it->y = y_generator_.run ();
175 points_it->z = z_generator_.run ();
181 template <
typename GeneratorT>
188 template <
typename GeneratorT>
191 : x_generator_ (x_params)
192 , y_generator_ (y_params)
196 template <
typename GeneratorT>
199 setParameters (params);
203 template <
typename GeneratorT>
void
206 x_generator_.setParameters (params);
209 y_generator_.setParameters (y_params);
213 template <
typename GeneratorT>
void
216 x_generator_.setParameters (x_params);
220 template <
typename GeneratorT>
void
223 y_generator_.setParameters (y_params);
230 x_generator_.getParameters ();
237 y_generator_.getParameters ();
245 p.
x = x_generator_.run ();
246 p.
y = y_generator_.run ();
251 template <
typename GeneratorT>
int
258 template <
typename GeneratorT>
int
263 PCL_ERROR (
"[pcl::common::CloudGenerator] Cloud width must be >= 1\n!");
269 PCL_ERROR (
"[pcl::common::CloudGenerator] Cloud height must be >= 1\n!");
274 PCL_WARN (
"[pcl::common::CloudGenerator] Cloud data will be erased with new data\n!");
282 points_it != cloud.
end ();
285 points_it->x = x_generator_.run ();
286 points_it->y = y_generator_.run ();
void setParametersForX(const GeneratorParameters &x_params)
Set parameters for x values generation.
GeneratorT::Parameters GeneratorParameters
GeneratorT::Parameters GeneratorParameters
VectorType::iterator iterator
A 2D point structure representing Euclidean xy coordinates.
uint32_t height
The point cloud height (if organized as an image-structure).
uint32_t width
The point cloud width (if organized as an image-structure).
const GeneratorParameters & getParametersForY() const
CloudGenerator()
Default constructor.
const GeneratorParameters & getParametersForX() const
PointCloud represents the base class in PCL for storing collections of 3D points. ...
void setParametersForY(const GeneratorParameters &y_params)
Set parameters for y values generation.
bool is_dense
True if no points are invalid (e.g., have NaN or Inf values).
void setParameters(const GeneratorParameters ¶ms)
Set parameters for x, y and z values.
void resize(size_t n)
Resize the cloud.
void setParametersForZ(const GeneratorParameters &z_params)
Set parameters for z values generation.
A point structure representing Euclidean xyz coordinates, and the RGB color.
const GeneratorParameters & getParametersForZ() const
int fill(pcl::PointCloud< PointT > &cloud)
Generates a cloud with X Y Z picked within given ranges.