41 #ifndef PCL_SURFACE_ORGANIZED_FAST_MESH_H_
42 #define PCL_SURFACE_ORGANIZED_FAST_MESH_H_
44 #include <pcl/common/angles.h>
45 #include <pcl/surface/reconstruction.h>
64 template <
typename Po
intInT>
68 typedef boost::shared_ptr<OrganizedFastMesh<PointInT> >
Ptr;
69 typedef boost::shared_ptr<const OrganizedFastMesh<PointInT> >
ConstPtr;
209 addTriangle (
int a,
int b,
int c,
int idx, std::vector<pcl::Vertices>& polygons)
211 assert (idx < static_cast<int> (polygons.size ()));
212 polygons[idx].vertices.resize (3);
213 polygons[idx].vertices[0] = a;
214 polygons[idx].vertices[1] = b;
215 polygons[idx].vertices[2] = c;
227 addQuad (
int a,
int b,
int c,
int d,
int idx, std::vector<pcl::Vertices>& polygons)
229 assert (idx < static_cast<int> (polygons.size ()));
230 polygons[idx].vertices.resize (4);
231 polygons[idx].vertices[0] = a;
232 polygons[idx].vertices[1] = b;
233 polygons[idx].vertices[2] = c;
234 polygons[idx].vertices[3] = d;
247 int field_x_idx = 0,
int field_y_idx = 1,
int field_z_idx = 2)
249 float new_value = value;
260 isShadowed (
const PointInT& point_a,
const PointInT& point_b)
262 Eigen::Vector3f viewpoint = Eigen::Vector3f::Zero ();
263 Eigen::Vector3f dir_a = viewpoint - point_a.getVector3fMap ();
264 Eigen::Vector3f dir_b = point_b.getVector3fMap () - point_a.getVector3fMap ();
265 float distance_to_points = dir_a.norm ();
266 float distance_between_points = dir_b.norm ();
267 float cos_angle = dir_a.dot (dir_b) / (distance_to_points*distance_between_points);
268 if (cos_angle != cos_angle)
309 isValidQuad (
const int& a,
const int& b,
const int& c,
const int& d)
360 #ifdef PCL_NO_PRECOMPILE
361 #include <pcl/surface/impl/organized_fast_mesh.hpp>
364 #endif // PCL_SURFACE_ORGANIZED_FAST_MESH_H_
pcl::PointCloud< PointInT >::Ptr PointCloudPtr
boost::shared_ptr< const OrganizedFastMesh< PointInT > > ConstPtr
void setTrianglePixelSizeColumns(int triangle_size)
Set the edge length (in pixels) used for iterating over columns when constructing the fixed mesh...
void storeShadowedFaces(bool enable)
Store shadowed faces or not.
virtual ~OrganizedFastMesh()
Destructor.
bool isValidQuad(const int &a, const int &b, const int &c, const int &d)
Check if a quad is valid.
bool isShadowed(const PointInT &point_a, const PointInT &point_b)
Check if a point is shadowed by another point.
void makeLeftCutMesh(std::vector< pcl::Vertices > &polygons)
Create a left cut mesh.
boost::shared_ptr< PointCloud< PointT > > Ptr
void makeQuadMesh(std::vector< pcl::Vertices > &polygons)
Create a quad mesh.
float cos_angle_tolerance_
(Cosine of the) angle tolerance used when checking whether or not an edge between two points is shado...
std::vector< pcl::uint8_t > data
PointCloudConstPtr input_
The input point cloud dataset.
std::vector< ::pcl::PCLPointField > fields
void setMaxEdgeLength(float max_edge_length)
Set a maximum edge length.
boost::shared_ptr< OrganizedFastMesh< PointInT > > Ptr
bool isFinite(const PointT &pt)
Tests if the 3D components of a point are all finite param[in] pt point to be tested.
void reconstructPolygons(std::vector< pcl::Vertices > &polygons)
Perform the actual polygonal reconstruction.
void makeAdaptiveCutMesh(std::vector< pcl::Vertices > &polygons)
Create an adaptive cut mesh.
bool store_shadowed_faces_
Whether or not shadowed faces are stored, e.g., for exploration.
OrganizedFastMesh()
Constructor.
float max_edge_length_squared_
max (squared) length of edge
void resetPointData(const int &point_index, pcl::PolygonMesh &mesh, const float &value=0.0f, int field_x_idx=0, int field_y_idx=1, int field_z_idx=2)
Set (all) coordinates of a particular point to the specified value.
float deg2rad(float alpha)
Convert an angle from degrees to radians.
void addQuad(int a, int b, int c, int d, int idx, std::vector< pcl::Vertices > &polygons)
Add a new quad to the current polygon mesh.
void setTrianglePixelSizeRows(int triangle_size)
Set the edge length (in pixels) used for iterating over rows when constructing the fixed mesh...
MeshConstruction represents a base surface reconstruction class.
void makeRightCutMesh(std::vector< pcl::Vertices > &polygons)
Create a right cut mesh.
void addTriangle(int a, int b, int c, int idx, std::vector< pcl::Vertices > &polygons)
Add a new triangle to the current polygon mesh.
Simple triangulation/surface reconstruction for organized point clouds.
bool isValidTriangle(const int &a, const int &b, const int &c)
Check if a triangle is valid.
int triangle_pixel_size_columns_
size of triangle edges (in pixels) for iterating over columns
virtual void performReconstruction(std::vector< pcl::Vertices > &polygons)
Create the surface.
void setTrianglePixelSize(int triangle_size)
Set the edge length (in pixels) used for constructing the fixed mesh.
void setTriangulationType(TriangulationType type)
Set the triangulation type (see TriangulationType)
bool isShadowedQuad(const int &a, const int &b, const int &c, const int &d)
Check if a triangle is shadowed.
bool isShadowedTriangle(const int &a, const int &b, const int &c)
Check if a triangle is shadowed.
int triangle_pixel_size_rows_
size of triangle edges (in pixels) for iterating over rows.
::pcl::PCLPointCloud2 cloud
std::vector< pcl::Vertices > Polygons
bool check_tree_
A flag specifying whether or not the derived reconstruction algorithm needs the search object tree...
TriangulationType triangulation_type_
Type of meshing scheme (quads vs.