96 int i = 0, index_down = 0, index_right = 0, index_down_right = 0, idx = 0;
108 index_down = i + y_big_incr;
109 index_down_right = i + x_big_incr;
118 if (
isValidQuad (i, index_right, index_down_right, index_down))
120 addQuad (i, index_right, index_down_right, index_down, idx++, polygons);
123 polygons.resize (idx);
133 int i = 0, index_down = 0, index_right = 0, index_down_right = 0, idx = 0;
145 index_down = i + y_big_incr;
146 index_down_right = i + x_big_incr;
157 addTriangle (i, index_down_right, index_right, idx++, polygons);
161 addTriangle (i, index_down, index_down_right, idx++, polygons);
164 polygons.resize (idx);
174 int i = 0, index_down = 0, index_right = 0, index_down_right = 0, idx = 0;
186 index_down = i + y_big_incr;
187 index_down_right = i + x_big_incr;
198 addTriangle (i, index_down, index_right, idx++, polygons);
202 addTriangle (index_right, index_down, index_down_right, idx++, polygons);
205 polygons.resize (idx);
225 int i = y *
input_->width;
227 int index_down = i + y_big_incr;
228 int index_down_right = i + x_big_incr;
237 const bool right_cut_upper =
isValidTriangle (i, index_down_right, index_right);
238 const bool right_cut_lower =
isValidTriangle (i, index_down, index_down_right);
239 const bool left_cut_upper =
isValidTriangle (i, index_down, index_right);
240 const bool left_cut_lower =
isValidTriangle (index_right, index_down, index_down_right);
242 if (right_cut_upper && right_cut_lower && left_cut_upper && left_cut_lower)
244 float dist_right_cut = std::abs ((*
input_)[index_down].z - (*
input_)[index_right].z);
245 float dist_left_cut = std::abs ((*
input_)[i].z - (*
input_)[index_down_right].z);
246 if (dist_right_cut >= dist_left_cut)
249 addTriangle (i, index_down_right, index_right, idx++, polygons);
251 addTriangle (i, index_down, index_down_right, idx++, polygons);
256 addTriangle (i, index_down, index_right, idx++, polygons);
258 addTriangle (index_right, index_down, index_down_right, idx++, polygons);
265 addTriangle (i, index_down_right, index_right, idx++, polygons);
268 addTriangle (i, index_down, index_down_right, idx++, polygons);
271 addTriangle (i, index_down, index_right, idx++, polygons);
274 addTriangle (index_right, index_down, index_down_right, idx++, polygons);
278 polygons.resize (idx);
void addTriangle(int a, int b, int c, int idx, std::vector< pcl::Vertices > &polygons)
Add a new triangle to the current polygon mesh.
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 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.