CellHandle.hh
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // CLASS CellHandle
4 //
5 // Handle to access octree cells.
6 //
7 //=============================================================================
8 
9 #ifndef OCTREE_CELLHANDLE_HH
10 #define OCTREE_CELLHANDLE_HH
11 
12 //=============================================================================
13 
14 namespace lvr2 {
15 
16 //=============================================================================
17 
23 {
24 public:
25  explicit CellHandle( int _idx = -8 )
26  : idx_( _idx )
27  {}
28 
29  int idx() const { return idx_; }
30  void idx( int _idx ) { idx_ = _idx; }
31 
32  bool is_valid() const { return idx_ >= 0; }
33  bool is_invalid() const { return idx_ < 0; }
34 
35  void reset() { idx_ = -8; }
36 
37  bool operator==( const CellHandle & _other ) const
38  { return idx_ == _other.idx_; }
39 
40  bool operator!=( const CellHandle & _other ) const
41  { return idx_ != _other.idx_; }
42 
43  bool operator<( const CellHandle & _other ) const
44  { return idx_ < _other.idx_; }
45 
46  void operator++() { __increment(); }
47 
48  void __increment() { ++idx_; }
49  void __decrement() { --idx_; }
50 
51 private:
52  int idx_;
53 };
54 
55 //=============================================================================
56 } // namespace lvr2
57 //=============================================================================
58 #endif // OCTREE_CELLHANDLE_HH defined
59 //=============================================================================
lvr2::CellHandle::idx
void idx(int _idx)
Definition: CellHandle.hh:30
lvr2::CellHandle::operator==
bool operator==(const CellHandle &_other) const
Definition: CellHandle.hh:37
lvr2::CellHandle::operator++
void operator++()
Definition: CellHandle.hh:46
lvr2::CellHandle::reset
void reset()
Definition: CellHandle.hh:35
lvr2::CellHandle::__decrement
void __decrement()
Definition: CellHandle.hh:49
lvr2::CellHandle::operator<
bool operator<(const CellHandle &_other) const
Definition: CellHandle.hh:43
lvr2::CellHandle::is_invalid
bool is_invalid() const
Definition: CellHandle.hh:33
lvr2::CellHandle::idx
int idx() const
Definition: CellHandle.hh:29
lvr2::CellHandle::CellHandle
CellHandle(int _idx=-8)
Definition: CellHandle.hh:25
lvr2::CellHandle::operator!=
bool operator!=(const CellHandle &_other) const
Definition: CellHandle.hh:40
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::CellHandle::idx_
int idx_
Definition: CellHandle.hh:52
lvr2::CellHandle::is_valid
bool is_valid() const
Definition: CellHandle.hh:32
lvr2::CellHandle::__increment
void __increment()
Definition: CellHandle.hh:48
lvr2::CellHandle
Definition: CellHandle.hh:22


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:23