OpenMesh

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PolyMeshT.hh
1 /*===========================================================================*\
2 * *
3 * OpenMesh *
4 * Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen *
5 * www.openmesh.org *
6 * *
7 *---------------------------------------------------------------------------*
8 * This file is part of OpenMesh. *
9 * *
10 * OpenMesh is free software: you can redistribute it and/or modify *
11 * it under the terms of the GNU Lesser General Public License as *
12 * published by the Free Software Foundation, either version 3 of *
13 * the License, or (at your option) any later version with the *
14 * following exceptions: *
15 * *
16 * If other files instantiate templates or use macros *
17 * or inline functions from this file, or you compile this file and *
18 * link it with other files to produce an executable, this file does *
19 * not by itself cause the resulting executable to be covered by the *
20 * GNU Lesser General Public License. This exception does not however *
21 * invalidate any other reasons why the executable file might be *
22 * covered by the GNU Lesser General Public License. *
23 * *
24 * OpenMesh is distributed in the hope that it will be useful, *
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
27 * GNU Lesser General Public License for more details. *
28 * *
29 * You should have received a copy of the GNU LesserGeneral Public *
30 * License along with OpenMesh. If not, *
31 * see <http://www.gnu.org/licenses/>. *
32 * *
33 \*===========================================================================*/
34
35 /*===========================================================================*\
36 * *
37 * $Revision: 990 $ *
38 * $Date: 2014-02-05 10:01:07 +0100 (Mi, 05. Feb 2014) $ *
39 * *
40 \*===========================================================================*/
41
42
43 //=============================================================================
44 //
45 // CLASS PolyMeshT
46 //
47 //=============================================================================
48
49
50 #ifndef OPENMESH_POLYMESHT_HH
51 #define OPENMESH_POLYMESHT_HH
52
53
54 //== INCLUDES =================================================================
55
56
57 #include <OpenMesh/Core/System/config.h>
58 #include <OpenMesh/Core/Geometry/MathDefs.hh>
59 #include <OpenMesh/Core/Mesh/PolyConnectivity.hh>
60 #include <OpenMesh/Core/Mesh/FinalMeshItemsT.hh>
61 #include <vector>
62
63
64 //== NAMESPACES ===============================================================
65
66
67 namespace OpenMesh {
68
69 //== CLASS DEFINITION =========================================================
70
71
86 template <class Kernel>
87 class PolyMeshT : public Kernel
88 {
89 public:
90
92 typedef PolyMeshT<Kernel> This;
93 //--- item types ---
94
96 enum { IsPolyMesh = 1 };
98 enum { IsTriMesh = 0 };
99 static bool is_polymesh() { return true; }
100 static bool is_trimesh() { return false; }
102
104
105 typedef typename Kernel::Scalar Scalar;
108 typedef typename Kernel::Point Point;
110 typedef typename Kernel::Normal Normal;
112 typedef typename Kernel::Color Color;
114 typedef typename Kernel::TexCoord1D TexCoord1D;
116 typedef typename Kernel::TexCoord2D TexCoord2D;
118 typedef typename Kernel::TexCoord3D TexCoord3D;
120 typedef typename Kernel::Vertex Vertex;
122 typedef typename Kernel::Halfedge Halfedge;
124 typedef typename Kernel::Edge Edge;
126 typedef typename Kernel::Face Face;
128
129 //--- handle types ---
130
132 typedef typename Kernel::VertexHandle VertexHandle;
133 typedef typename Kernel::HalfedgeHandle HalfedgeHandle;
134 typedef typename Kernel::EdgeHandle EdgeHandle;
135 typedef typename Kernel::FaceHandle FaceHandle;
136
137
138
139 typedef typename Kernel::VertexIter VertexIter;
140 typedef typename Kernel::HalfedgeIter HalfedgeIter;
141 typedef typename Kernel::EdgeIter EdgeIter;
142 typedef typename Kernel::FaceIter FaceIter;
143
144 typedef typename Kernel::ConstVertexIter ConstVertexIter;
145 typedef typename Kernel::ConstHalfedgeIter ConstHalfedgeIter;
146 typedef typename Kernel::ConstEdgeIter ConstEdgeIter;
147 typedef typename Kernel::ConstFaceIter ConstFaceIter;
149
150 //--- circulators ---
151
157 typedef typename Kernel::VertexVertexIter VertexVertexIter;
159 typedef typename Kernel::VertexOHalfedgeIter VertexOHalfedgeIter;
160 typedef typename Kernel::VertexIHalfedgeIter VertexIHalfedgeIter;
161 typedef typename Kernel::VertexEdgeIter VertexEdgeIter;
162 typedef typename Kernel::VertexFaceIter VertexFaceIter;
163 typedef typename Kernel::FaceVertexIter FaceVertexIter;
164 typedef typename Kernel::FaceHalfedgeIter FaceHalfedgeIter;
165 typedef typename Kernel::FaceEdgeIter FaceEdgeIter;
166 typedef typename Kernel::FaceFaceIter FaceFaceIter;
167
168 typedef typename Kernel::ConstVertexVertexIter ConstVertexVertexIter;
169 typedef typename Kernel::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter;
170 typedef typename Kernel::ConstVertexIHalfedgeIter ConstVertexIHalfedgeIter;
171 typedef typename Kernel::ConstVertexEdgeIter ConstVertexEdgeIter;
172 typedef typename Kernel::ConstVertexFaceIter ConstVertexFaceIter;
173 typedef typename Kernel::ConstFaceVertexIter ConstFaceVertexIter;
174 typedef typename Kernel::ConstFaceHalfedgeIter ConstFaceHalfedgeIter;
175 typedef typename Kernel::ConstFaceEdgeIter ConstFaceEdgeIter;
176 typedef typename Kernel::ConstFaceFaceIter ConstFaceFaceIter;
178
179
180 // --- constructor/destructor
181 PolyMeshT() {}
182 virtual ~PolyMeshT() {}
183
188 // --- creation ---
189 inline VertexHandle new_vertex()
190 { return Kernel::new_vertex(); }
191
192 inline VertexHandle new_vertex(const Point& _p)
193 {
194 VertexHandle vh(Kernel::new_vertex());
195 this->set_point(vh, _p);
196 return vh;
197 }
198
199 inline VertexHandle add_vertex(const Point& _p)
200 { return new_vertex(_p); }
201
202 // --- normal vectors ---
203
207
215 void update_normals();
216
218 void update_normal(FaceHandle _fh)
219 { this->set_normal(_fh, calc_face_normal(_fh)); }
220
226 void update_face_normals();
227
229 virtual Normal calc_face_normal(FaceHandle _fh) const;
230
232 Normal calc_face_normal(const Point& _p0, const Point& _p1,
233 const Point& _p2) const;
235 void calc_face_centroid(FaceHandle _fh, Point& _pt) const {
236 _pt = calc_face_centroid(_fh);
237 }
238
240 Point calc_face_centroid(FaceHandle _fh) const;
241
243 void update_normal(HalfedgeHandle _heh, const double _feature_angle = 0.8)
244 { this->set_normal(_heh, calc_halfedge_normal(_heh)); }
245
255 void update_halfedge_normals(const double _feature_angle = 0.8);
256
269 virtual Normal calc_halfedge_normal(HalfedgeHandle _heh, const double _feature_angle = 0.8) const;
270
271
274 bool is_estimated_feature_edge(HalfedgeHandle _heh, const double _feature_angle) const;
275
277 void update_normal(VertexHandle _vh)
278 { this->set_normal(_vh, calc_vertex_normal(_vh)); }
279
289 void update_vertex_normals();
290
303 Normal calc_vertex_normal(VertexHandle _vh) const;
304
312 void calc_vertex_normal_fast(VertexHandle _vh, Normal& _n) const;
313 void calc_vertex_normal_correct(VertexHandle _vh, Normal& _n) const;
314 void calc_vertex_normal_loop(VertexHandle _vh, Normal& _n) const;
315
316
318
319 // --- Geometry API - still in development ---
320
323 void calc_edge_vector(EdgeHandle _eh, Normal& _edge_vec) const
324 {
325 _edge_vec = calc_edge_vector(_eh);
326 }
327
330 Normal calc_edge_vector(EdgeHandle _eh) const
331 {
332 return calc_edge_vector(this->halfedge_handle(_eh,0));
333 }
334
337 void calc_edge_vector(HalfedgeHandle _heh, Normal& _edge_vec) const
338 {
339 _edge_vec = calc_edge_vector(_heh);
340 }
341
344 Normal calc_edge_vector(HalfedgeHandle _heh) const
345 {
346 return this->point(this->to_vertex_handle(_heh)) -
347 this->point(this->from_vertex_handle(_heh));
348 }
349
350 // Calculates the length of the edge _eh
351 Scalar calc_edge_length(EdgeHandle _eh) const
352 { return calc_edge_length(this->halfedge_handle(_eh,0)); }
353
356 Scalar calc_edge_length(HalfedgeHandle _heh) const
357 { return (Scalar)sqrt(calc_edge_sqr_length(_heh)); }
358
359 Scalar calc_edge_sqr_length(EdgeHandle _eh) const
360 { return calc_edge_sqr_length(this->halfedge_handle(_eh,0)); }
361
362 Scalar calc_edge_sqr_length(HalfedgeHandle _heh) const
363 {
364 Normal edge_vec;
365 calc_edge_vector(_heh, edge_vec);
366 return edge_vec.sqrnorm();
367 }
368
373 void calc_sector_vectors(HalfedgeHandle _in_heh, Normal& _vec0, Normal& _vec1) const
374 {
375 calc_edge_vector(this->next_halfedge_handle(_in_heh), _vec0);//p2 - p1
376 calc_edge_vector(this->opposite_halfedge_handle(_in_heh), _vec1);//p0 - p1
377 }
378
384 Scalar calc_sector_angle(HalfedgeHandle _in_heh) const
385 {
386 Normal v0, v1;
387 calc_sector_vectors(_in_heh, v0, v1);
388 Scalar denom = v0.norm()*v1.norm();
389 if (is_zero(denom))
390 {
391 return 0;
392 }
393 Scalar cos_a = dot(v0 , v1) / denom;
394 if (this->is_boundary(_in_heh))
395 {//determine if the boundary sector is concave or convex
396 FaceHandle fh(this->face_handle(this->opposite_halfedge_handle(_in_heh)));
397 Normal f_n(calc_face_normal(fh));//this normal is (for convex fh) OK
398 Scalar sign_a = dot(cross(v0, v1), f_n);
399 return angle(cos_a, sign_a);
400 }
401 else
402 {
403 return acos(sane_aarg(cos_a));
404 }
405 }
406
407 // calculate the cos and the sin of angle <(_in_heh,next_halfedge(_in_heh))
408 /*
409 void calc_sector_angle_cos_sin(HalfedgeHandle _in_heh, Scalar& _cos_a, Scalar& _sin_a) const
410 {
411 Normal in_vec, out_vec;
412 calc_edge_vector(_in_heh, in_vec);
413 calc_edge_vector(next_halfedge_handle(_in_heh), out_vec);
414 Scalar denom = in_vec.norm()*out_vec.norm();
415 if (is_zero(denom))
416 {
417 _cos_a = 1;
418 _sin_a = 0;
419 }
420 else
421 {
422 _cos_a = dot(in_vec, out_vec)/denom;
423 _sin_a = cross(in_vec, out_vec).norm()/denom;
424 }
425 }
426 */
429 void calc_sector_normal(HalfedgeHandle _in_heh, Normal& _sector_normal) const
430 {
431 Normal vec0, vec1;
432 calc_sector_vectors(_in_heh, vec0, vec1);
433 _sector_normal = cross(vec0, vec1);//(p2-p1)^(p0-p1)
434 }
435
439 Scalar calc_sector_area(HalfedgeHandle _in_heh) const
440 {
441 Normal sector_normal;
442 calc_sector_normal(_in_heh, sector_normal);
443 return sector_normal.norm()/2;
444 }
445
448 Scalar calc_dihedral_angle_fast(HalfedgeHandle _heh) const
449 {
450 // Make sure that we have face normals on the mesh
451 assert(Kernel::has_face_normals());
452
453 if (this->is_boundary(this->edge_handle(_heh)))
454 {//the dihedral angle at a boundary edge is 0
455 return 0;
456 }
457 const Normal& n0 = this->normal(this->face_handle(_heh));
458 const Normal& n1 = this->normal(this->face_handle(this->opposite_halfedge_handle(_heh)));
459 Normal he;
460 calc_edge_vector(_heh, he);
461 Scalar da_cos = dot(n0, n1);
462 //should be normalized, but we need only the sign
463 Scalar da_sin_sign = dot(cross(n0, n1), he);
464 return angle(da_cos, da_sin_sign);
465 }
466
469 Scalar calc_dihedral_angle_fast(EdgeHandle _eh) const
470 { return calc_dihedral_angle_fast(this->halfedge_handle(_eh,0)); }
471
472 // calculates the dihedral angle on the halfedge _heh
473 Scalar calc_dihedral_angle(HalfedgeHandle _heh) const
474 {
475 if (this->is_boundary(this->edge_handle(_heh)))
476 {//the dihedral angle at a boundary edge is 0
477 return 0;
478 }
479 Normal n0, n1, he;
480 calc_sector_normal(_heh, n0);
481 calc_sector_normal(this->opposite_halfedge_handle(_heh), n1);
482 calc_edge_vector(_heh, he);
483 Scalar denom = n0.norm()*n1.norm();
484 if (denom == Scalar(0))
485 {
486 return 0;
487 }
488 Scalar da_cos = dot(n0, n1)/denom;
489 //should be normalized, but we need only the sign
490 Scalar da_sin_sign = dot(cross(n0, n1), he);
491 return angle(da_cos, da_sin_sign);
492 }
493
494 // calculates the dihedral angle on the edge _eh
495 Scalar calc_dihedral_angle(EdgeHandle _eh) const
496 { return calc_dihedral_angle(this->halfedge_handle(_eh,0)); }
497
500 unsigned int find_feature_edges(Scalar _angle_tresh = OpenMesh::deg_to_rad(44.0));
501 // --- misc ---
502
504 inline void split(FaceHandle _fh, const Point& _p)
505 { Kernel::split(_fh, add_vertex(_p)); }
506
507 inline void split(FaceHandle _fh, VertexHandle _vh)
508 { Kernel::split(_fh, _vh); }
509
510 inline void split(EdgeHandle _eh, const Point& _p)
511 { Kernel::split_edge(_eh, add_vertex(_p)); }
512
513 inline void split(EdgeHandle _eh, VertexHandle _vh)
514 { Kernel::split_edge(_eh, _vh); }
515
516 };
517
543 template<typename LHS, typename KERNEL>
544 LHS mesh_cast(PolyMeshT<KERNEL> &rhs) {
545 return MeshCast<LHS, PolyMeshT<KERNEL>&>::cast(rhs);
546 }
547
548 template<typename LHS, typename KERNEL>
549 LHS mesh_cast(PolyMeshT<KERNEL> *rhs) {
550 return MeshCast<LHS, PolyMeshT<KERNEL>*>::cast(rhs);
551 }
552
553 template<typename LHS, typename KERNEL>
554 const LHS mesh_cast(const PolyMeshT<KERNEL> &rhs) {
555 return MeshCast<LHS, const PolyMeshT<KERNEL>&>::cast(rhs);
556 }
557
558 template<typename LHS, typename KERNEL>
559 const LHS mesh_cast(const PolyMeshT<KERNEL> *rhs) {
560 return MeshCast<LHS, const PolyMeshT<KERNEL>*>::cast(rhs);
561 }
562
563
564 //=============================================================================
565 } // namespace OpenMesh
566 //=============================================================================
567 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_POLYMESH_C)
568 # define OPENMESH_POLYMESH_TEMPLATES
569 # include "PolyMeshT.cc"
570 #endif
571 //=============================================================================
572 #endif // OPENMESH_POLYMESHT_HH defined
573 //=============================================================================
OpenMesh::PolyMeshT::calc_sector_vectors
void calc_sector_vectors(HalfedgeHandle _in_heh, Normal &_vec0, Normal &_vec1) const
defines a consistent representation of a sector geometry: the halfedge _in_heh defines the sector ori...
Definition: PolyMeshT.hh:373
OpenMesh::EdgeHandle
Handle for a edge entity.
Definition: Handles.hh:128
OpenMesh::mesh_cast
LHS mesh_cast(PolyMeshT< KERNEL > &rhs)
Cast a mesh with different but identical traits into each other.
Definition: PolyMeshT.hh:544
OpenMesh::is_zero
bool is_zero(const T &_a, Real _eps)
comparison operators with user-selected precision control
Definition: MathDefs.hh:58
OpenMesh::cross
osg::Vec3f cross(const osg::Vec3f &_v1, const osg::Vec3f &_v2)
Adapter for osg vector member computing a scalar product.
Definition: VectorAdapter.hh:189
OpenMesh::PolyMeshT::FaceEdgeIter
Kernel::FaceEdgeIter FaceEdgeIter
Circulator.
Definition: PolyMeshT.hh:165
OpenMesh::sane_aarg
T sane_aarg(T _aarg)
Trigonometry/angles - related.
Definition: MathDefs.hh:119
OpenMesh::angle
T angle(T _cos_angle, T _sin_angle)
returns the angle determined by its cos and the sign of its sin result is positive if the angle is in...
Definition: MathDefs.hh:137
OpenMesh::PolyMeshT
Base type for a polygonal mesh.
Definition: PolyMeshT.hh:87
OpenMesh::PolyMeshT::calc_vertex_normal_fast
void calc_vertex_normal_fast(VertexHandle _vh, Normal &_n) const
Different methods for calculation of the normal at _vh:
Definition: PolyMeshT.cc:333
OpenMesh::PolyMeshT::ConstVertexFaceIter
Kernel::ConstVertexFaceIter ConstVertexFaceIter
Circulator.
Definition: PolyMeshT.hh:172
OpenMesh::PolyMeshT::split
void split(FaceHandle _fh, const Point &_p)
Face split (= 1-to-n split)
Definition: PolyMeshT.hh:504
OpenMesh::PolyMeshT::calc_vertex_normal_correct
void calc_vertex_normal_correct(VertexHandle _vh, Normal &_n) const
Compute normals for all primitives.
Definition: PolyMeshT.cc:343
OpenMesh::PolyMeshT::Halfedge
Kernel::Halfedge Halfedge
Halfedge type.
Definition: PolyMeshT.hh:122
OpenMesh::PolyMeshT::calc_dihedral_angle_fast
Scalar calc_dihedral_angle_fast(HalfedgeHandle _heh) const
calculates the dihedral angle on the halfedge _heh
Definition: PolyMeshT.hh:448
OpenMesh::Attributes::TexCoord3D
Add 3D texture coordinates (vertices, halfedges)
Definition: Attributes.hh:86
OpenMesh::PolyMeshT::VertexFaceIter
Kernel::VertexFaceIter VertexFaceIter
Circulator.
Definition: PolyMeshT.hh:162
OpenMesh::PolyMeshT::update_normal
void update_normal(FaceHandle _fh)
Update normal for face _fh.
Definition: PolyMeshT.hh:218
OpenMesh::PolyMeshT::calc_dihedral_angle_fast
Scalar calc_dihedral_angle_fast(EdgeHandle _eh) const
calculates the dihedral angle on the edge _eh
Definition: PolyMeshT.hh:469
OpenMesh::PolyMeshT::TexCoord2D
Kernel::TexCoord2D TexCoord2D
TexCoord2D type.
Definition: PolyMeshT.hh:116
OpenMesh::PolyMeshT::ConstVertexEdgeIter
Kernel::ConstVertexEdgeIter ConstVertexEdgeIter
Circulator.
Definition: PolyMeshT.hh:171
OpenMesh::PolyMeshT::update_face_normals
void update_face_normals()
Update normal vectors for all faces.
Definition: PolyMeshT.cc:205
OpenMesh::PolyMeshT::update_vertex_normals
void update_vertex_normals()
Update normal vectors for all vertices.
Definition: PolyMeshT.cc:394
OpenMesh::PolyMeshT::update_halfedge_normals
void update_halfedge_normals(const double _feature_angle=0.8)
Update normal vectors for all halfedges.
Definition: PolyMeshT.cc:220
OpenMesh::PolyMeshT::update_normals
void update_normals()
Compute normals for all primitives.
Definition: PolyMeshT.cc:187
OpenMesh::PolyMeshT::Scalar
Kernel::Scalar Scalar
Scalar type.
Definition: PolyMeshT.hh:106
OpenMesh::PolyMeshT::calc_edge_vector
void calc_edge_vector(HalfedgeHandle _heh, Normal &_edge_vec) const
Calculates the edge vector as the difference of the the points defined by to_vertex_handle() and from...
Definition: PolyMeshT.hh:337
OpenMesh::PolyMeshT::is_polymesh
static bool is_polymesh()
Determine whether this is a PolyMeshT or TriMeshT ( This function does not check the per face vertex ...
Definition: PolyMeshT.hh:99
OpenMesh::Attributes::Color
Add colors to mesh item (vertices/faces/edges)
Definition: Attributes.hh:81
OpenMesh::PolyMeshT::This
PolyMeshT< Kernel > This
Self type. Used to specify iterators/circulators.
Definition: PolyMeshT.hh:92
OpenMesh::PolyMeshT::calc_edge_length
Scalar calc_edge_length(HalfedgeHandle _heh) const
Calculates the length of the edge _heh.
Definition: PolyMeshT.hh:356
OpenMesh::FaceHandle
Handle for a face entity.
Definition: Handles.hh:135
OpenMesh::VertexHandle
Handle for a vertex entity.
Definition: Handles.hh:114
OpenMesh::PolyMeshT::Face
Kernel::Face Face
Face type.
Definition: PolyMeshT.hh:126
OpenMesh::PolyMeshT::calc_face_centroid
void calc_face_centroid(FaceHandle _fh, Point &_pt) const
calculates the average of the vertices defining _fh
Definition: PolyMeshT.hh:235
OpenMesh::PolyMeshT::new_vertex
VertexHandle new_vertex()
Uses default copy and assignment operator.
Definition: PolyMeshT.hh:189
OpenMesh::PolyMeshT::calc_edge_vector
Normal calc_edge_vector(HalfedgeHandle _heh) const
Calculates the edge vector as the difference of the the points defined by to_vertex_handle() and from...
Definition: PolyMeshT.hh:344
OpenMesh::Attributes::Normal
Add normals to mesh item (vertices/faces)
Definition: Attributes.hh:80
OpenMesh::PolyMeshT::update_normal
void update_normal(HalfedgeHandle _heh, const double _feature_angle=0.8)
Update normal for halfedge _heh.
Definition: PolyMeshT.hh:243
OpenMesh::PolyMeshT::ConstVertexIHalfedgeIter
Kernel::ConstVertexIHalfedgeIter ConstVertexIHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:170
OpenMesh::PolyMeshT::update_normal
void update_normal(VertexHandle _vh)
Update normal for vertex _vh.
Definition: PolyMeshT.hh:277
OpenMesh::PolyMeshT::VertexHandle
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Definition: PolyMeshT.hh:132
OpenMesh::PolyMeshT::Normal
Kernel::Normal Normal
Normal type.
Definition: PolyMeshT.hh:110
OpenMesh::PolyMeshT::Color
Kernel::Color Color
Color type.
Definition: PolyMeshT.hh:112
OpenMesh::PolyMeshT::VertexOHalfedgeIter
Kernel::VertexOHalfedgeIter VertexOHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:159
OpenMesh::PolyMeshT::FaceFaceIter
Kernel::FaceFaceIter FaceFaceIter
Circulator.
Definition: PolyMeshT.hh:166
OpenMesh::PolyMeshT::VertexIHalfedgeIter
Kernel::VertexIHalfedgeIter VertexIHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:160
OpenMesh::PolyMeshT::FaceVertexIter
Kernel::FaceVertexIter FaceVertexIter
Circulator.
Definition: PolyMeshT.hh:163
OpenMesh::PolyMeshT::is_estimated_feature_edge
bool is_estimated_feature_edge(HalfedgeHandle _heh, const double _feature_angle) const
identifies feature edges w.r.t.
Definition: PolyMeshT.cc:288
OpenMesh::PolyMeshT::ConstFaceFaceIter
Kernel::ConstFaceFaceIter ConstFaceFaceIter
Circulator.
Definition: PolyMeshT.hh:176
OpenMesh::dot
osg::Vec3f::ValueType dot(const osg::Vec3f &_v1, const osg::Vec3f &_v2)
Adapter for osg vector member computing a scalar product.
Definition: VectorAdapter.hh:174
OpenMesh::PolyMeshT::TexCoord1D
Kernel::TexCoord1D TexCoord1D
TexCoord1D type.
Definition: PolyMeshT.hh:114
OpenMesh::PolyMeshT::calc_sector_normal
void calc_sector_normal(HalfedgeHandle _in_heh, Normal &_sector_normal) const
calculates the normal (non-normalized) of the face sector defined by the angle <(_in_heh,next_halfedge(_in_heh))
Definition: PolyMeshT.hh:429
OpenMesh::PolyMeshT::calc_vertex_normal
Normal calc_vertex_normal(VertexHandle _vh) const
Calculate vertex normal for one specific vertex.
Definition: PolyMeshT.cc:319
OpenMesh::PolyMeshT::ConstFaceVertexIter
Kernel::ConstFaceVertexIter ConstFaceVertexIter
Circulator.
Definition: PolyMeshT.hh:173
OpenMesh::MeshCast
Cast a mesh with different but identical traits into each other.
Definition: FinalMeshItemsT.hh:176
OpenMesh::PolyMeshT::Vertex
Kernel::Vertex Vertex
Vertex type.
Definition: PolyMeshT.hh:120
OpenMesh::PolyMeshT::Edge
Kernel::Edge Edge
Edge type.
Definition: PolyMeshT.hh:124
OpenMesh::PolyMeshT::TexCoord3D
Kernel::TexCoord3D TexCoord3D
TexCoord3D type.
Definition: PolyMeshT.hh:118
OpenMesh::PolyMeshT::Point
Kernel::Point Point
Coordinate type.
Definition: PolyMeshT.hh:108
OpenMesh::Attributes::TexCoord1D
Add 1D texture coordinates (vertices, halfedges)
Definition: Attributes.hh:84
OpenMesh::PolyMeshT::ConstFaceEdgeIter
Kernel::ConstFaceEdgeIter ConstFaceEdgeIter
Circulator.
Definition: PolyMeshT.hh:175
OpenMesh::PolyMeshT::VertexEdgeIter
Kernel::VertexEdgeIter VertexEdgeIter
Circulator.
Definition: PolyMeshT.hh:161
OpenMesh::PolyMeshT::calc_face_normal
virtual Normal calc_face_normal(FaceHandle _fh) const
Calculate normal vector for face _fh.
Definition: PolyMeshT.cc:94
OpenMesh::PolyMeshT::FaceHalfedgeIter
Kernel::FaceHalfedgeIter FaceHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:164
OpenMesh::PolyMeshT::ConstVertexVertexIter
Kernel::ConstVertexVertexIter ConstVertexVertexIter
Circulator.
Definition: PolyMeshT.hh:168
OpenMesh::PolyMeshT::calc_edge_vector
void calc_edge_vector(EdgeHandle _eh, Normal &_edge_vec) const
Calculates the edge vector as the vector defined by the halfedge with id #0 (see below) ...
Definition: PolyMeshT.hh:323
OpenMesh::HalfedgeHandle
Handle for a halfedge entity.
Definition: Handles.hh:121
OpenMesh::PolyMeshT::VertexVertexIter
Kernel::VertexVertexIter VertexVertexIter
Circulator.
Definition: PolyMeshT.hh:158
OpenMesh::PolyMeshT::calc_vertex_normal_loop
void calc_vertex_normal_loop(VertexHandle _vh, Normal &_n) const
Compute normals for all primitives.
Definition: PolyMeshT.cc:371
OpenMesh::PolyMeshT::ConstVertexOHalfedgeIter
Kernel::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:169
OpenMesh::PolyMeshT::find_feature_edges
unsigned int find_feature_edges(Scalar _angle_tresh=OpenMesh::deg_to_rad(44.0))
tags an edge as a feature if its dihedral angle is larger than _angle_tresh returns the number of the...
Definition: PolyMeshT.cc:70
OpenMesh::PolyMeshT::calc_sector_angle
Scalar calc_sector_angle(HalfedgeHandle _in_heh) const
calculates the sector angle.
Definition: PolyMeshT.hh:384
OpenMesh::PolyMeshT::calc_sector_area
Scalar calc_sector_area(HalfedgeHandle _in_heh) const
calculates the area of the face sector defined by the angle <(_in_heh,next_halfedge(_in_heh)) NOTE: s...
Definition: PolyMeshT.hh:439
OpenMesh::Attributes::TexCoord2D
Add 2D texture coordinates (vertices, halfedges)
Definition: Attributes.hh:85
OpenMesh::PolyMeshT::calc_halfedge_normal
virtual Normal calc_halfedge_normal(HalfedgeHandle _heh, const double _feature_angle=0.8) const
Calculate halfedge normal for one specific halfedge.
Definition: PolyMeshT.cc:235
OpenMesh::PolyMeshT::is_trimesh
static bool is_trimesh()
Determine whether this is a PolyMeshT or TriMeshT ( This function does not check the per face vertex ...
Definition: PolyMeshT.hh:100
OpenMesh::PolyMeshT::ConstFaceHalfedgeIter
Kernel::ConstFaceHalfedgeIter ConstFaceHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:174
OpenMesh::PolyMeshT::calc_edge_vector
Normal calc_edge_vector(EdgeHandle _eh) const
Calculates the edge vector as the vector defined by the halfedge with id #0 (see below) ...
Definition: PolyMeshT.hh:330