60 #define ACG_SMARTTAGGERT_C
64 #include "SmartTaggerT.hh"
75 template <
class Mesh,
class EHandle,
class EPHandle>
80 tag_range_(_tag_range)
83 mesh_.add_property(ep_tag_);
93 template <
class Mesh,
class EHandle,
class EPHandle>
97 mesh_.remove_property(ep_tag_);
104 template <
class Mesh,
class EHandle,
class EPHandle>
109 unsigned int max_uint = std::numeric_limits<unsigned int>::max();
111 if( current_base_ < max_uint - 2*tag_range_)
112 current_base_ += tag_range_;
116 #ifdef STV_DEBUG_CHECKS
117 std::cerr <<
"Tagging Overflow occured...\n";
128 template <
class Mesh,
class EHandle,
class EPHandle>
133 set_tag_range(_new_tag_range);
139 template <
class Mesh,
class EHandle,
class EPHandle>
142 set_tag (
const EHandle _eh,
unsigned int _tag)
144 #ifdef STV_DEBUG_CHECKS
145 if( _tag > tag_range_)
146 std::cerr <<
"ERROR in set_tag tag range!!!\n";
149 mesh_.property(ep_tag_, _eh) = current_base_ + _tag;
156 template <
class Mesh,
class EHandle,
class EPHandle>
161 unsigned int t = mesh_.property(ep_tag_, _eh);
163 #ifdef STV_DEBUG_CHECKS
164 if( t > current_base_ + tag_range_)
165 std::cerr <<
"ERROR in get_tag tag range!!!\n";
168 if( t<= current_base_)
return 0;
169 else return t-current_base_;
176 template <
class Mesh,
class EHandle,
class EPHandle>
181 return bool(get_tag(_eh));
188 template <
class Mesh,
class EHandle,
class EPHandle>
193 if( _tag_range <= tag_range_)
196 tag_range_ = _tag_range;
200 tag_range_ = _tag_range;
209 template <
class Mesh,
class EHandle,
class EPHandle>
215 for(
unsigned int i=0; i<mesh_.property(ep_tag_).n_elements(); ++i)
217 mesh_.property(ep_tag_)[i] = 0;
bool is_tagged(const EHandle _eh) const
overloaded member for boolean tags
Namespace providing different geometric functions concerning angles.
void set_tag_range(const unsigned int _tag_range)
set new tag range and untag_all
~SmartTaggerT()
Destructor.
unsigned int get_tag(const EHandle _eh) const
get tag value in range [0..tag_range]
SmartTaggerT(Mesh &_mesh, unsigned int _tag_range=1)
Constructor.
void untag_all()
untag all elements
void set_tag(const EHandle _eh, unsigned int _tag=1)
set tag to a value in [0..tag_range]