Developer Documentation
Loading...
Searching...
No Matches
PolyMeshT.hh
1/* ========================================================================= *
2 * *
3 * OpenMesh *
4 * Copyright (c) 2001-2025, 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
70namespace OpenMesh {
71
72//== CLASS DEFINITION =========================================================
73
74
89template <class Kernel>
90class PolyMeshT : public Kernel
91{
92public:
93
96 //--- item types ---
97
99
100 static constexpr bool is_polymesh() { return true; }
101 static constexpr bool is_trimesh() { return false; }
102 using ConnectivityTag = PolyConnectivityTag;
103 enum { IsPolyMesh = 1 };
104 enum { IsTriMesh = 0 };
106
108
109
110 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
162 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
186 template<typename T>
187 explicit PolyMeshT(const T& t) : Kernel(t) {}
188 virtual ~PolyMeshT() {}
189
194 // --- creation ---
195 //
199 template<typename H,
200 typename=SmartHandle<H> /* SFINAE */>
201 auto make_smart(H const &h) const -> typename SmartHandle<H>::type const
202 {return OpenMesh::make_smart(h, this);}
203
208 template<typename SH,
209 typename=typename std::enable_if<std::is_base_of<SmartBaseHandle, SH>::value>::type>
210 SH make_smart(SH const &sh) const
211 {return sh;}
212
219 { return make_smart(Kernel::new_vertex()); }
220
228 {
229 VertexHandle vh(Kernel::new_vertex());
230 this->set_point(vh, _p);
231 return make_smart(vh);
232 }
233
246 {
247 VertexHandle vh(Kernel::new_vertex_dirty());
248 this->set_point(vh, _p);
249 return make_smart(vh);
250 }
251
256 { return new_vertex(_p); }
257
261
262 // --- normal vectors ---
263
267
275 void update_normals();
276
279 { this->set_normal(_fh, calc_face_normal(_fh)); }
280
286 void update_face_normals();
287
289 virtual Normal calc_face_normal(FaceHandle _fh) const;
290
292 Normal calc_face_normal(const Point& _p0, const Point& _p1,
293 const Point& _p2) const;
294
296 Normal calc_normal(FaceHandle _fh) const;
297
299 void calc_face_centroid(FaceHandle _fh, Point& _pt) const {
300 _pt = calc_face_centroid(_fh);
301 }
302
305
307 Point calc_centroid(FaceHandle _fh) const;
308
310 Point calc_centroid(EdgeHandle _eh) const;
311
314
317
319 Point calc_centroid(MeshHandle _mh) const;
320
322 void update_normal(HalfedgeHandle _heh, const double _feature_angle = 0.8)
323 { this->set_normal(_heh, calc_halfedge_normal(_heh,_feature_angle)); }
324
334 void update_halfedge_normals(const double _feature_angle = 0.8);
335
348 virtual Normal calc_halfedge_normal(HalfedgeHandle _heh, const double _feature_angle = 0.8) const;
349
351 Normal calc_normal(HalfedgeHandle, const double _feature_angle = 0.8) const;
352
355 bool is_estimated_feature_edge(HalfedgeHandle _heh, const double _feature_angle) const;
356
359 { this->set_normal(_vh, calc_vertex_normal(_vh)); }
360
371
385
393 void calc_vertex_normal_fast(VertexHandle _vh, Normal& _n) const;
395 void calc_vertex_normal_loop(VertexHandle _vh, Normal& _n) const;
396
399
401
402 // --- Geometry API - still in development ---
403
406 void calc_edge_vector(EdgeHandle _eh, Normal& _edge_vec) const
407 {
408 _edge_vec = calc_edge_vector(_eh);
409 }
410
414 {
415 return calc_edge_vector(this->halfedge_handle(_eh,0));
416 }
417
420 void calc_edge_vector(HalfedgeHandle _heh, Normal& _edge_vec) const
421 {
422 _edge_vec = calc_edge_vector(_heh);
423 }
424
428 {
429 return this->point(this->to_vertex_handle(_heh)) -
430 this->point(this->from_vertex_handle(_heh));
431 }
432
433 // Calculates the length of the edge _eh
435 { return calc_edge_length(this->halfedge_handle(_eh,0)); }
436
440 { return (Scalar)sqrt(calc_edge_sqr_length(_heh)); }
441
443 { return calc_edge_sqr_length(this->halfedge_handle(_eh,0)); }
444
446 {
447 Normal edge_vec;
448 calc_edge_vector(_heh, edge_vec);
449 return sqrnorm(edge_vec);
450 }
451
455 {
456 VertexHandle vh0 = this->from_vertex_handle(_heh);
457 VertexHandle vh1 = this->to_vertex_handle(_heh);
458 return 0.5 * (this->point(vh0) + this->point(vh1));
459 }
460
464 {
465 return calc_edge_midpoint(this->halfedge_handle(_eh, 0));
466 }
467
469 Normal calc_normal(EdgeHandle _eh) const;
470
475 void calc_sector_vectors(HalfedgeHandle _in_heh, Normal& _vec0, Normal& _vec1) const
476 {
477 calc_edge_vector(this->next_halfedge_handle(_in_heh), _vec0);//p2 - p1
478 calc_edge_vector(this->opposite_halfedge_handle(_in_heh), _vec1);//p0 - p1
479 }
480
487 {
488 Normal v0, v1;
489 calc_sector_vectors(_in_heh, v0, v1);
490 Scalar denom = norm(v0)*norm(v1);
491 if ( denom == Scalar(0))
492 {
493 return 0;
494 }
495 Scalar cos_a = dot(v0 , v1) / denom;
496 if (this->is_boundary(_in_heh))
497 {//determine if the boundary sector is concave or convex
498 FaceHandle fh(this->face_handle(this->opposite_halfedge_handle(_in_heh)));
499 Normal f_n(calc_face_normal(fh));//this normal is (for convex fh) OK
500 Scalar sign_a = dot(cross(v0, v1), f_n);
501 return angle(cos_a, sign_a);
502 }
503 else
504 {
505 return acos(sane_aarg(cos_a));
506 }
507 }
508
509 // calculate the cos and the sin of angle <(_in_heh,next_halfedge(_in_heh))
510 /*
511 void calc_sector_angle_cos_sin(HalfedgeHandle _in_heh, Scalar& _cos_a, Scalar& _sin_a) const
512 {
513 Normal in_vec, out_vec;
514 calc_edge_vector(_in_heh, in_vec);
515 calc_edge_vector(next_halfedge_handle(_in_heh), out_vec);
516 Scalar denom = norm(in_vec)*norm(out_vec);
517 if (is_zero(denom))
518 {
519 _cos_a = 1;
520 _sin_a = 0;
521 }
522 else
523 {
524 _cos_a = dot(in_vec, out_vec)/denom;
525 _sin_a = norm(cross(in_vec, out_vec))/denom;
526 }
527 }
528 */
531 void calc_sector_normal(HalfedgeHandle _in_heh, Normal& _sector_normal) const
532 {
533 Normal vec0, vec1;
534 calc_sector_vectors(_in_heh, vec0, vec1);
535 _sector_normal = cross(vec0, vec1);//(p2-p1)^(p0-p1)
536 }
537
542 {
543 Normal sector_normal;
544 calc_sector_normal(_in_heh, sector_normal);
545 return norm(sector_normal)/2;
546 }
547
551 {
552 // Make sure that we have face normals on the mesh
553 assert(Kernel::has_face_normals());
554
555 if (this->is_boundary(this->edge_handle(_heh)))
556 {//the dihedral angle at a boundary edge is 0
557 return 0;
558 }
559 const Normal& n0 = this->normal(this->face_handle(_heh));
560 const Normal& n1 = this->normal(this->face_handle(this->opposite_halfedge_handle(_heh)));
561 Normal he;
562 calc_edge_vector(_heh, he);
563 Scalar da_cos = dot(n0, n1);
564 //should be normalized, but we need only the sign
565 Scalar da_sin_sign = dot(cross(n0, n1), he);
566 return angle(da_cos, da_sin_sign);
567 }
568
572 { return calc_dihedral_angle_fast(this->halfedge_handle(_eh,0)); }
573
574 // calculates the dihedral angle on the halfedge _heh
576 {
577 if (this->is_boundary(this->edge_handle(_heh)))
578 {//the dihedral angle at a boundary edge is 0
579 return 0;
580 }
581 Normal n0, n1, he;
582 calc_sector_normal(_heh, n0);
583 calc_sector_normal(this->opposite_halfedge_handle(_heh), n1);
584 calc_edge_vector(_heh, he);
585 Scalar denom = norm(n0)*norm(n1);
586 if (denom == Scalar(0))
587 {
588 return 0;
589 }
590 Scalar da_cos = dot(n0, n1)/denom;
591 //should be normalized, but we need only the sign
592 Scalar da_sin_sign = dot(cross(n0, n1), he);
593 return angle(da_cos, da_sin_sign);
594 }
595
596 // calculates the dihedral angle on the edge _eh
598 { return calc_dihedral_angle(this->halfedge_handle(_eh,0)); }
599
602 unsigned int find_feature_edges(Scalar _angle_tresh = OpenMesh::deg_to_rad(44.0));
603 // --- misc ---
604
606 inline void split(FaceHandle _fh, const Point& _p)
607 { Kernel::split(_fh, add_vertex(_p)); }
608
609 inline void split(FaceHandle _fh, VertexHandle _vh)
610 { Kernel::split(_fh, _vh); }
611
612 inline void split(EdgeHandle _eh, const Point& _p)
613 { Kernel::split_edge(_eh, add_vertex(_p)); }
614
615 inline void split(EdgeHandle _eh, VertexHandle _vh)
616 { Kernel::split_edge(_eh, _vh); }
617
618private:
619 struct PointIs3DTag {};
623 Normal calc_face_normal_impl(const Point&, const Point&, const Point&, PointIs3DTag) const;
624 Normal calc_face_normal_impl(const Point&, const Point&, const Point&, PointIsNot3DTag) const;
625};
626
652template<typename LHS, typename KERNEL>
654 return MeshCast<LHS, PolyMeshT<KERNEL>&>::cast(rhs);
655}
656
657template<typename LHS, typename KERNEL>
658LHS mesh_cast(PolyMeshT<KERNEL> *rhs) {
659 return MeshCast<LHS, PolyMeshT<KERNEL>*>::cast(rhs);
660}
661
662template<typename LHS, typename KERNEL>
663const LHS mesh_cast(const PolyMeshT<KERNEL> &rhs) {
664 return MeshCast<LHS, const PolyMeshT<KERNEL>&>::cast(rhs);
665}
666
667template<typename LHS, typename KERNEL>
668const LHS mesh_cast(const PolyMeshT<KERNEL> *rhs) {
669 return MeshCast<LHS, const PolyMeshT<KERNEL>*>::cast(rhs);
670}
671
672//=============================================================================
673} // namespace OpenMesh
674//=============================================================================
675#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_POLYMESH_C)
676# define OPENMESH_POLYMESH_TEMPLATES
677# include "PolyMeshT_impl.hh"
678#endif
679//=============================================================================
680#endif // OPENMESH_POLYMESHT_HH defined
681//=============================================================================
Kernel::Vertex Vertex
Vertex type.
Definition PolyMeshT.hh:124
Kernel::FaceEdgeIter FaceEdgeIter
Circulator.
Definition PolyMeshT.hh:169
void calc_face_centroid(FaceHandle _fh, Point &_pt) const
calculates the average of the vertices defining _fh
Definition PolyMeshT.hh:299
Kernel::ConstFaceIter ConstFaceIter
Scalar type.
Definition PolyMeshT.hh:151
SH make_smart(SH const &sh) const
Return the passed smart handle. This allows for code using make_smart(h) to keep compiling when h's t...
Definition PolyMeshT.hh:210
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Definition PolyMeshT.hh:136
auto make_smart(H const &h) const -> typename SmartHandle< H >::type const
Create a smart handle from a regular handle.
Definition PolyMeshT.hh:201
Kernel::Scalar Scalar
Scalar type.
Definition PolyMeshT.hh:110
Kernel::ConstVertexVertexIter ConstVertexVertexIter
Circulator.
Definition PolyMeshT.hh:172
void calc_edge_vector(HalfedgeHandle _heh, Normal &_edge_vec) const
Definition PolyMeshT.hh:420
SmartVertexHandle new_vertex(const Point _p)
Adds a new vertex initialized to a custom position.
Definition PolyMeshT.hh:227
Kernel::ConstFaceHalfedgeIter ConstFaceHalfedgeIter
Circulator.
Definition PolyMeshT.hh:178
Kernel::EdgeHandle EdgeHandle
Scalar type.
Definition PolyMeshT.hh:138
Kernel::VertexFaceIter VertexFaceIter
Circulator.
Definition PolyMeshT.hh:166
Kernel::ConstFaceVertexIter ConstFaceVertexIter
Circulator.
Definition PolyMeshT.hh:177
Kernel::Halfedge Halfedge
Halfedge type.
Definition PolyMeshT.hh:126
void calc_vertex_normal_fast(VertexHandle _vh, Normal &_n) const
void calc_vertex_normal_correct(VertexHandle _vh, Normal &_n) const
Compute normals for all primitives.
PolyMeshT()
Circulator.
Definition PolyMeshT.hh:185
Scalar calc_dihedral_angle(EdgeHandle _eh) const
Compute normals for all primitives.
Definition PolyMeshT.hh:597
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
Kernel::FaceIter FaceIter
Scalar type.
Definition PolyMeshT.hh:146
Kernel::Normal Normal
Normal type.
Definition PolyMeshT.hh:114
Kernel::FaceVertexIter FaceVertexIter
Circulator.
Definition PolyMeshT.hh:167
Point calc_edge_midpoint(EdgeHandle _eh) const
Definition PolyMeshT.hh:463
SmartVertexHandle new_vertex()
Adds a new default-initialized vertex.
Definition PolyMeshT.hh:218
Kernel::VertexIHalfedgeIter VertexIHalfedgeIter
Circulator.
Definition PolyMeshT.hh:164
void split(FaceHandle _fh, VertexHandle _vh)
Compute normals for all primitives.
Definition PolyMeshT.hh:609
PolyMeshT(const T &t)
Circulator.
Definition PolyMeshT.hh:187
Kernel::TexCoord2D TexCoord2D
TexCoord2D type.
Definition PolyMeshT.hh:120
Scalar calc_sector_area(HalfedgeHandle _in_heh) const
Definition PolyMeshT.hh:541
void update_face_normals()
Update normal vectors for all faces.
void update_halfedge_normals(const double _feature_angle=0.8)
Update normal vectors for all halfedges.
unsigned int find_feature_edges(Scalar _angle_tresh=OpenMesh::deg_to_rad(44.0))
virtual Normal calc_halfedge_normal(HalfedgeHandle _heh, const double _feature_angle=0.8) const
Calculate halfedge normal for one specific halfedge.
Scalar calc_sector_angle(HalfedgeHandle _in_heh) const
Definition PolyMeshT.hh:486
Kernel::ConstFaceEdgeIter ConstFaceEdgeIter
Circulator.
Definition PolyMeshT.hh:179
Kernel::TexCoord3D TexCoord3D
TexCoord3D type.
Definition PolyMeshT.hh:122
void update_normals()
Compute normals for all primitives.
Kernel::ConstVertexFaceIter ConstVertexFaceIter
Circulator.
Definition PolyMeshT.hh:176
Kernel::VertexOHalfedgeIter VertexOHalfedgeIter
Circulator.
Definition PolyMeshT.hh:163
Point calc_centroid(FaceHandle _fh) const
Computes and returns the average of the vertices defining _fh (same as calc_face_centroid)
Kernel::VertexEdgeIter VertexEdgeIter
Circulator.
Definition PolyMeshT.hh:165
Scalar calc_dihedral_angle(HalfedgeHandle _heh) const
Compute normals for all primitives.
Definition PolyMeshT.hh:575
Kernel::Face Face
Face type.
Definition PolyMeshT.hh:130
Kernel::ConstVertexIHalfedgeIter ConstVertexIHalfedgeIter
Circulator.
Definition PolyMeshT.hh:174
virtual Normal calc_face_normal(FaceHandle _fh) const
Scalar calc_edge_length(EdgeHandle _eh) const
Compute normals for all primitives.
Definition PolyMeshT.hh:434
Kernel::ConstHalfedgeIter ConstHalfedgeIter
Scalar type.
Definition PolyMeshT.hh:149
void update_normal(VertexHandle _vh)
Update normal for vertex _vh.
Definition PolyMeshT.hh:358
Normal calc_face_normal_impl(FaceHandle, PointIs3DTag) const
Compute normals for all primitives.
void calc_sector_vectors(HalfedgeHandle _in_heh, Normal &_vec0, Normal &_vec1) const
Definition PolyMeshT.hh:475
SmartVertexHandle add_vertex_dirty(const Point _p)
Alias for new_vertex_dirty().
Definition PolyMeshT.hh:259
Kernel::FaceFaceIter FaceFaceIter
Circulator.
Definition PolyMeshT.hh:170
bool is_estimated_feature_edge(HalfedgeHandle _heh, const double _feature_angle) const
Normal calc_edge_vector(EdgeHandle _eh) const
Definition PolyMeshT.hh:413
virtual ~PolyMeshT()
Circulator.
Definition PolyMeshT.hh:188
Kernel::ConstVertexEdgeIter ConstVertexEdgeIter
Circulator.
Definition PolyMeshT.hh:175
Scalar calc_edge_sqr_length(HalfedgeHandle _heh) const
Compute normals for all primitives.
Definition PolyMeshT.hh:445
SmartVertexHandle add_vertex(const Point _p)
Definition PolyMeshT.hh:255
void calc_edge_vector(EdgeHandle _eh, Normal &_edge_vec) const
Definition PolyMeshT.hh:406
Kernel::Edge Edge
Edge type.
Definition PolyMeshT.hh:128
Kernel::FaceHandle FaceHandle
Scalar type.
Definition PolyMeshT.hh:139
void update_normal(FaceHandle _fh)
Update normal for face _fh.
Definition PolyMeshT.hh:278
Scalar calc_dihedral_angle_fast(EdgeHandle _eh) const
Definition PolyMeshT.hh:571
void calc_vertex_normal_loop(VertexHandle _vh, Normal &_n) const
Compute normals for all primitives.
void split(EdgeHandle _eh, const Point &_p)
Compute normals for all primitives.
Definition PolyMeshT.hh:612
Kernel::HalfedgeHandle HalfedgeHandle
Scalar type.
Definition PolyMeshT.hh:137
Kernel::EdgeIter EdgeIter
Scalar type.
Definition PolyMeshT.hh:145
void update_normal(HalfedgeHandle _heh, const double _feature_angle=0.8)
Update normal for halfedge _heh.
Definition PolyMeshT.hh:322
Kernel::ConstEdgeIter ConstEdgeIter
Scalar type.
Definition PolyMeshT.hh:150
Kernel::ConstVertexIter ConstVertexIter
Scalar type.
Definition PolyMeshT.hh:148
void update_vertex_normals()
Update normal vectors for all vertices.
void calc_sector_normal(HalfedgeHandle _in_heh, Normal &_sector_normal) const
Definition PolyMeshT.hh:531
Kernel::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter
Circulator.
Definition PolyMeshT.hh:173
Normal calc_edge_vector(HalfedgeHandle _heh) const
Definition PolyMeshT.hh:427
Scalar calc_edge_sqr_length(EdgeHandle _eh) const
Compute normals for all primitives.
Definition PolyMeshT.hh:442
Point calc_edge_midpoint(HalfedgeHandle _heh) const
Definition PolyMeshT.hh:454
Kernel::VertexVertexIter VertexVertexIter
Circulator.
Definition PolyMeshT.hh:162
void split(EdgeHandle _eh, VertexHandle _vh)
Compute normals for all primitives.
Definition PolyMeshT.hh:615
Kernel::HalfedgeIter HalfedgeIter
Scalar type.
Definition PolyMeshT.hh:144
Scalar calc_edge_length(HalfedgeHandle _heh) const
Definition PolyMeshT.hh:439
Kernel::FaceHalfedgeIter FaceHalfedgeIter
Circulator.
Definition PolyMeshT.hh:168
Kernel::Point Point
Coordinate type.
Definition PolyMeshT.hh:112
PolyMeshT< Kernel > This
Self type. Used to specify iterators/circulators.
Definition PolyMeshT.hh:95
Kernel::ConstFaceFaceIter ConstFaceFaceIter
Circulator.
Definition PolyMeshT.hh:180
void split(FaceHandle _fh, const Point &_p)
Face split (= 1-to-n split)
Definition PolyMeshT.hh:606
Kernel::Color Color
Color type.
Definition PolyMeshT.hh:116
Kernel::TexCoord1D TexCoord1D
TexCoord1D type.
Definition PolyMeshT.hh:118
Normal calc_normal(FaceHandle _fh) const
same as calc_face_normal
Kernel::VertexIter VertexIter
Scalar type.
Definition PolyMeshT.hh:143
SmartVertexHandle new_vertex_dirty(const Point _p)
Definition PolyMeshT.hh:245
Scalar calc_dihedral_angle_fast(HalfedgeHandle _heh) const
Definition PolyMeshT.hh:550
Normal calc_vertex_normal(VertexHandle _vh) const
Calculate vertex normal for one specific vertex.
SmartVertexHandle make_smart(VertexHandle _vh, const PolyConnectivity *_mesh)
Creats a SmartVertexHandle from a VertexHandle and a Mesh.
osg::Vec3f::ValueType dot(const osg::Vec3f &_v1, const osg::Vec3f &_v2)
Adapter for osg vector member computing a scalar product.
T angle(T _cos_angle, T _sin_angle)
Definition MathDefs.hh:140
LHS mesh_cast(PolyMeshT< KERNEL > &rhs)
Cast a mesh with different but identical traits into each other.
Definition PolyMeshT.hh:653
T sane_aarg(T _aarg)
Trigonometry/angles - related.
Definition MathDefs.hh:122
Handle for a edge entity.
Definition Handles.hh:135
Handle for a face entity.
Definition Handles.hh:142
Handle for a halfedge entity.
Definition Handles.hh:128
Cast a mesh with different but identical traits into each other.
Handle type for meshes to simplify some template programming.
Definition Handles.hh:149
Smart version of VertexHandle contains a pointer to the corresponding mesh and allows easier access t...
Handle for a vertex entity.
Definition Handles.hh:121