| OpenMesh

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

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PolyMeshT.hh
1 /* ========================================================================= *
2 * *
3 * OpenMesh *
4 * Copyright (c) 2001-2015, RWTH-Aachen University *
5 * Department of Computer Graphics and Multimedia *
6 * All rights reserved. *
7 * www.openmesh.org *
8 * *
9 *---------------------------------------------------------------------------*
10 * This file is part of OpenMesh. *
11 *---------------------------------------------------------------------------*
12 * *
13 * Redistribution and use in source and binary forms, with or without *
14 * modification, are permitted provided that the following conditions *
15 * are met: *
16 * *
17 * 1. Redistributions of source code must retain the above copyright notice, *
18 * this list of conditions and the following disclaimer. *
19 * *
20 * 2. Redistributions in binary form must reproduce the above copyright *
21 * notice, this list of conditions and the following disclaimer in the *
22 * documentation and/or other materials provided with the distribution. *
23 * *
24 * 3. Neither the name of the copyright holder nor the names of its *
25 * contributors may be used to endorse or promote products derived from *
26 * this software without specific prior written permission. *
27 * *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 * ========================================================================= */
41
42 /*===========================================================================*\
43 * *
44 * $Revision: 1258 $ *
45 * $Date: 2015-04-28 15:07:46 +0200 (Di, 28 Apr 2015) $ *
46 * *
47 \*===========================================================================*/
48
49
50 //=============================================================================
51 //
52 // CLASS PolyMeshT
53 //
54 //=============================================================================
55
56
57 #ifndef OPENMESH_POLYMESHT_HH
58 #define OPENMESH_POLYMESHT_HH
59
60
61 //== INCLUDES =================================================================
62
63
64 #include <OpenMesh/Core/System/config.h>
65 #include <OpenMesh/Core/Geometry/MathDefs.hh>
66 #include <OpenMesh/Core/Mesh/PolyConnectivity.hh>
67 #include <OpenMesh/Core/Mesh/FinalMeshItemsT.hh>
68 #include <vector>
69
70
71 //== NAMESPACES ===============================================================
72
73
74 namespace OpenMesh {
75
76 //== CLASS DEFINITION =========================================================
77
78
93 template <class Kernel>
94 class PolyMeshT : public Kernel
95 {
96 public:
97
99 typedef PolyMeshT<Kernel> This;
100 //--- item types ---
101
103 enum { IsPolyMesh = 1 };
105 enum { IsTriMesh = 0 };
106 static bool is_polymesh() { return true; }
107 static bool is_trimesh() { return false; }
109
111
112 typedef typename Kernel::Scalar Scalar;
115 typedef typename Kernel::Point Point;
117 typedef typename Kernel::Normal Normal;
119 typedef typename Kernel::Color Color;
121 typedef typename Kernel::TexCoord1D TexCoord1D;
123 typedef typename Kernel::TexCoord2D TexCoord2D;
125 typedef typename Kernel::TexCoord3D TexCoord3D;
127 typedef typename Kernel::Vertex Vertex;
129 typedef typename Kernel::Halfedge Halfedge;
131 typedef typename Kernel::Edge Edge;
133 typedef typename Kernel::Face Face;
135
136 //--- handle types ---
137
139 typedef typename Kernel::VertexHandle VertexHandle;
140 typedef typename Kernel::HalfedgeHandle HalfedgeHandle;
141 typedef typename Kernel::EdgeHandle EdgeHandle;
142 typedef typename Kernel::FaceHandle FaceHandle;
143
144
145
146 typedef typename Kernel::VertexIter VertexIter;
147 typedef typename Kernel::HalfedgeIter HalfedgeIter;
148 typedef typename Kernel::EdgeIter EdgeIter;
149 typedef typename Kernel::FaceIter FaceIter;
150
151 typedef typename Kernel::ConstVertexIter ConstVertexIter;
152 typedef typename Kernel::ConstHalfedgeIter ConstHalfedgeIter;
153 typedef typename Kernel::ConstEdgeIter ConstEdgeIter;
154 typedef typename Kernel::ConstFaceIter ConstFaceIter;
156
157 //--- circulators ---
158
164 typedef typename Kernel::VertexVertexIter VertexVertexIter;
166 typedef typename Kernel::VertexOHalfedgeIter VertexOHalfedgeIter;
167 typedef typename Kernel::VertexIHalfedgeIter VertexIHalfedgeIter;
168 typedef typename Kernel::VertexEdgeIter VertexEdgeIter;
169 typedef typename Kernel::VertexFaceIter VertexFaceIter;
170 typedef typename Kernel::FaceVertexIter FaceVertexIter;
171 typedef typename Kernel::FaceHalfedgeIter FaceHalfedgeIter;
172 typedef typename Kernel::FaceEdgeIter FaceEdgeIter;
173 typedef typename Kernel::FaceFaceIter FaceFaceIter;
174
175 typedef typename Kernel::ConstVertexVertexIter ConstVertexVertexIter;
176 typedef typename Kernel::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter;
177 typedef typename Kernel::ConstVertexIHalfedgeIter ConstVertexIHalfedgeIter;
178 typedef typename Kernel::ConstVertexEdgeIter ConstVertexEdgeIter;
179 typedef typename Kernel::ConstVertexFaceIter ConstVertexFaceIter;
180 typedef typename Kernel::ConstFaceVertexIter ConstFaceVertexIter;
181 typedef typename Kernel::ConstFaceHalfedgeIter ConstFaceHalfedgeIter;
182 typedef typename Kernel::ConstFaceEdgeIter ConstFaceEdgeIter;
183 typedef typename Kernel::ConstFaceFaceIter ConstFaceFaceIter;
185
186
187 // --- constructor/destructor
188 PolyMeshT() {}
189 virtual ~PolyMeshT() {}
190
195 // --- creation ---
196 inline VertexHandle new_vertex()
197 { return Kernel::new_vertex(); }
198
199 inline VertexHandle new_vertex(const Point& _p)
200 {
201 VertexHandle vh(Kernel::new_vertex());
202 this->set_point(vh, _p);
203 return vh;
204 }
205
206 inline VertexHandle add_vertex(const Point& _p)
207 { return new_vertex(_p); }
208
209 // --- normal vectors ---
210
214
222 void update_normals();
223
225 void update_normal(FaceHandle _fh)
226 { this->set_normal(_fh, calc_face_normal(_fh)); }
227
233 void update_face_normals();
234
236 virtual Normal calc_face_normal(FaceHandle _fh) const;
237
239 Normal calc_face_normal(const Point& _p0, const Point& _p1,
240 const Point& _p2) const;
242 void calc_face_centroid(FaceHandle _fh, Point& _pt) const {
243 _pt = calc_face_centroid(_fh);
244 }
245
247 Point calc_face_centroid(FaceHandle _fh) const;
248
250 void update_normal(HalfedgeHandle _heh, const double _feature_angle = 0.8)
251 { this->set_normal(_heh, calc_halfedge_normal(_heh)); }
252
262 void update_halfedge_normals(const double _feature_angle = 0.8);
263
276 virtual Normal calc_halfedge_normal(HalfedgeHandle _heh, const double _feature_angle = 0.8) const;
277
278
281 bool is_estimated_feature_edge(HalfedgeHandle _heh, const double _feature_angle) const;
282
284 void update_normal(VertexHandle _vh)
285 { this->set_normal(_vh, calc_vertex_normal(_vh)); }
286
296 void update_vertex_normals();
297
310 Normal calc_vertex_normal(VertexHandle _vh) const;
311
319 void calc_vertex_normal_fast(VertexHandle _vh, Normal& _n) const;
320 void calc_vertex_normal_correct(VertexHandle _vh, Normal& _n) const;
321 void calc_vertex_normal_loop(VertexHandle _vh, Normal& _n) const;
322
323
325
326 // --- Geometry API - still in development ---
327
330 void calc_edge_vector(EdgeHandle _eh, Normal& _edge_vec) const
331 {
332 _edge_vec = calc_edge_vector(_eh);
333 }
334
337 Normal calc_edge_vector(EdgeHandle _eh) const
338 {
339 return calc_edge_vector(this->halfedge_handle(_eh,0));
340 }
341
344 void calc_edge_vector(HalfedgeHandle _heh, Normal& _edge_vec) const
345 {
346 _edge_vec = calc_edge_vector(_heh);
347 }
348
351 Normal calc_edge_vector(HalfedgeHandle _heh) const
352 {
353 return this->point(this->to_vertex_handle(_heh)) -
354 this->point(this->from_vertex_handle(_heh));
355 }
356
357 // Calculates the length of the edge _eh
358 Scalar calc_edge_length(EdgeHandle _eh) const
359 { return calc_edge_length(this->halfedge_handle(_eh,0)); }
360
363 Scalar calc_edge_length(HalfedgeHandle _heh) const
364 { return (Scalar)sqrt(calc_edge_sqr_length(_heh)); }
365
366 Scalar calc_edge_sqr_length(EdgeHandle _eh) const
367 { return calc_edge_sqr_length(this->halfedge_handle(_eh,0)); }
368
369 Scalar calc_edge_sqr_length(HalfedgeHandle _heh) const
370 {
371 Normal edge_vec;
372 calc_edge_vector(_heh, edge_vec);
373 return edge_vec.sqrnorm();
374 }
375
380 void calc_sector_vectors(HalfedgeHandle _in_heh, Normal& _vec0, Normal& _vec1) const
381 {
382 calc_edge_vector(this->next_halfedge_handle(_in_heh), _vec0);//p2 - p1
383 calc_edge_vector(this->opposite_halfedge_handle(_in_heh), _vec1);//p0 - p1
384 }
385
391 Scalar calc_sector_angle(HalfedgeHandle _in_heh) const
392 {
393 Normal v0, v1;
394 calc_sector_vectors(_in_heh, v0, v1);
395 Scalar denom = v0.norm()*v1.norm();
396 if (is_zero(denom))
397 {
398 return 0;
399 }
400 Scalar cos_a = dot(v0 , v1) / denom;
401 if (this->is_boundary(_in_heh))
402 {//determine if the boundary sector is concave or convex
403 FaceHandle fh(this->face_handle(this->opposite_halfedge_handle(_in_heh)));
404 Normal f_n(calc_face_normal(fh));//this normal is (for convex fh) OK
405 Scalar sign_a = dot(cross(v0, v1), f_n);
406 return angle(cos_a, sign_a);
407 }
408 else
409 {
410 return acos(sane_aarg(cos_a));
411 }
412 }
413
414 // calculate the cos and the sin of angle <(_in_heh,next_halfedge(_in_heh))
415 /*
416 void calc_sector_angle_cos_sin(HalfedgeHandle _in_heh, Scalar& _cos_a, Scalar& _sin_a) const
417 {
418 Normal in_vec, out_vec;
419 calc_edge_vector(_in_heh, in_vec);
420 calc_edge_vector(next_halfedge_handle(_in_heh), out_vec);
421 Scalar denom = in_vec.norm()*out_vec.norm();
422 if (is_zero(denom))
423 {
424 _cos_a = 1;
425 _sin_a = 0;
426 }
427 else
428 {
429 _cos_a = dot(in_vec, out_vec)/denom;
430 _sin_a = cross(in_vec, out_vec).norm()/denom;
431 }
432 }
433 */
436 void calc_sector_normal(HalfedgeHandle _in_heh, Normal& _sector_normal) const
437 {
438 Normal vec0, vec1;
439 calc_sector_vectors(_in_heh, vec0, vec1);
440 _sector_normal = cross(vec0, vec1);//(p2-p1)^(p0-p1)
441 }
442
446 Scalar calc_sector_area(HalfedgeHandle _in_heh) const
447 {
448 Normal sector_normal;
449 calc_sector_normal(_in_heh, sector_normal);
450 return sector_normal.norm()/2;
451 }
452
455 Scalar calc_dihedral_angle_fast(HalfedgeHandle _heh) const
456 {
457 // Make sure that we have face normals on the mesh
458 assert(Kernel::has_face_normals());
459
460 if (this->is_boundary(this->edge_handle(_heh)))
461 {//the dihedral angle at a boundary edge is 0
462 return 0;
463 }
464 const Normal& n0 = this->normal(this->face_handle(_heh));
465 const Normal& n1 = this->normal(this->face_handle(this->opposite_halfedge_handle(_heh)));
466 Normal he;
467 calc_edge_vector(_heh, he);
468 Scalar da_cos = dot(n0, n1);
469 //should be normalized, but we need only the sign
470 Scalar da_sin_sign = dot(cross(n0, n1), he);
471 return angle(da_cos, da_sin_sign);
472 }
473
476 Scalar calc_dihedral_angle_fast(EdgeHandle _eh) const
477 { return calc_dihedral_angle_fast(this->halfedge_handle(_eh,0)); }
478
479 // calculates the dihedral angle on the halfedge _heh
480 Scalar calc_dihedral_angle(HalfedgeHandle _heh) const
481 {
482 if (this->is_boundary(this->edge_handle(_heh)))
483 {//the dihedral angle at a boundary edge is 0
484 return 0;
485 }
486 Normal n0, n1, he;
487 calc_sector_normal(_heh, n0);
488 calc_sector_normal(this->opposite_halfedge_handle(_heh), n1);
489 calc_edge_vector(_heh, he);
490 Scalar denom = n0.norm()*n1.norm();
491 if (denom == Scalar(0))
492 {
493 return 0;
494 }
495 Scalar da_cos = dot(n0, n1)/denom;
496 //should be normalized, but we need only the sign
497 Scalar da_sin_sign = dot(cross(n0, n1), he);
498 return angle(da_cos, da_sin_sign);
499 }
500
501 // calculates the dihedral angle on the edge _eh
502 Scalar calc_dihedral_angle(EdgeHandle _eh) const
503 { return calc_dihedral_angle(this->halfedge_handle(_eh,0)); }
504
507 unsigned int find_feature_edges(Scalar _angle_tresh = OpenMesh::deg_to_rad(44.0));
508 // --- misc ---
509
511 inline void split(FaceHandle _fh, const Point& _p)
512 { Kernel::split(_fh, add_vertex(_p)); }
513
514 inline void split(FaceHandle _fh, VertexHandle _vh)
515 { Kernel::split(_fh, _vh); }
516
517 inline void split(EdgeHandle _eh, const Point& _p)
518 { Kernel::split_edge(_eh, add_vertex(_p)); }
519
520 inline void split(EdgeHandle _eh, VertexHandle _vh)
521 { Kernel::split_edge(_eh, _vh); }
522
523 };
524
550 template<typename LHS, typename KERNEL>
551 LHS mesh_cast(PolyMeshT<KERNEL> &rhs) {
552 return MeshCast<LHS, PolyMeshT<KERNEL>&>::cast(rhs);
553 }
554
555 template<typename LHS, typename KERNEL>
556 LHS mesh_cast(PolyMeshT<KERNEL> *rhs) {
557 return MeshCast<LHS, PolyMeshT<KERNEL>*>::cast(rhs);
558 }
559
560 template<typename LHS, typename KERNEL>
561 const LHS mesh_cast(const PolyMeshT<KERNEL> &rhs) {
562 return MeshCast<LHS, const PolyMeshT<KERNEL>&>::cast(rhs);
563 }
564
565 template<typename LHS, typename KERNEL>
566 const LHS mesh_cast(const PolyMeshT<KERNEL> *rhs) {
567 return MeshCast<LHS, const PolyMeshT<KERNEL>*>::cast(rhs);
568 }
569
570
571 //=============================================================================
572 } // namespace OpenMesh
573 //=============================================================================
574 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_POLYMESH_C)
575 # define OPENMESH_POLYMESH_TEMPLATES
576 # include "PolyMeshT.cc"
577 #endif
578 //=============================================================================
579 #endif // OPENMESH_POLYMESHT_HH defined
580 //=============================================================================
OpenMesh::PolyMeshT::TexCoord2D
Kernel::TexCoord2D TexCoord2D
TexCoord2D type.
Definition: PolyMeshT.hh:123
OpenMesh::PolyMeshT::VertexHandle
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Definition: PolyMeshT.hh:139
OpenMesh::PolyMeshT::VertexOHalfedgeIter
Kernel::VertexOHalfedgeIter VertexOHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:166
OpenMesh::PolyMeshT::ConstVertexIHalfedgeIter
Kernel::ConstVertexIHalfedgeIter ConstVertexIHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:177
OpenMesh::PolyMeshT::update_normals
void update_normals()
Compute normals for all primitives.
Definition: PolyMeshT.cc:199
OpenMesh::PolyMeshT::VertexEdgeIter
Kernel::VertexEdgeIter VertexEdgeIter
Circulator.
Definition: PolyMeshT.hh:168
OpenMesh::PolyMeshT::calc_face_normal
virtual Normal calc_face_normal(FaceHandle _fh) const
Calculate normal vector for face _fh.
Definition: PolyMeshT.cc:101
OpenMesh::PolyMeshT::FaceVertexIter
Kernel::FaceVertexIter FaceVertexIter
Circulator.
Definition: PolyMeshT.hh:170
OpenMesh::PolyMeshT::ConstFaceFaceIter
Kernel::ConstFaceFaceIter ConstFaceFaceIter
Circulator.
Definition: PolyMeshT.hh:183
OpenMesh::mesh_cast
LHS mesh_cast(PolyMeshT< KERNEL > &rhs)
Cast a mesh with different but identical traits into each other.
Definition: PolyMeshT.hh:551
OpenMesh
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
OpenMesh::PolyMeshT::VertexIHalfedgeIter
Kernel::VertexIHalfedgeIter VertexIHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:167
OpenMesh::PolyMeshT::calc_edge_length
Scalar calc_edge_length(HalfedgeHandle _heh) const
Calculates the length of the edge _heh.
Definition: PolyMeshT.hh:363
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:300
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:446
OpenMesh::PolyMeshT::Vertex
Kernel::Vertex Vertex
Vertex type.
Definition: PolyMeshT.hh:127
OpenMesh::Attributes::TexCoord3D
Add 3D texture coordinates (vertices, halfedges)
Definition: Attributes.hh:93
OpenMesh::PolyMeshT::FaceHalfedgeIter
Kernel::FaceHalfedgeIter FaceHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:171
OpenMesh::PolyMeshT::Edge
Kernel::Edge Edge
Edge type.
Definition: PolyMeshT.hh:131
OpenMesh::PolyMeshT::Color
Kernel::Color Color
Color type.
Definition: PolyMeshT.hh:119
OpenMesh::PolyMeshT::FaceFaceIter
Kernel::FaceFaceIter FaceFaceIter
Circulator.
Definition: PolyMeshT.hh:173
OpenMesh::PolyMeshT::VertexVertexIter
Kernel::VertexVertexIter VertexVertexIter
Circulator.
Definition: PolyMeshT.hh:165
OpenMesh::PolyMeshT
Base type for a polygonal mesh.
Definition: PolyMeshT.hh:94
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:196
OpenMesh::PolyMeshT::ConstVertexVertexIter
Kernel::ConstVertexVertexIter ConstVertexVertexIter
Circulator.
Definition: PolyMeshT.hh:175
OpenMesh::PolyMeshT::calc_vertex_normal_loop
void calc_vertex_normal_loop(VertexHandle _vh, Normal &_n) const
Compute normals for all primitives.
Definition: PolyMeshT.cc:383
OpenMesh::sane_aarg
T sane_aarg(T _aarg)
Trigonometry/angles - related.
Definition: MathDefs.hh:127
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:345
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:247
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:436
OpenMesh::Attributes::Color
Add colors to mesh item (vertices/faces/edges)
Definition: Attributes.hh:88
OpenMesh::PolyMeshT::ConstFaceVertexIter
Kernel::ConstFaceVertexIter ConstFaceVertexIter
Circulator.
Definition: PolyMeshT.hh:180
OpenMesh::PolyMeshT::ConstVertexOHalfedgeIter
Kernel::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:176
OpenMesh::Attributes::Normal
Add normals to mesh item (vertices/faces)
Definition: Attributes.hh:87
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:380
OpenMesh::PolyMeshT::TexCoord3D
Kernel::TexCoord3D TexCoord3D
TexCoord3D type.
Definition: PolyMeshT.hh:125
OpenMesh::PolyMeshT::Point
Kernel::Point Point
Coordinate type.
Definition: PolyMeshT.hh:115
OpenMesh::MeshCast
Cast a mesh with different but identical traits into each other.
Definition: FinalMeshItemsT.hh:183
OpenMesh::PolyMeshT::ConstFaceEdgeIter
Kernel::ConstFaceEdgeIter ConstFaceEdgeIter
Circulator.
Definition: PolyMeshT.hh:182
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:337
OpenMesh::PolyMeshT::update_vertex_normals
void update_vertex_normals()
Update normal vectors for all vertices.
Definition: PolyMeshT.cc:406
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:330
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:145
OpenMesh::PolyMeshT::FaceEdgeIter
Kernel::FaceEdgeIter FaceEdgeIter
Circulator.
Definition: PolyMeshT.hh:172
OpenMesh::PolyMeshT::split
void split(FaceHandle _fh, const Point &_p)
Face split (= 1-to-n split)
Definition: PolyMeshT.hh:511
OpenMesh::PolyMeshT::calc_vertex_normal_correct
void calc_vertex_normal_correct(VertexHandle _vh, Normal &_n) const
Compute normals for all primitives.
Definition: PolyMeshT.cc:355
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:77
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:106
OpenMesh::PolyMeshT::calc_sector_angle
Scalar calc_sector_angle(HalfedgeHandle _in_heh) const
calculates the sector angle.
Definition: PolyMeshT.hh:391
OpenMesh::PolyMeshT::ConstVertexFaceIter
Kernel::ConstVertexFaceIter ConstVertexFaceIter
Circulator.
Definition: PolyMeshT.hh:179
OpenMesh::PolyMeshT::update_normal
void update_normal(FaceHandle _fh)
Update normal for face _fh.
Definition: PolyMeshT.hh:225
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:107
OpenMesh::PolyMeshT::ConstFaceHalfedgeIter
Kernel::ConstFaceHalfedgeIter ConstFaceHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:181
OpenMesh::PolyMeshT::Halfedge
Kernel::Halfedge Halfedge
Halfedge type.
Definition: PolyMeshT.hh:129
OpenMesh::PolyMeshT::new_vertex
VertexHandle new_vertex()
Uses default copy and assignment operator.
Definition: PolyMeshT.hh:196
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:351
OpenMesh::is_zero
bool is_zero(const T &_a, Real _eps)
comparison operators with user-selected precision control
Definition: MathDefs.hh:66
OpenMesh::PolyMeshT::update_halfedge_normals
void update_halfedge_normals(const double _feature_angle=0.8)
Update normal vectors for all halfedges.
Definition: PolyMeshT.cc:232
OpenMesh::Attributes::TexCoord1D
Add 1D texture coordinates (vertices, halfedges)
Definition: Attributes.hh:91
OpenMesh::PolyMeshT::Scalar
Kernel::Scalar Scalar
Scalar type.
Definition: PolyMeshT.hh:113
OpenMesh::PolyMeshT::ConstVertexEdgeIter
Kernel::ConstVertexEdgeIter ConstVertexEdgeIter
Circulator.
Definition: PolyMeshT.hh:178
OpenMesh::PolyMeshT::Normal
Kernel::Normal Normal
Normal type.
Definition: PolyMeshT.hh:117
OpenMesh::PolyMeshT::update_face_normals
void update_face_normals()
Update normal vectors for all faces.
Definition: PolyMeshT.cc:217
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:344
OpenMesh::PolyMeshT::This
PolyMeshT< Kernel > This
Self type. Used to specify iterators/circulators.
Definition: PolyMeshT.hh:99
OpenMesh::PolyMeshT::Face
Kernel::Face Face
Face type.
Definition: PolyMeshT.hh:133
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:181
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:455
OpenMesh::PolyMeshT::TexCoord1D
Kernel::TexCoord1D TexCoord1D
TexCoord1D type.
Definition: PolyMeshT.hh:121
OpenMesh::PolyMeshT::update_normal
void update_normal(HalfedgeHandle _heh, const double _feature_angle=0.8)
Update normal for halfedge _heh.
Definition: PolyMeshT.hh:250
OpenMesh::Attributes::TexCoord2D
Add 2D texture coordinates (vertices, halfedges)
Definition: Attributes.hh:92
OpenMesh::PolyMeshT::calc_vertex_normal
Normal calc_vertex_normal(VertexHandle _vh) const
Calculate vertex normal for one specific vertex.
Definition: PolyMeshT.cc:331
OpenMesh::PolyMeshT::VertexFaceIter
Kernel::VertexFaceIter VertexFaceIter
Circulator.
Definition: PolyMeshT.hh:169
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:242
OpenMesh::PolyMeshT::update_normal
void update_normal(VertexHandle _vh)
Update normal for vertex _vh.
Definition: PolyMeshT.hh:284
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:476