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
bool is_leaf() const
Returns true, if node is leaf else false.
bool is_valid() const
The handle is valid iff the index is not equal to -1.
int idx() const
Get the underlying index of this handle.
Base class for all handle types.
Handle for a vertex entity.
VHierarchyNodeHandle rchild_handle()
Returns handle to right child.
std::list< VHierarchyNodeHandle > VHierarchyNodeHandleList
Container for vertex hierarchy node handles.
VHierarchyNodeHandle parent_handle()
Returns parent handle.
VHierarchyNodeHandle lchild_handle()
Returns handle to left child.
std::vector< VHierarchyNode > VHierarchyNodeContainer
Container for vertex hierarchy nodes.
bool is_root() const
Returns true, if node is root else false.
std::vector< VHierarchyNodeHandle > VHierarchyNodeHandleContainer
Container for vertex hierarchy node handles.