Loading...
Searching...
No Matches
PolyMeshT.hh
/* ========================================================================= *
* *
* OpenMesh *
* Copyright (c) 2001-2025, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openmesh.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenMesh. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
* ========================================================================= */
//=============================================================================
//
// CLASS PolyMeshT
//
//=============================================================================
#ifndef OPENMESH_POLYMESHT_HH
#define OPENMESH_POLYMESHT_HH
//== INCLUDES =================================================================
#include <OpenMesh/Core/System/config.h>
#include <OpenMesh/Core/Geometry/MathDefs.hh>
#include <OpenMesh/Core/Mesh/PolyConnectivity.hh>
#include <OpenMesh/Core/Mesh/FinalMeshItemsT.hh>
#include <OpenMesh/Core/Mesh/Tags.hh>
#include <vector>
//== NAMESPACES ===============================================================
namespace OpenMesh {
//== CLASS DEFINITION =========================================================
template <class Kernel>
class PolyMeshT : public Kernel
{
public:
typedef PolyMeshT<Kernel> This;
//--- item types ---
static constexpr bool is_polymesh() { return true; }
static constexpr bool is_trimesh() { return false; }
using ConnectivityTag = PolyConnectivityTag;
enum { IsPolyMesh = 1 };
enum { IsTriMesh = 0 };
typedef typename Kernel::Scalar Scalar;
typedef typename Kernel::Point Point;
typedef typename Kernel::Normal Normal;
typedef typename Kernel::Color Color;
typedef typename Kernel::TexCoord1D TexCoord1D;
typedef typename Kernel::TexCoord2D TexCoord2D;
typedef typename Kernel::TexCoord3D TexCoord3D;
typedef typename Kernel::Vertex Vertex;
typedef typename Kernel::Halfedge Halfedge;
typedef typename Kernel::Edge Edge;
typedef typename Kernel::Face Face;
//--- handle types ---
typedef typename Kernel::VertexHandle VertexHandle;
typedef typename Kernel::HalfedgeHandle HalfedgeHandle;
typedef typename Kernel::EdgeHandle EdgeHandle;
typedef typename Kernel::FaceHandle FaceHandle;
typedef typename Kernel::VertexIter VertexIter;
typedef typename Kernel::HalfedgeIter HalfedgeIter;
typedef typename Kernel::EdgeIter EdgeIter;
typedef typename Kernel::FaceIter FaceIter;
typedef typename Kernel::ConstVertexIter ConstVertexIter;
typedef typename Kernel::ConstHalfedgeIter ConstHalfedgeIter;
typedef typename Kernel::ConstEdgeIter ConstEdgeIter;
typedef typename Kernel::ConstFaceIter ConstFaceIter;
//--- circulators ---
typedef typename Kernel::VertexVertexIter VertexVertexIter;
typedef typename Kernel::VertexOHalfedgeIter VertexOHalfedgeIter;
typedef typename Kernel::VertexIHalfedgeIter VertexIHalfedgeIter;
typedef typename Kernel::VertexEdgeIter VertexEdgeIter;
typedef typename Kernel::VertexFaceIter VertexFaceIter;
typedef typename Kernel::FaceVertexIter FaceVertexIter;
typedef typename Kernel::FaceHalfedgeIter FaceHalfedgeIter;
typedef typename Kernel::FaceEdgeIter FaceEdgeIter;
typedef typename Kernel::FaceFaceIter FaceFaceIter;
typedef typename Kernel::ConstVertexVertexIter ConstVertexVertexIter;
typedef typename Kernel::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter;
typedef typename Kernel::ConstVertexIHalfedgeIter ConstVertexIHalfedgeIter;
typedef typename Kernel::ConstVertexEdgeIter ConstVertexEdgeIter;
typedef typename Kernel::ConstVertexFaceIter ConstVertexFaceIter;
typedef typename Kernel::ConstFaceVertexIter ConstFaceVertexIter;
typedef typename Kernel::ConstFaceHalfedgeIter ConstFaceHalfedgeIter;
typedef typename Kernel::ConstFaceEdgeIter ConstFaceEdgeIter;
typedef typename Kernel::ConstFaceFaceIter ConstFaceFaceIter;
// --- constructor/destructor
PolyMeshT() {}
template<typename T>
explicit PolyMeshT(const T& t) : Kernel(t) {}
virtual ~PolyMeshT() {}
// --- creation ---
inline SmartVertexHandle new_vertex()
{ return make_smart(Kernel::new_vertex(), this); }
inline SmartVertexHandle new_vertex(const Point _p)
{
VertexHandle vh(Kernel::new_vertex());
this->set_point(vh, _p);
return make_smart(vh, this);
}
inline SmartVertexHandle new_vertex_dirty(const Point _p)
{
VertexHandle vh(Kernel::new_vertex_dirty());
this->set_point(vh, _p);
return make_smart(vh, this);
}
inline SmartVertexHandle add_vertex(const Point _p)
{ return new_vertex(_p); }
inline SmartVertexHandle add_vertex_dirty(const Point _p)
{ return make_smart(new_vertex_dirty(_p), this); }
// --- normal vectors ---
void update_normals();
void update_normal(FaceHandle _fh)
{ this->set_normal(_fh, calc_face_normal(_fh)); }
void update_face_normals();
virtual Normal calc_face_normal(FaceHandle _fh) const;
Normal calc_face_normal(const Point& _p0, const Point& _p1,
const Point& _p2) const;
Normal calc_normal(FaceHandle _fh) const;
void calc_face_centroid(FaceHandle _fh, Point& _pt) const {
_pt = calc_face_centroid(_fh);
}
Point calc_face_centroid(FaceHandle _fh) const;
Point calc_centroid(FaceHandle _fh) const;
Point calc_centroid(EdgeHandle _eh) const;
Point calc_centroid(HalfedgeHandle _heh) const;
Point calc_centroid(VertexHandle _vh) const;
Point calc_centroid(MeshHandle _mh) const;
void update_normal(HalfedgeHandle _heh, const double _feature_angle = 0.8)
{ this->set_normal(_heh, calc_halfedge_normal(_heh,_feature_angle)); }
void update_halfedge_normals(const double _feature_angle = 0.8);
virtual Normal calc_halfedge_normal(HalfedgeHandle _heh, const double _feature_angle = 0.8) const;
Normal calc_normal(HalfedgeHandle, const double _feature_angle = 0.8) const;
bool is_estimated_feature_edge(HalfedgeHandle _heh, const double _feature_angle) const;
void update_normal(VertexHandle _vh)
{ this->set_normal(_vh, calc_vertex_normal(_vh)); }
void update_vertex_normals();
Normal calc_vertex_normal(VertexHandle _vh) const;
void calc_vertex_normal_fast(VertexHandle _vh, Normal& _n) const;
void calc_vertex_normal_correct(VertexHandle _vh, Normal& _n) const;
void calc_vertex_normal_loop(VertexHandle _vh, Normal& _n) const;
Normal calc_normal(VertexHandle _vh) const;
// --- Geometry API - still in development ---
void calc_edge_vector(EdgeHandle _eh, Normal& _edge_vec) const
{
_edge_vec = calc_edge_vector(_eh);
}
Normal calc_edge_vector(EdgeHandle _eh) const
{
return calc_edge_vector(this->halfedge_handle(_eh,0));
}
void calc_edge_vector(HalfedgeHandle _heh, Normal& _edge_vec) const
{
_edge_vec = calc_edge_vector(_heh);
}
Normal calc_edge_vector(HalfedgeHandle _heh) const
{
return this->point(this->to_vertex_handle(_heh)) -
this->point(this->from_vertex_handle(_heh));
}
// Calculates the length of the edge _eh
Scalar calc_edge_length(EdgeHandle _eh) const
{ return calc_edge_length(this->halfedge_handle(_eh,0)); }
Scalar calc_edge_length(HalfedgeHandle _heh) const
{ return (Scalar)sqrt(calc_edge_sqr_length(_heh)); }
Scalar calc_edge_sqr_length(EdgeHandle _eh) const
{ return calc_edge_sqr_length(this->halfedge_handle(_eh,0)); }
Scalar calc_edge_sqr_length(HalfedgeHandle _heh) const
{
Normal edge_vec;
calc_edge_vector(_heh, edge_vec);
return sqrnorm(edge_vec);
}
Point calc_edge_midpoint(HalfedgeHandle _heh) const
{
VertexHandle vh0 = this->from_vertex_handle(_heh);
VertexHandle vh1 = this->to_vertex_handle(_heh);
return 0.5 * (this->point(vh0) + this->point(vh1));
}
Point calc_edge_midpoint(EdgeHandle _eh) const
{
return calc_edge_midpoint(this->halfedge_handle(_eh, 0));
}
Normal calc_normal(EdgeHandle _eh) const;
void calc_sector_vectors(HalfedgeHandle _in_heh, Normal& _vec0, Normal& _vec1) const
{
calc_edge_vector(this->next_halfedge_handle(_in_heh), _vec0);//p2 - p1
calc_edge_vector(this->opposite_halfedge_handle(_in_heh), _vec1);//p0 - p1
}
Scalar calc_sector_angle(HalfedgeHandle _in_heh) const
{
Normal v0, v1;
calc_sector_vectors(_in_heh, v0, v1);
Scalar denom = norm(v0)*norm(v1);
if ( denom == Scalar(0))
{
return 0;
}
Scalar cos_a = dot(v0 , v1) / denom;
if (this->is_boundary(_in_heh))
{//determine if the boundary sector is concave or convex
FaceHandle fh(this->face_handle(this->opposite_halfedge_handle(_in_heh)));
Normal f_n(calc_face_normal(fh));//this normal is (for convex fh) OK
Scalar sign_a = dot(cross(v0, v1), f_n);
return angle(cos_a, sign_a);
}
else
{
return acos(sane_aarg(cos_a));
}
}
// calculate the cos and the sin of angle <(_in_heh,next_halfedge(_in_heh))
/*
void calc_sector_angle_cos_sin(HalfedgeHandle _in_heh, Scalar& _cos_a, Scalar& _sin_a) const
{
Normal in_vec, out_vec;
calc_edge_vector(_in_heh, in_vec);
calc_edge_vector(next_halfedge_handle(_in_heh), out_vec);
Scalar denom = norm(in_vec)*norm(out_vec);
if (is_zero(denom))
{
_cos_a = 1;
_sin_a = 0;
}
else
{
_cos_a = dot(in_vec, out_vec)/denom;
_sin_a = norm(cross(in_vec, out_vec))/denom;
}
}
*/
void calc_sector_normal(HalfedgeHandle _in_heh, Normal& _sector_normal) const
{
Normal vec0, vec1;
calc_sector_vectors(_in_heh, vec0, vec1);
_sector_normal = cross(vec0, vec1);//(p2-p1)^(p0-p1)
}
Scalar calc_sector_area(HalfedgeHandle _in_heh) const
{
Normal sector_normal;
calc_sector_normal(_in_heh, sector_normal);
return norm(sector_normal)/2;
}
Scalar calc_dihedral_angle_fast(HalfedgeHandle _heh) const
{
// Make sure that we have face normals on the mesh
assert(Kernel::has_face_normals());
if (this->is_boundary(this->edge_handle(_heh)))
{//the dihedral angle at a boundary edge is 0
return 0;
}
const Normal& n0 = this->normal(this->face_handle(_heh));
const Normal& n1 = this->normal(this->face_handle(this->opposite_halfedge_handle(_heh)));
Normal he;
calc_edge_vector(_heh, he);
Scalar da_cos = dot(n0, n1);
//should be normalized, but we need only the sign
Scalar da_sin_sign = dot(cross(n0, n1), he);
return angle(da_cos, da_sin_sign);
}
Scalar calc_dihedral_angle_fast(EdgeHandle _eh) const
{ return calc_dihedral_angle_fast(this->halfedge_handle(_eh,0)); }
// calculates the dihedral angle on the halfedge _heh
Scalar calc_dihedral_angle(HalfedgeHandle _heh) const
{
if (this->is_boundary(this->edge_handle(_heh)))
{//the dihedral angle at a boundary edge is 0
return 0;
}
Normal n0, n1, he;
calc_sector_normal(_heh, n0);
calc_sector_normal(this->opposite_halfedge_handle(_heh), n1);
calc_edge_vector(_heh, he);
Scalar denom = norm(n0)*norm(n1);
if (denom == Scalar(0))
{
return 0;
}
Scalar da_cos = dot(n0, n1)/denom;
//should be normalized, but we need only the sign
Scalar da_sin_sign = dot(cross(n0, n1), he);
return angle(da_cos, da_sin_sign);
}
// calculates the dihedral angle on the edge _eh
Scalar calc_dihedral_angle(EdgeHandle _eh) const
{ return calc_dihedral_angle(this->halfedge_handle(_eh,0)); }
unsigned int find_feature_edges(Scalar _angle_tresh = OpenMesh::deg_to_rad(44.0));
// --- misc ---
inline void split(FaceHandle _fh, const Point& _p)
{ Kernel::split(_fh, add_vertex(_p)); }
inline void split(FaceHandle _fh, VertexHandle _vh)
{ Kernel::split(_fh, _vh); }
inline void split(EdgeHandle _eh, const Point& _p)
{ Kernel::split_edge(_eh, add_vertex(_p)); }
inline void split(EdgeHandle _eh, VertexHandle _vh)
{ Kernel::split_edge(_eh, _vh); }
private:
struct PointIs3DTag {};
struct PointIsNot3DTag {};
Normal calc_face_normal_impl(FaceHandle, PointIs3DTag) const;
Normal calc_face_normal_impl(FaceHandle, PointIsNot3DTag) const;
Normal calc_face_normal_impl(const Point&, const Point&, const Point&, PointIs3DTag) const;
Normal calc_face_normal_impl(const Point&, const Point&, const Point&, PointIsNot3DTag) const;
};
template<typename LHS, typename KERNEL>
LHS mesh_cast(PolyMeshT<KERNEL> &rhs) {
return MeshCast<LHS, PolyMeshT<KERNEL>&>::cast(rhs);
}
template<typename LHS, typename KERNEL>
LHS mesh_cast(PolyMeshT<KERNEL> *rhs) {
return MeshCast<LHS, PolyMeshT<KERNEL>*>::cast(rhs);
}
template<typename LHS, typename KERNEL>
const LHS mesh_cast(const PolyMeshT<KERNEL> &rhs) {
return MeshCast<LHS, const PolyMeshT<KERNEL>&>::cast(rhs);
}
template<typename LHS, typename KERNEL>
const LHS mesh_cast(const PolyMeshT<KERNEL> *rhs) {
return MeshCast<LHS, const PolyMeshT<KERNEL>*>::cast(rhs);
}
//=============================================================================
} // namespace OpenMesh
//=============================================================================
#if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_POLYMESH_C)
# define OPENMESH_POLYMESH_TEMPLATES
# include "PolyMeshT_impl.hh"
#endif
//=============================================================================
#endif // OPENMESH_POLYMESHT_HH defined
//=============================================================================
OpenMesh
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition MeshItems.hh:59
OpenMesh::make_smart
SmartVertexHandle make_smart(VertexHandle _vh, const PolyConnectivity *_mesh)
Creats a SmartVertexHandle from a VertexHandle and a Mesh.
Definition SmartHandles.hh:265
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:176
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:140
OpenMesh::mesh_cast
LHS mesh_cast(PolyMeshT< KERNEL > &rhs)
Cast a mesh with different but identical traits into each other.
Definition PolyMeshT.hh:636
OpenMesh::sane_aarg
T sane_aarg(T _aarg)
Trigonometry/angles - related.
Definition MathDefs.hh:122
OpenMesh::MeshCast
Cast a mesh with different but identical traits into each other.
Definition FinalMeshItemsT.hh:178
OpenMesh::VertexHandle
Handle for a vertex entity.
Definition Handles.hh:121
OpenMesh::HalfedgeHandle
Handle for a halfedge entity.
Definition Handles.hh:128
OpenMesh::EdgeHandle
Handle for a edge entity.
Definition Handles.hh:135
OpenMesh::FaceHandle
Handle for a face entity.
Definition Handles.hh:142
OpenMesh::MeshHandle
Handle type for meshes to simplify some template programming.
Definition Handles.hh:149
OpenMesh::PolyMeshT
Base type for a polygonal mesh.
Definition PolyMeshT.hh:91
OpenMesh::PolyMeshT::Vertex
Kernel::Vertex Vertex
Vertex type.
Definition PolyMeshT.hh:124
OpenMesh::PolyMeshT::FaceEdgeIter
Kernel::FaceEdgeIter FaceEdgeIter
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:282
OpenMesh::PolyMeshT::ConstFaceIter
Kernel::ConstFaceIter ConstFaceIter
Scalar type.
Definition PolyMeshT.hh:151
OpenMesh::PolyMeshT::VertexHandle
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
Definition PolyMeshT.hh:136
OpenMesh::PolyMeshT::Scalar
Kernel::Scalar Scalar
Scalar type.
Definition PolyMeshT.hh:110
OpenMesh::PolyMeshT::ConstVertexVertexIter
Kernel::ConstVertexVertexIter ConstVertexVertexIter
Circulator.
Definition PolyMeshT.hh:172
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:403
OpenMesh::PolyMeshT::new_vertex
SmartVertexHandle new_vertex(const Point _p)
Adds a new vertex initialized to a custom position.
Definition PolyMeshT.hh:210
OpenMesh::PolyMeshT::ConstFaceHalfedgeIter
Kernel::ConstFaceHalfedgeIter ConstFaceHalfedgeIter
Circulator.
Definition PolyMeshT.hh:178
OpenMesh::PolyMeshT::EdgeHandle
Kernel::EdgeHandle EdgeHandle
Scalar type.
Definition PolyMeshT.hh:138
OpenMesh::PolyMeshT::VertexFaceIter
Kernel::VertexFaceIter VertexFaceIter
Circulator.
Definition PolyMeshT.hh:166
OpenMesh::PolyMeshT::ConstFaceVertexIter
Kernel::ConstFaceVertexIter ConstFaceVertexIter
Circulator.
Definition PolyMeshT.hh:177
OpenMesh::PolyMeshT::Halfedge
Kernel::Halfedge Halfedge
Halfedge type.
Definition PolyMeshT.hh:126
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_impl.hh:497
OpenMesh::PolyMeshT::calc_vertex_normal_correct
void calc_vertex_normal_correct(VertexHandle _vh, Normal &_n) const
Compute normals for all primitives.
Definition PolyMeshT_impl.hh:507
OpenMesh::PolyMeshT::PolyMeshT
PolyMeshT()
Circulator.
Definition PolyMeshT.hh:185
OpenMesh::PolyMeshT::calc_dihedral_angle
Scalar calc_dihedral_angle(EdgeHandle _eh) const
Compute normals for all primitives.
Definition PolyMeshT.hh:580
OpenMesh::PolyMeshT::is_polymesh
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
OpenMesh::PolyMeshT::FaceIter
Kernel::FaceIter FaceIter
Scalar type.
Definition PolyMeshT.hh:146
OpenMesh::PolyMeshT::Normal
Kernel::Normal Normal
Normal type.
Definition PolyMeshT.hh:114
OpenMesh::PolyMeshT::FaceVertexIter
Kernel::FaceVertexIter FaceVertexIter
Circulator.
Definition PolyMeshT.hh:167
OpenMesh::PolyMeshT::calc_edge_midpoint
Point calc_edge_midpoint(EdgeHandle _eh) const
Calculates the midpoint of the edge _eh, defined by the positions of the two incident vertices.
Definition PolyMeshT.hh:446
OpenMesh::PolyMeshT::new_vertex
SmartVertexHandle new_vertex()
Uses default copy and assignment operator.
Definition PolyMeshT.hh:201
OpenMesh::PolyMeshT::VertexIHalfedgeIter
Kernel::VertexIHalfedgeIter VertexIHalfedgeIter
Circulator.
Definition PolyMeshT.hh:164
OpenMesh::PolyMeshT::split
void split(FaceHandle _fh, VertexHandle _vh)
Compute normals for all primitives.
Definition PolyMeshT.hh:592
OpenMesh::PolyMeshT::PolyMeshT
PolyMeshT(const T &t)
Circulator.
Definition PolyMeshT.hh:187
OpenMesh::PolyMeshT::TexCoord2D
Kernel::TexCoord2D TexCoord2D
TexCoord2D type.
Definition PolyMeshT.hh:120
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:524
OpenMesh::PolyMeshT::update_face_normals
void update_face_normals()
Update normal vectors for all faces.
Definition PolyMeshT_impl.hh:335
OpenMesh::PolyMeshT::update_halfedge_normals
void update_halfedge_normals(const double _feature_angle=0.8)
Update normal vectors for all halfedges.
Definition PolyMeshT_impl.hh:350
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_impl.hh:74
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_impl.hh:365
OpenMesh::PolyMeshT::calc_sector_angle
Scalar calc_sector_angle(HalfedgeHandle _in_heh) const
calculates the sector angle.
Definition PolyMeshT.hh:469
OpenMesh::PolyMeshT::ConstFaceEdgeIter
Kernel::ConstFaceEdgeIter ConstFaceEdgeIter
Circulator.
Definition PolyMeshT.hh:179
OpenMesh::PolyMeshT::TexCoord3D
Kernel::TexCoord3D TexCoord3D
TexCoord3D type.
Definition PolyMeshT.hh:122
OpenMesh::PolyMeshT::update_normals
void update_normals()
Compute normals for all primitives.
Definition PolyMeshT_impl.hh:317
OpenMesh::PolyMeshT::ConstVertexFaceIter
Kernel::ConstVertexFaceIter ConstVertexFaceIter
Circulator.
Definition PolyMeshT.hh:176
OpenMesh::PolyMeshT::VertexOHalfedgeIter
Kernel::VertexOHalfedgeIter VertexOHalfedgeIter
Circulator.
Definition PolyMeshT.hh:163
OpenMesh::PolyMeshT::calc_centroid
Point calc_centroid(FaceHandle _fh) const
Computes and returns the average of the vertices defining _fh (same as calc_face_centroid)
Definition PolyMeshT_impl.hh:267
OpenMesh::PolyMeshT::VertexEdgeIter
Kernel::VertexEdgeIter VertexEdgeIter
Circulator.
Definition PolyMeshT.hh:165
OpenMesh::PolyMeshT::calc_dihedral_angle
Scalar calc_dihedral_angle(HalfedgeHandle _heh) const
Compute normals for all primitives.
Definition PolyMeshT.hh:558
OpenMesh::PolyMeshT::Face
Kernel::Face Face
Face type.
Definition PolyMeshT.hh:130
OpenMesh::PolyMeshT::ConstVertexIHalfedgeIter
Kernel::ConstVertexIHalfedgeIter ConstVertexIHalfedgeIter
Circulator.
Definition PolyMeshT.hh:174
OpenMesh::PolyMeshT::calc_face_normal
virtual Normal calc_face_normal(FaceHandle _fh) const
Calculate normal vector for face _fh.
Definition PolyMeshT_impl.hh:97
OpenMesh::PolyMeshT::calc_edge_length
Scalar calc_edge_length(EdgeHandle _eh) const
Compute normals for all primitives.
Definition PolyMeshT.hh:417
OpenMesh::PolyMeshT::ConstHalfedgeIter
Kernel::ConstHalfedgeIter ConstHalfedgeIter
Scalar type.
Definition PolyMeshT.hh:149
OpenMesh::PolyMeshT::update_normal
void update_normal(VertexHandle _vh)
Update normal for vertex _vh.
Definition PolyMeshT.hh:341
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:458
OpenMesh::PolyMeshT::add_vertex_dirty
SmartVertexHandle add_vertex_dirty(const Point _p)
Alias for new_vertex_dirty().
Definition PolyMeshT.hh:242
OpenMesh::PolyMeshT::FaceFaceIter
Kernel::FaceFaceIter FaceFaceIter
Circulator.
Definition PolyMeshT.hh:170
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_impl.hh:452
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:396
OpenMesh::PolyMeshT::~PolyMeshT
virtual ~PolyMeshT()
Circulator.
Definition PolyMeshT.hh:188
OpenMesh::PolyMeshT::ConstVertexEdgeIter
Kernel::ConstVertexEdgeIter ConstVertexEdgeIter
Circulator.
Definition PolyMeshT.hh:175
OpenMesh::PolyMeshT::calc_edge_sqr_length
Scalar calc_edge_sqr_length(HalfedgeHandle _heh) const
Compute normals for all primitives.
Definition PolyMeshT.hh:428
OpenMesh::PolyMeshT::add_vertex
SmartVertexHandle add_vertex(const Point _p)
Alias for new_vertex(const Point&).
Definition PolyMeshT.hh:238
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:389
OpenMesh::PolyMeshT::Edge
Kernel::Edge Edge
Edge type.
Definition PolyMeshT.hh:128
OpenMesh::PolyMeshT::FaceHandle
Kernel::FaceHandle FaceHandle
Scalar type.
Definition PolyMeshT.hh:139
OpenMesh::PolyMeshT::update_normal
void update_normal(FaceHandle _fh)
Update normal for face _fh.
Definition PolyMeshT.hh:261
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:554
OpenMesh::PolyMeshT::calc_vertex_normal_loop
void calc_vertex_normal_loop(VertexHandle _vh, Normal &_n) const
Compute normals for all primitives.
Definition PolyMeshT_impl.hh:538
OpenMesh::PolyMeshT::split
void split(EdgeHandle _eh, const Point &_p)
Compute normals for all primitives.
Definition PolyMeshT.hh:595
OpenMesh::PolyMeshT::HalfedgeHandle
Kernel::HalfedgeHandle HalfedgeHandle
Scalar type.
Definition PolyMeshT.hh:137
OpenMesh::PolyMeshT::EdgeIter
Kernel::EdgeIter EdgeIter
Scalar type.
Definition PolyMeshT.hh:145
OpenMesh::PolyMeshT::update_normal
void update_normal(HalfedgeHandle _heh, const double _feature_angle=0.8)
Update normal for halfedge _heh.
Definition PolyMeshT.hh:305
OpenMesh::PolyMeshT::ConstEdgeIter
Kernel::ConstEdgeIter ConstEdgeIter
Scalar type.
Definition PolyMeshT.hh:150
OpenMesh::PolyMeshT::ConstVertexIter
Kernel::ConstVertexIter ConstVertexIter
Scalar type.
Definition PolyMeshT.hh:148
OpenMesh::PolyMeshT::update_vertex_normals
void update_vertex_normals()
Update normal vectors for all vertices.
Definition PolyMeshT_impl.hh:572
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,...
Definition PolyMeshT.hh:514
OpenMesh::PolyMeshT::ConstVertexOHalfedgeIter
Kernel::ConstVertexOHalfedgeIter ConstVertexOHalfedgeIter
Circulator.
Definition PolyMeshT.hh:173
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:410
OpenMesh::PolyMeshT::calc_edge_sqr_length
Scalar calc_edge_sqr_length(EdgeHandle _eh) const
Compute normals for all primitives.
Definition PolyMeshT.hh:425
OpenMesh::PolyMeshT::calc_edge_midpoint
Point calc_edge_midpoint(HalfedgeHandle _heh) const
Calculates the midpoint of the halfedge _heh, defined by the positions of the two incident vertices.
Definition PolyMeshT.hh:437
OpenMesh::PolyMeshT::VertexVertexIter
Kernel::VertexVertexIter VertexVertexIter
Circulator.
Definition PolyMeshT.hh:162
OpenMesh::PolyMeshT::split
void split(EdgeHandle _eh, VertexHandle _vh)
Compute normals for all primitives.
Definition PolyMeshT.hh:598
OpenMesh::PolyMeshT::HalfedgeIter
Kernel::HalfedgeIter HalfedgeIter
Scalar type.
Definition PolyMeshT.hh:144
OpenMesh::PolyMeshT::calc_edge_length
Scalar calc_edge_length(HalfedgeHandle _heh) const
Calculates the length of the edge _heh.
Definition PolyMeshT.hh:422
OpenMesh::PolyMeshT::FaceHalfedgeIter
Kernel::FaceHalfedgeIter FaceHalfedgeIter
Circulator.
Definition PolyMeshT.hh:168
OpenMesh::PolyMeshT::Point
Kernel::Point Point
Coordinate type.
Definition PolyMeshT.hh:112
OpenMesh::PolyMeshT::This
PolyMeshT< Kernel > This
Self type. Used to specify iterators/circulators.
Definition PolyMeshT.hh:95
OpenMesh::PolyMeshT::ConstFaceFaceIter
Kernel::ConstFaceFaceIter ConstFaceFaceIter
Circulator.
Definition PolyMeshT.hh:180
OpenMesh::PolyMeshT::split
void split(FaceHandle _fh, const Point &_p)
Face split (= 1-to-n split)
Definition PolyMeshT.hh:589
OpenMesh::PolyMeshT::Color
Kernel::Color Color
Color type.
Definition PolyMeshT.hh:116
OpenMesh::PolyMeshT::TexCoord1D
Kernel::TexCoord1D TexCoord1D
TexCoord1D type.
Definition PolyMeshT.hh:118
OpenMesh::PolyMeshT::calc_normal
Normal calc_normal(FaceHandle _fh) const
same as calc_face_normal
Definition PolyMeshT_impl.hh:187
OpenMesh::PolyMeshT::VertexIter
Kernel::VertexIter VertexIter
Scalar type.
Definition PolyMeshT.hh:143
OpenMesh::PolyMeshT::new_vertex_dirty
SmartVertexHandle new_vertex_dirty(const Point _p)
Same as new_vertex(const Point&) but never shrinks, only enlarges the vertex property vectors.
Definition PolyMeshT.hh:228
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:533
OpenMesh::PolyMeshT::calc_vertex_normal
Normal calc_vertex_normal(VertexHandle _vh) const
Calculate vertex normal for one specific vertex.
Definition PolyMeshT_impl.hh:483
OpenMesh::SmartVertexHandle
Smart version of VertexHandle contains a pointer to the corresponding mesh and allows easier access t...
Definition SmartHandles.hh:110