55 #ifndef OPENMESH_VDPROGMESH_VHIERARCHYNODE_HH
56 #define OPENMESH_VDPROGMESH_VHIERARCHYNODE_HH
64 #include <OpenMesh/Core/Geometry/VectorT.hh>
65 #include <OpenMesh/Core/Mesh/Handles.hh>
66 #include <OpenMesh/Tools/VDPM/VHierarchyNodeIndex.hh>
99 VHierarchyNode() :radius_(0.0f), sin_square_(0.0f),mue_square_(0.0f), sigma_square_(0.0f) { }
103 {
return (parent_handle_.
is_valid() ==
false) ?
true :
false; }
107 {
return (lchild_handle_.
is_valid() ==
false) ?
true :
false; }
120 { parent_handle_ = _parent_handle; }
122 void set_children_handle(VHierarchyNodeHandle _lchild_handle)
123 { lchild_handle_ = _lchild_handle; }
125 VertexHandle vertex_handle()
const {
return vh_; }
126 float radius()
const {
return radius_; }
128 float sin_square()
const {
return sin_square_; }
129 float mue_square()
const {
return mue_square_; }
130 float sigma_square()
const {
return sigma_square_; }
133 void set_radius(
float _radius) { radius_ = _radius; }
136 void set_sin_square(
float _sin_square) { sin_square_ = _sin_square; }
137 void set_mue_square(
float _mue_square) { mue_square_ = _mue_square; }
138 void set_sigma_square(
float _sigma_square) { sigma_square_ = _sigma_square; }
140 void set_semi_angle(
float _semi_angle)
141 {
float f=sinf(_semi_angle); sin_square_ = f*f; }
143 void set_mue(
float _mue) { mue_square_ = _mue * _mue; }
144 void set_sigma(
float _sigma) { sigma_square_ = _sigma * _sigma; }
146 const VHierarchyNodeIndex& node_index()
const {
return node_index_; }
147 const VHierarchyNodeIndex& fund_lcut_index()
const
148 {
return fund_cut_node_index_[0]; }
150 const VHierarchyNodeIndex& fund_rcut_index()
const
151 {
return fund_cut_node_index_[1]; }
153 VHierarchyNodeIndex& node_index()
154 {
return node_index_; }
156 VHierarchyNodeIndex& fund_lcut_index() {
return fund_cut_node_index_[0]; }
157 VHierarchyNodeIndex& fund_rcut_index() {
return fund_cut_node_index_[1]; }
159 void set_index(
const VHierarchyNodeIndex &_node_index)
160 { node_index_ = _node_index; }
162 void set_fund_lcut(
const VHierarchyNodeIndex &_node_index)
163 { fund_cut_node_index_[0] = _node_index; }
165 void set_fund_rcut(
const VHierarchyNodeIndex &_node_index)
166 { fund_cut_node_index_[1] = _node_index; }
176 VHierarchyNodeHandle parent_handle_;
177 VHierarchyNodeHandle lchild_handle_;
180 VHierarchyNodeIndex node_index_;
181 VHierarchyNodeIndex fund_cut_node_index_[2];
198 #endif // OPENMESH_VDPROGMESH_VHIERARCHYNODE_HH defined
Base class for all handle types.
Definition: Handles.hh:67
VectorT< float, 3 > Vec3f
3-float vector
Definition: Vector11T.hh:769
int idx() const
Get the underlying index of this handle.
Definition: Handles.hh:74
VHierarchyNodeHandle rchild_handle()
Returns handle to right child.
Definition: VHierarchyNode.hh:116
Handle for vertex hierarchy nodes.
Definition: VHierarchyNode.hh:82
Handle for a vertex entity.
Definition: Handles.hh:125
std::vector< VHierarchyNode > VHierarchyNodeContainer
Container for vertex hierarchy nodes.
Definition: VHierarchyNode.hh:185
std::list< VHierarchyNodeHandle > VHierarchyNodeHandleList
Container for vertex hierarchy node handles.
Definition: VHierarchyNode.hh:191
bool is_valid() const
The handle is valid iff the index is not equal to -1.
Definition: Handles.hh:77
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
VHierarchyNodeHandle parent_handle()
Returns parent handle.
Definition: VHierarchyNode.hh:110
VHierarchyNodeHandle lchild_handle()
Returns handle to left child.
Definition: VHierarchyNode.hh:113
std::vector< VHierarchyNodeHandle > VHierarchyNodeHandleContainer
Container for vertex hierarchy node handles.
Definition: VHierarchyNode.hh:188
Vertex hierarchy node.
Definition: VHierarchyNode.hh:95
bool is_leaf() const
Returns true, if node is leaf else false.
Definition: VHierarchyNode.hh:106
bool is_root() const
Returns true, if node is root else false.
Definition: VHierarchyNode.hh:102