Developer Documentation
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 
45 //=============================================================================
46 //
47 // CLASS PolyMeshT
48 //
49 //=============================================================================
50 
51 
52 #ifndef OPENMESH_POLYMESHT_HH
53 #define OPENMESH_POLYMESHT_HH
54 
55 
56 //== INCLUDES =================================================================
57 
58 
60 #include <OpenMesh/Core/Geometry/MathDefs.hh>
61 #include <OpenMesh/Core/Mesh/PolyConnectivity.hh>
62 #include <OpenMesh/Core/Mesh/FinalMeshItemsT.hh>
63 #include <OpenMesh/Core/Mesh/Tags.hh>
64 #include <vector>
65 
66 
67 //== NAMESPACES ===============================================================
68 
69 
70 namespace OpenMesh {
71 
72 //== CLASS DEFINITION =========================================================
73 
74 
89 template <class Kernel>
90 class PolyMeshT : public Kernel
91 {
92 public:
93 
96  //--- item types ---
97 
99  static constexpr bool is_polymesh() { return true; }
101  static constexpr bool is_trimesh() { return false; }
103  enum { IsPolyMesh = 1 };
104  enum { IsTriMesh = 0 };
106 
108 
109  typedef typename Kernel::Scalar Scalar;
112  typedef typename Kernel::Point Point;
114  typedef typename Kernel::Normal Normal;
116  typedef typename Kernel::Color Color;
118  typedef typename Kernel::TexCoord1D TexCoord1D;
120  typedef typename Kernel::TexCoord2D TexCoord2D;
122  typedef typename Kernel::TexCoord3D TexCoord3D;
124  typedef typename Kernel::Vertex Vertex;
126  typedef typename Kernel::Halfedge Halfedge;
128  typedef typename Kernel::Edge Edge;
130  typedef typename Kernel::Face Face;
132 
133  //--- handle types ---
134 
136  typedef typename Kernel::VertexHandle VertexHandle;
137  typedef typename Kernel::HalfedgeHandle HalfedgeHandle;
138  typedef typename Kernel::EdgeHandle EdgeHandle;
139  typedef typename Kernel::FaceHandle FaceHandle;
140 
141 
142 
143  typedef typename Kernel::VertexIter VertexIter;
144  typedef typename Kernel::HalfedgeIter HalfedgeIter;
145  typedef typename Kernel::EdgeIter EdgeIter;
146  typedef typename Kernel::FaceIter FaceIter;
147 
148  typedef typename Kernel::ConstVertexIter ConstVertexIter;
149  typedef typename Kernel::ConstHalfedgeIter ConstHalfedgeIter;
150  typedef typename Kernel::ConstEdgeIter ConstEdgeIter;
151  typedef typename Kernel::ConstFaceIter ConstFaceIter;
153 
154  //--- circulators ---
155 
161  typedef typename Kernel::VertexVertexIter VertexVertexIter;
163  typedef typename Kernel::VertexOHalfedgeIter VertexOHalfedgeIter;
164  typedef typename Kernel::VertexIHalfedgeIter VertexIHalfedgeIter;
165  typedef typename Kernel::VertexEdgeIter VertexEdgeIter;
166  typedef typename Kernel::VertexFaceIter VertexFaceIter;
167  typedef typename Kernel::FaceVertexIter FaceVertexIter;
168  typedef typename Kernel::FaceHalfedgeIter FaceHalfedgeIter;
169  typedef typename Kernel::FaceEdgeIter FaceEdgeIter;
170  typedef typename Kernel::FaceFaceIter FaceFaceIter;
171 
172  typedef typename Kernel::ConstVertexVertexIter ConstVertexVertexIter;
173  typedef typename Kernel::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter;
174  typedef typename Kernel::ConstVertexIHalfedgeIter ConstVertexIHalfedgeIter;
175  typedef typename Kernel::ConstVertexEdgeIter ConstVertexEdgeIter;
176  typedef typename Kernel::ConstVertexFaceIter ConstVertexFaceIter;
177  typedef typename Kernel::ConstFaceVertexIter ConstFaceVertexIter;
178  typedef typename Kernel::ConstFaceHalfedgeIter ConstFaceHalfedgeIter;
179  typedef typename Kernel::ConstFaceEdgeIter ConstFaceEdgeIter;
180  typedef typename Kernel::ConstFaceFaceIter ConstFaceFaceIter;
182 
183 
184  // --- constructor/destructor
185  PolyMeshT() {}
186  template<typename T>
187  explicit PolyMeshT(const T& t) : Kernel(t) {}
188  virtual ~PolyMeshT() {}
189 
194  // --- creation ---
195 
201  inline VertexHandle new_vertex()
202  { return Kernel::new_vertex(); }
203 
209  inline VertexHandle new_vertex(const Point& _p)
210  {
211  VertexHandle vh(Kernel::new_vertex());
212  this->set_point(vh, _p);
213  return vh;
214  }
215 
227  inline VertexHandle new_vertex_dirty(const Point& _p)
228  {
229  VertexHandle vh(Kernel::new_vertex_dirty());
230  this->set_point(vh, _p);
231  return vh;
232  }
233 
235  inline VertexHandle add_vertex(const Point& _p)
236  { return new_vertex(_p); }
237 
239  inline VertexHandle add_vertex_dirty(const Point& _p)
240  { return new_vertex_dirty(_p); }
241 
242  // --- normal vectors ---
243 
247 
255  void update_normals();
256 
258  void update_normal(FaceHandle _fh)
259  { this->set_normal(_fh, calc_face_normal(_fh)); }
260 
266  void update_face_normals();
267 
269  virtual Normal calc_face_normal(FaceHandle _fh) const;
270 
272  Normal calc_face_normal(const Point& _p0, const Point& _p1,
273  const Point& _p2) const;
275  void calc_face_centroid(FaceHandle _fh, Point& _pt) const {
276  _pt = calc_face_centroid(_fh);
277  }
278 
280  Point calc_face_centroid(FaceHandle _fh) const;
281 
283  void update_normal(HalfedgeHandle _heh, const double _feature_angle = 0.8)
284  { this->set_normal(_heh, calc_halfedge_normal(_heh,_feature_angle)); }
285 
295  void update_halfedge_normals(const double _feature_angle = 0.8);
296 
309  virtual Normal calc_halfedge_normal(HalfedgeHandle _heh, const double _feature_angle = 0.8) const;
310 
311 
314  bool is_estimated_feature_edge(HalfedgeHandle _heh, const double _feature_angle) const;
315 
317  void update_normal(VertexHandle _vh)
318  { this->set_normal(_vh, calc_vertex_normal(_vh)); }
319 
329  void update_vertex_normals();
330 
343  Normal calc_vertex_normal(VertexHandle _vh) const;
344 
352  void calc_vertex_normal_fast(VertexHandle _vh, Normal& _n) const;
353  void calc_vertex_normal_correct(VertexHandle _vh, Normal& _n) const;
354  void calc_vertex_normal_loop(VertexHandle _vh, Normal& _n) const;
355 
356 
358 
359  // --- Geometry API - still in development ---
360 
363  void calc_edge_vector(EdgeHandle _eh, Normal& _edge_vec) const
364  {
365  _edge_vec = calc_edge_vector(_eh);
366  }
367 
370  Normal calc_edge_vector(EdgeHandle _eh) const
371  {
372  return calc_edge_vector(this->halfedge_handle(_eh,0));
373  }
374 
377  void calc_edge_vector(HalfedgeHandle _heh, Normal& _edge_vec) const
378  {
379  _edge_vec = calc_edge_vector(_heh);
380  }
381 
384  Normal calc_edge_vector(HalfedgeHandle _heh) const
385  {
386  return this->point(this->to_vertex_handle(_heh)) -
387  this->point(this->from_vertex_handle(_heh));
388  }
389 
390  // Calculates the length of the edge _eh
391  Scalar calc_edge_length(EdgeHandle _eh) const
392  { return calc_edge_length(this->halfedge_handle(_eh,0)); }
393 
396  Scalar calc_edge_length(HalfedgeHandle _heh) const
397  { return (Scalar)sqrt(calc_edge_sqr_length(_heh)); }
398 
399  Scalar calc_edge_sqr_length(EdgeHandle _eh) const
400  { return calc_edge_sqr_length(this->halfedge_handle(_eh,0)); }
401 
402  Scalar calc_edge_sqr_length(HalfedgeHandle _heh) const
403  {
404  Normal edge_vec;
405  calc_edge_vector(_heh, edge_vec);
406  return sqrnorm(edge_vec);
407  }
408 
411  Point calc_edge_midpoint(HalfedgeHandle _heh) const
412  {
413  VertexHandle vh0 = this->from_vertex_handle(_heh);
414  VertexHandle vh1 = this->to_vertex_handle(_heh);
415  return 0.5 * (this->point(vh0) + this->point(vh1));
416  }
417 
420  Point calc_edge_midpoint(EdgeHandle _eh) const
421  {
422  return calc_edge_midpoint(this->halfedge_handle(_eh, 0));
423  }
424 
429  void calc_sector_vectors(HalfedgeHandle _in_heh, Normal& _vec0, Normal& _vec1) const
430  {
431  calc_edge_vector(this->next_halfedge_handle(_in_heh), _vec0);//p2 - p1
432  calc_edge_vector(this->opposite_halfedge_handle(_in_heh), _vec1);//p0 - p1
433  }
434 
440  Scalar calc_sector_angle(HalfedgeHandle _in_heh) const
441  {
442  Normal v0, v1;
443  calc_sector_vectors(_in_heh, v0, v1);
444  Scalar denom = norm(v0)*norm(v1);
445  if ( denom == Scalar(0))
446  {
447  return 0;
448  }
449  Scalar cos_a = dot(v0 , v1) / denom;
450  if (this->is_boundary(_in_heh))
451  {//determine if the boundary sector is concave or convex
452  FaceHandle fh(this->face_handle(this->opposite_halfedge_handle(_in_heh)));
453  Normal f_n(calc_face_normal(fh));//this normal is (for convex fh) OK
454  Scalar sign_a = dot(cross(v0, v1), f_n);
455  return angle(cos_a, sign_a);
456  }
457  else
458  {
459  return acos(sane_aarg(cos_a));
460  }
461  }
462 
463  // calculate the cos and the sin of angle <(_in_heh,next_halfedge(_in_heh))
464  /*
465  void calc_sector_angle_cos_sin(HalfedgeHandle _in_heh, Scalar& _cos_a, Scalar& _sin_a) const
466  {
467  Normal in_vec, out_vec;
468  calc_edge_vector(_in_heh, in_vec);
469  calc_edge_vector(next_halfedge_handle(_in_heh), out_vec);
470  Scalar denom = norm(in_vec)*norm(out_vec);
471  if (is_zero(denom))
472  {
473  _cos_a = 1;
474  _sin_a = 0;
475  }
476  else
477  {
478  _cos_a = dot(in_vec, out_vec)/denom;
479  _sin_a = norm(cross(in_vec, out_vec))/denom;
480  }
481  }
482  */
485  void calc_sector_normal(HalfedgeHandle _in_heh, Normal& _sector_normal) const
486  {
487  Normal vec0, vec1;
488  calc_sector_vectors(_in_heh, vec0, vec1);
489  _sector_normal = cross(vec0, vec1);//(p2-p1)^(p0-p1)
490  }
491 
495  Scalar calc_sector_area(HalfedgeHandle _in_heh) const
496  {
497  Normal sector_normal;
498  calc_sector_normal(_in_heh, sector_normal);
499  return norm(sector_normal)/2;
500  }
501 
504  Scalar calc_dihedral_angle_fast(HalfedgeHandle _heh) const
505  {
506  // Make sure that we have face normals on the mesh
507  assert(Kernel::has_face_normals());
508 
509  if (this->is_boundary(this->edge_handle(_heh)))
510  {//the dihedral angle at a boundary edge is 0
511  return 0;
512  }
513  const Normal& n0 = this->normal(this->face_handle(_heh));
514  const Normal& n1 = this->normal(this->face_handle(this->opposite_halfedge_handle(_heh)));
515  Normal he;
516  calc_edge_vector(_heh, he);
517  Scalar da_cos = dot(n0, n1);
518  //should be normalized, but we need only the sign
519  Scalar da_sin_sign = dot(cross(n0, n1), he);
520  return angle(da_cos, da_sin_sign);
521  }
522 
525  Scalar calc_dihedral_angle_fast(EdgeHandle _eh) const
526  { return calc_dihedral_angle_fast(this->halfedge_handle(_eh,0)); }
527 
528  // calculates the dihedral angle on the halfedge _heh
529  Scalar calc_dihedral_angle(HalfedgeHandle _heh) const
530  {
531  if (this->is_boundary(this->edge_handle(_heh)))
532  {//the dihedral angle at a boundary edge is 0
533  return 0;
534  }
535  Normal n0, n1, he;
536  calc_sector_normal(_heh, n0);
537  calc_sector_normal(this->opposite_halfedge_handle(_heh), n1);
538  calc_edge_vector(_heh, he);
539  Scalar denom = norm(n0)*norm(n1);
540  if (denom == Scalar(0))
541  {
542  return 0;
543  }
544  Scalar da_cos = dot(n0, n1)/denom;
545  //should be normalized, but we need only the sign
546  Scalar da_sin_sign = dot(cross(n0, n1), he);
547  return angle(da_cos, da_sin_sign);
548  }
549 
550  // calculates the dihedral angle on the edge _eh
551  Scalar calc_dihedral_angle(EdgeHandle _eh) const
552  { return calc_dihedral_angle(this->halfedge_handle(_eh,0)); }
553 
556  unsigned int find_feature_edges(Scalar _angle_tresh = OpenMesh::deg_to_rad(44.0));
557  // --- misc ---
558 
560  inline void split(FaceHandle _fh, const Point& _p)
561  { Kernel::split(_fh, add_vertex(_p)); }
562 
563  inline void split(FaceHandle _fh, VertexHandle _vh)
564  { Kernel::split(_fh, _vh); }
565 
566  inline void split(EdgeHandle _eh, const Point& _p)
567  { Kernel::split_edge(_eh, add_vertex(_p)); }
568 
569  inline void split(EdgeHandle _eh, VertexHandle _vh)
570  { Kernel::split_edge(_eh, _vh); }
571 
572 private:
573  struct PointIs3DTag {};
574  struct PointIsNot3DTag {};
575  Normal calc_face_normal_impl(FaceHandle, PointIs3DTag) const;
576  Normal calc_face_normal_impl(FaceHandle, PointIsNot3DTag) const;
577  Normal calc_face_normal_impl(const Point&, const Point&, const Point&, PointIs3DTag) const;
578  Normal calc_face_normal_impl(const Point&, const Point&, const Point&, PointIsNot3DTag) const;
579 };
580 
606 template<typename LHS, typename KERNEL>
608  return MeshCast<LHS, PolyMeshT<KERNEL>&>::cast(rhs);
609 }
610 
611 template<typename LHS, typename KERNEL>
612 LHS mesh_cast(PolyMeshT<KERNEL> *rhs) {
613  return MeshCast<LHS, PolyMeshT<KERNEL>*>::cast(rhs);
614 }
615 
616 template<typename LHS, typename KERNEL>
617 const LHS mesh_cast(const PolyMeshT<KERNEL> &rhs) {
618  return MeshCast<LHS, const PolyMeshT<KERNEL>&>::cast(rhs);
619 }
620 
621 template<typename LHS, typename KERNEL>
622 const LHS mesh_cast(const PolyMeshT<KERNEL> *rhs) {
623  return MeshCast<LHS, const PolyMeshT<KERNEL>*>::cast(rhs);
624 }
625 
626 //=============================================================================
627 } // namespace OpenMesh
628 //=============================================================================
629 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_POLYMESH_C)
630 # define OPENMESH_POLYMESH_TEMPLATES
631 # include "PolyMeshT_impl.hh"
632 #endif
633 //=============================================================================
634 #endif // OPENMESH_POLYMESHT_HH defined
635 //=============================================================================
virtual Normal calc_face_normal(FaceHandle _fh) const
void update_normal(HalfedgeHandle _heh, const double _feature_angle=0.8)
Update normal for halfedge _heh.
Definition: PolyMeshT.hh:283
Kernel::Halfedge Halfedge
Halfedge type.
Definition: PolyMeshT.hh:126
void calc_sector_normal(HalfedgeHandle _in_heh, Normal &_sector_normal) const
Definition: PolyMeshT.hh:485
void calc_vertex_normal_loop(VertexHandle _vh, Normal &_n) const
Compute normals for all primitives.
T sane_aarg(T _aarg)
Trigonometry/angles - related.
Definition: MathDefs.hh:122
Add 1D texture coordinates (vertices, halfedges)
Definition: Attributes.hh:86
VertexHandle new_vertex_dirty(const Point &_p)
Definition: PolyMeshT.hh:227
VertexHandle new_vertex()
Adds a new default-initialized vertex.
Definition: PolyMeshT.hh:201
Kernel::VertexIHalfedgeIter VertexIHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:164
Kernel::VertexOHalfedgeIter VertexOHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:163
Kernel::ConstFaceVertexIter ConstFaceVertexIter
Circulator.
Definition: PolyMeshT.hh:177
Scalar calc_sector_area(HalfedgeHandle _in_heh) const
Definition: PolyMeshT.hh:495
LHS mesh_cast(PolyMeshT< KERNEL > &rhs)
Cast a mesh with different but identical traits into each other.
Definition: PolyMeshT.hh:607
Kernel::Point Point
Coordinate type.
Definition: PolyMeshT.hh:112
static constexpr bool is_polymesh()
Determine whether this is a PolyMeshT or TriMeshT (This function does not check the per face vertex c...
Definition: PolyMeshT.hh:100
osg::Vec3f cross(const osg::Vec3f &_v1, const osg::Vec3f &_v2)
Adapter for osg vector member computing a scalar product.
Scalar calc_sector_angle(HalfedgeHandle _in_heh) const
Definition: PolyMeshT.hh:440
Kernel::Color Color
Color type.
Definition: PolyMeshT.hh:116
VertexHandle add_vertex(const Point &_p)
Alias for new_vertex(const Point&).
Definition: PolyMeshT.hh:235
Scalar calc_edge_length(HalfedgeHandle _heh) const
Definition: PolyMeshT.hh:396
void calc_sector_vectors(HalfedgeHandle _in_heh, Normal &_vec0, Normal &_vec1) const
Definition: PolyMeshT.hh:429
Kernel::VertexEdgeIter VertexEdgeIter
Circulator.
Definition: PolyMeshT.hh:165
Kernel::ConstFaceFaceIter ConstFaceFaceIter
Circulator.
Definition: PolyMeshT.hh:180
Kernel::Face Face
Face type.
Definition: PolyMeshT.hh:130
Kernel::Scalar Scalar
Scalar type.
Definition: PolyMeshT.hh:110
void calc_face_centroid(FaceHandle _fh, Point &_pt) const
calculates the average of the vertices defining _fh
Definition: PolyMeshT.hh:275
void update_normal(VertexHandle _vh)
Update normal for vertex _vh.
Definition: PolyMeshT.hh:317
Normal calc_edge_vector(HalfedgeHandle _heh) const
Definition: PolyMeshT.hh:384
VertexHandle new_vertex(const Point &_p)
Adds a new vertex initialized to a custom position.
Definition: PolyMeshT.hh:209
Kernel::ConstFaceHalfedgeIter ConstFaceHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:178
Point calc_edge_midpoint(HalfedgeHandle _heh) const
Definition: PolyMeshT.hh:411
Kernel::VertexFaceIter VertexFaceIter
Circulator.
Definition: PolyMeshT.hh:166
Kernel::FaceVertexIter FaceVertexIter
Circulator.
Definition: PolyMeshT.hh:167
Kernel::ConstVertexFaceIter ConstVertexFaceIter
Circulator.
Definition: PolyMeshT.hh:176
PolyMeshT< Kernel > This
Self type. Used to specify iterators/circulators.
Definition: PolyMeshT.hh:95
Add colors to mesh item (vertices/faces/edges)
Definition: Attributes.hh:83
Scalar calc_dihedral_angle_fast(HalfedgeHandle _heh) const
Definition: PolyMeshT.hh:504
Kernel::TexCoord1D TexCoord1D
TexCoord1D type.
Definition: PolyMeshT.hh:118
VertexHandle add_vertex_dirty(const Point &_p)
Alias for new_vertex_dirty().
Definition: PolyMeshT.hh:239
Normal calc_edge_vector(EdgeHandle _eh) const
Definition: PolyMeshT.hh:370
osg::Vec3f::ValueType dot(const osg::Vec3f &_v1, const osg::Vec3f &_v2)
Adapter for osg vector member computing a scalar product.
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Definition: PolyMeshT.hh:136
void update_vertex_normals()
Update normal vectors for all vertices.
Add 3D texture coordinates (vertices, halfedges)
Definition: Attributes.hh:88
Kernel::VertexVertexIter VertexVertexIter
Circulator.
Definition: PolyMeshT.hh:162
Kernel::TexCoord2D TexCoord2D
TexCoord2D type.
Definition: PolyMeshT.hh:120
T angle(T _cos_angle, T _sin_angle)
Definition: MathDefs.hh:140
static constexpr bool is_trimesh()
Determine whether this is a PolyMeshT or TriMeshT (This function does not check the per face vertex c...
Definition: PolyMeshT.hh:101
Kernel::FaceEdgeIter FaceEdgeIter
Circulator.
Definition: PolyMeshT.hh:169
void update_normal(FaceHandle _fh)
Update normal for face _fh.
Definition: PolyMeshT.hh:258
void calc_vertex_normal_correct(VertexHandle _vh, Normal &_n) const
Compute normals for all primitives.
Kernel::Normal Normal
Normal type.
Definition: PolyMeshT.hh:114
Cast a mesh with different but identical traits into each other.
unsigned int find_feature_edges(Scalar _angle_tresh=OpenMesh::deg_to_rad(44.0))
Kernel::FaceFaceIter FaceFaceIter
Circulator.
Definition: PolyMeshT.hh:170
Add 2D texture coordinates (vertices, halfedges)
Definition: Attributes.hh:87
void update_halfedge_normals(const double _feature_angle=0.8)
Update normal vectors for all halfedges.
Kernel::ConstVertexIHalfedgeIter ConstVertexIHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:174
bool is_estimated_feature_edge(HalfedgeHandle _heh, const double _feature_angle) const
void calc_edge_vector(EdgeHandle _eh, Normal &_edge_vec) const
Definition: PolyMeshT.hh:363
Connectivity tag indicating that the tagged mesh has polygon connectivity.
Definition: Tags.hh:47
Point calc_edge_midpoint(EdgeHandle _eh) const
Definition: PolyMeshT.hh:420
Kernel::TexCoord3D TexCoord3D
TexCoord3D type.
Definition: PolyMeshT.hh:122
Kernel::FaceHalfedgeIter FaceHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:168
Kernel::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter
Circulator.
Definition: PolyMeshT.hh:173
void update_face_normals()
Update normal vectors for all faces.
Scalar calc_dihedral_angle_fast(EdgeHandle _eh) const
Definition: PolyMeshT.hh:525
virtual Normal calc_halfedge_normal(HalfedgeHandle _heh, const double _feature_angle=0.8) const
Calculate halfedge normal for one specific halfedge.
Kernel::Vertex Vertex
Vertex type.
Definition: PolyMeshT.hh:124
Normal calc_vertex_normal(VertexHandle _vh) const
Calculate vertex normal for one specific vertex.
void split(FaceHandle _fh, const Point &_p)
Face split (= 1-to-n split)
Definition: PolyMeshT.hh:560
Kernel::ConstVertexEdgeIter ConstVertexEdgeIter
Circulator.
Definition: PolyMeshT.hh:175
Kernel::ConstVertexVertexIter ConstVertexVertexIter
Circulator.
Definition: PolyMeshT.hh:172
Kernel::ConstFaceEdgeIter ConstFaceEdgeIter
Circulator.
Definition: PolyMeshT.hh:179
Kernel::Edge Edge
Edge type.
Definition: PolyMeshT.hh:128
void update_normals()
Compute normals for all primitives.
void calc_edge_vector(HalfedgeHandle _heh, Normal &_edge_vec) const
Definition: PolyMeshT.hh:377
void calc_vertex_normal_fast(VertexHandle _vh, Normal &_n) const