50 #ifndef OPENMESH_VDPROGMESH_VHIERARCHYWINDOWS_HH
51 #define OPENMESH_VDPROGMESH_VHIERARCHYWINDOWS_HH
56 #include <OpenMesh/Tools/VDPM/VHierarchy.hh>
80 unsigned char *buffer_;
91 unsigned char n_shift_;
93 unsigned char flag8(
unsigned char n_shift)
const
94 {
return 0x80 >> n_shift; }
98 assert(_node_handle.
idx() >= 0);
99 return 0x80 >> (
unsigned int) (_node_handle.
idx() % 8);
103 assert(_node_handle.
idx() >= 0);
104 return _node_handle.
idx() / 8;
107 {
return byte_idx(_node_handle) - buffer_min_; }
110 {
return (_node_handle.
idx()/8 < window_min_) ? true :
false; }
113 {
return (_node_handle.
idx()/8 < window_max_) ? false :
true; }
116 {
return (_node_handle.
idx()/8 < buffer_min_) ? true :
false; }
119 {
return (_node_handle.
idx()/8 <
int(buffer_max_) ) ? false :
true; }
128 void set_vertex_hierarchy(
VHierarchy &_vhierarchy)
129 { vhierarchy_ = &_vhierarchy; }
133 int new_window_min = window_min_;
134 for (current_pos_=window_min_-buffer_min_;
135 current_pos_ < window_size(); ++current_pos_)
137 if (buffer_[current_pos_] == 0)
142 while ((buffer_[current_pos_] & flag8(n_shift_)) == 0)
147 window_min_ = new_window_min;
159 while (current_pos_ < window_max_-buffer_min_)
161 if (buffer_[current_pos_] != 0)
163 while (n_shift_ != 8)
165 if ((buffer_[current_pos_] & flag8(n_shift_)) != 0)
174 bool end() {
return !(current_pos_ < window_max_-buffer_min_); }
176 int window_size()
const {
return window_max_ - window_min_; }
177 size_t buffer_size()
const {
return buffer_max_ - buffer_min_; }
186 update_buffer(_node_handle);
187 buffer_[buffer_idx(_node_handle)] |= flag8(_node_handle);
188 window_min_ = std::min(window_min_, byte_idx(_node_handle));
189 window_max_ = std::max(window_max_, 1+byte_idx(_node_handle));
195 if (is_active(_node_handle) !=
true)
return;
196 buffer_[buffer_idx(_node_handle)] ^= flag8(_node_handle);
202 if (before_window(_node_handle) ==
true ||
203 after_window(_node_handle) ==
true)
205 return ((buffer_[buffer_idx(_node_handle)] & flag8(_node_handle)) > 0);
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
std::vector< VHierarchyNodeHandle > VHierarchyNodeHandleContainer
Container for vertex hierarchy node handles.
Definition: VHierarchyNode.hh:183
int idx() const
Get the underlying index of this handle.
Definition: Handles.hh:69
Keeps the vertex hierarchy build during analyzing a progressive mesh.
Definition: VHierarchy.hh:74
Handle for vertex hierarchy nodes
Definition: VHierarchyNode.hh:78
Definition: VHierarchyWindow.hh:73