48 #ifndef OPENMESH_VDPROGMESH_VHIERARCHYNODE_HH
49 #define OPENMESH_VDPROGMESH_VHIERARCHYNODE_HH
57 #include <OpenMesh/Core/Geometry/VectorT.hh>
58 #include <OpenMesh/Core/Mesh/Handles.hh>
59 #include <OpenMesh/Tools/VDPM/VHierarchyNodeIndex.hh>
96 {
return (parent_handle_.
is_valid() ==
false) ?
true :
false; }
100 {
return (lchild_handle_.
is_valid() ==
false) ?
true :
false; }
113 { parent_handle_ = _parent_handle; }
115 void set_children_handle(VHierarchyNodeHandle _lchild_handle)
116 { lchild_handle_ = _lchild_handle; }
118 VertexHandle vertex_handle()
const {
return vh_; }
119 float radius()
const {
return radius_; }
120 const OpenMesh::Vec3f& normal()
const {
return normal_; }
121 float sin_square()
const {
return sin_square_; }
122 float mue_square()
const {
return mue_square_; }
123 float sigma_square()
const {
return sigma_square_; }
126 void set_radius(
float _radius) { radius_ = _radius; }
127 void set_normal(
const OpenMesh::Vec3f &_normal) { normal_ = _normal; }
129 void set_sin_square(
float _sin_square) { sin_square_ = _sin_square; }
130 void set_mue_square(
float _mue_square) { mue_square_ = _mue_square; }
131 void set_sigma_square(
float _sigma_square) { sigma_square_ = _sigma_square; }
133 void set_semi_angle(
float _semi_angle)
134 {
float f=sinf(_semi_angle); sin_square_ = f*f; }
136 void set_mue(
float _mue) { mue_square_ = _mue * _mue; }
137 void set_sigma(
float _sigma) { sigma_square_ = _sigma * _sigma; }
139 const VHierarchyNodeIndex& node_index()
const {
return node_index_; }
140 const VHierarchyNodeIndex& fund_lcut_index()
const
141 {
return fund_cut_node_index_[0]; }
143 const VHierarchyNodeIndex& fund_rcut_index()
const
144 {
return fund_cut_node_index_[1]; }
146 VHierarchyNodeIndex& node_index()
147 {
return node_index_; }
149 VHierarchyNodeIndex& fund_lcut_index() {
return fund_cut_node_index_[0]; }
150 VHierarchyNodeIndex& fund_rcut_index() {
return fund_cut_node_index_[1]; }
152 void set_index(
const VHierarchyNodeIndex &_node_index)
153 { node_index_ = _node_index; }
155 void set_fund_lcut(
const VHierarchyNodeIndex &_node_index)
156 { fund_cut_node_index_[0] = _node_index; }
158 void set_fund_rcut(
const VHierarchyNodeIndex &_node_index)
159 { fund_cut_node_index_[1] = _node_index; }
169 VHierarchyNodeHandle parent_handle_;
170 VHierarchyNodeHandle lchild_handle_;
173 VHierarchyNodeIndex node_index_;
174 VHierarchyNodeIndex fund_cut_node_index_[2];
191 #endif // OPENMESH_VDPROGMESH_VHIERARCHYNODE_HH defined
int idx() const
Get the underlying index of this handle.
Definition: Handles.hh:67
VHierarchyNodeHandle parent_handle()
Returns parent handle.
Definition: VHierarchyNode.hh:103
VHierarchyNodeHandle rchild_handle()
Returns handle to right child.
Definition: VHierarchyNode.hh:109
Vertex hierarchy node.
Definition: VHierarchyNode.hh:88
bool is_valid() const
The handle is valid iff the index is not equal to -1.
Definition: Handles.hh:70
std::vector< VHierarchyNode > VHierarchyNodeContainer
Container for vertex hierarchy nodes.
Definition: VHierarchyNode.hh:178
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:56
Base class for all handle types.
Definition: Handles.hh:60
std::vector< VHierarchyNodeHandle > VHierarchyNodeHandleContainer
Container for vertex hierarchy node handles.
Definition: VHierarchyNode.hh:181
VHierarchyNodeHandle lchild_handle()
Returns handle to left child.
Definition: VHierarchyNode.hh:106
std::list< VHierarchyNodeHandle > VHierarchyNodeHandleList
Container for vertex hierarchy node handles.
Definition: VHierarchyNode.hh:184
Handle for a vertex entity.
Definition: Handles.hh:114
bool is_leaf() const
Returns true, if node is leaf else false.
Definition: VHierarchyNode.hh:99
bool is_root() const
Returns true, if node is root else false.
Definition: VHierarchyNode.hh:95
Handle for vertex hierarchy nodes.
Definition: VHierarchyNode.hh:75