GlobeEngine
KPatchBintreeNode.h
Go to the documentation of this file.
1 
8 #ifndef GlobeEngine_Raster_KPatchbintreeNode_h
9 #define GlobeEngine_Raster_KPatchbintreeNode_h
10 
11 #include "DrawableComponent.h"
12 #include "KPatchBase.h"
13 #include "OpenGL_Includes.h"
14 #include "BoundingSphere.h"
16 #include <bitset>
17 
18 namespace geRaster {
19 
20  class KPatchBintree;
21 
23  {
24  public:
27  void clear();
28  void create();
29  void create(int uid,
31  vmml::Vector2d zeropoint,
32  double _edgelength,
33  int parent,
35  short _lod,
36  bool _childOrder,
37  std::bitset<40> _parentAdress);
38  void update();
39  bool pointIsInside(const vmml::Vector3d& _pos);
40  void computeBound();
41 
42  GLubyte getColStepIndex() const { return colStepIndex; }
43  float getColStep() const { return colStep; }
44  const double* getZeropoint() const { return zeropoint; }
45 
48 
49  int getMBlockReference() const;
50  void setMBlockReference(int _refID);
51 
52  short getRootID() const;
53  void setRootID(short _rootID);
54 
55  int getPatchSize() const;
57 
59 
60  void print() {
62  std::cout << this->mblock_ref << " | ";
63  std::cout << this->patchSize << " | ";
64  std::cout << this->colStepIndex << " | ";
65  std::cout << this->colStep << " | ";
66  std::cout << this->zeropoint[0] << " , ";
67  std::cout << this->zeropoint[1] << " | ";
68  std::cout << this->saturatedError << " | ";
69  std::cout << std::endl;
70  }
71 
72  const std::bitset<40> getAdress() const;
73 
74  private:
75  ge::BoundingSphere* boundingSphere;
76  int mblock_ref;
77 
78  short patchSize;
79  GLubyte colStepIndex;
80  float colStep;
81  double zeropoint[2];
82 
85 
86  /* the saturated error is the information about how far and how detailed
87  * a bintree node needs to be.
88  * 0 means that the points lies inside this node, values
89  * 0 - dist means gives back the error based on the maximum error = 1
90  * > dist mean, that this values are not shown at all and can be deleted while next
91  * garbarge collection round
92  */
93  double saturatedError;
94 
95  // bitset indexing (and print out) is inverse from back to front!
96  std::bitset<40> adress;
97  short rootAdress;
98  };
99 }
100 #endif
101 
int getPatchSize() const
Definition: KPatchBintreeNode.cpp:181
KPatchBase::PatchOrientation getType() const
Definition: KPatchBintreeNode.cpp:171
Definition: GeometricBalancedArrayTreeNode.h:13
~KPatchBintreeNode()
Definition: KPatchBintreeNode.cpp:14
const std::bitset< 40 > getAdress() const
Definition: KPatchBintreeNode.cpp:213
int getPatchSizeForMode(KPatchBase::PatchMode _mode) const
Definition: KPatchBintreeNode.cpp:186
void setRootID(short _rootID)
Definition: KPatchBintreeNode.cpp:221
Definition: KPatchBase.h:13
const double * getZeropoint() const
Definition: KPatchBintreeNode.h:44
void update()
Definition: KPatchBintreeNode.cpp:73
void setMBlockReference(int _refID)
Definition: KPatchBintreeNode.cpp:204
void create()
Definition: KPatchBintreeNode.cpp:32
KPatchBintreeNode()
Definition: KPatchBintreeNode.cpp:7
void print()
Definition: KPatchBintreeNode.h:60
const ge::BoundingSphere * getBoundingSphere() const
Definition: KPatchBintreeNode.cpp:208
void print()
Definition: GeometricBalancedArrayTreeNode.h:141
float getColStep() const
Definition: KPatchBintreeNode.h:43
void setType(KPatchBase::PatchOrientation _type)
Definition: KPatchBintreeNode.cpp:176
int getMBlockReference() const
Definition: KPatchBintreeNode.cpp:200
short getRootID() const
Definition: KPatchBintreeNode.cpp:217
PatchOrientation
Definition: KPatchBase.h:20
void clear()
Definition: KPatchBintreeNode.cpp:19
void computeBound()
Definition: KPatchBintreeNode.cpp:78
PatchMode
Definition: KPatchBase.h:21
bool pointIsInside(const vmml::Vector3d &_pos)
Definition: KPatchBintreeNode.cpp:143
GLubyte getColStepIndex() const
Definition: KPatchBintreeNode.h:42
Definition: KPatchBintreeNode.h:22
Definition: BoundingSphere.h:19