5 #ifndef VMML_GeometricBalancedArrayTreeNode_h
6 #define VMML_GeometricBalancedArrayTreeNode_h
12 template <
short TREESIZE,
class KEYTYPE,
short HALFTREESIZE>
29 std::cout << boundsIdx[1] <<
" ";
50 int stepSizeIdx = (
int)(
pow(2.0, _maxTreeDepth) /
pow(2.0, this->
key->getLod()));
64 bool inside( vmml::Vector2d _coord )
const {
65 double const x = _coord.x(), y = _coord.y();
74 assert(
inside( _coord ) );
79 double const childEdge = this->
edgelength * 0.5;
81 double const x = _coord.x(), y = _coord.y();
82 double const midX =
bounds[0] + childEdge, midY =
bounds[2] + childEdge;
86 if( x >= midX ) index |= 1;
87 if( y >= midY ) index |= 2;
92 if (_coord.x() >=
bounds[0] && _coord.x() <
bounds[0] + childEdge
93 && _coord.y() >=
bounds[2] && _coord.y() <
bounds[2] + childEdge)
97 else if (_coord.x() >=
bounds[0] + childEdge && _coord.x() <
bounds[1]
98 && _coord.y() >=
bounds[2] && _coord.y() <
bounds[2] + childEdge)
102 else if (_coord.x() >=
bounds[0] && _coord.x() <
bounds[0] + childEdge
103 && _coord.y() >=
bounds[2] + childEdge && _coord.y() <
bounds[3])
107 else if (_coord.x() >=
bounds[0] + childEdge && _coord.x() <
bounds[1]
108 && _coord.y() >=
bounds[2] + childEdge && _coord.y() <
bounds[3])
143 std::cout << this->
visible <<
" | ";
145 std::cout << this->
boundsIdx[0] <<
" , ";
146 std::cout << this->boundsIdx[1] <<
" | ";
147 std::cout << this->
bounds[0];
148 for (
int i = 1; i < 4; i++){
149 std::cout <<
"," << this->bounds[i];
void calculateMidpoint()
Definition: GeometricBalancedArrayTreeNode.h:159
void print()
Definition: BalancedArrayTreeNode.h:25
bool isVisible() const
Definition: GeometricBalancedArrayTreeNode.h:133
void setEdgelenght(double _edgelength)
Definition: GeometricBalancedArrayTreeNode.h:120
vmml::Vector2d midPoint
Definition: GeometricBalancedArrayTreeNode.h:167
~GeometricBalancedArrayTreeNode()
Definition: GeometricBalancedArrayTreeNode.h:25
expr pow(half base, half exp)
Definition: Half.h:2231
Definition: GeometricBalancedArrayTreeNode.h:13
GeometricBalancedArrayTreeNode()
Definition: GeometricBalancedArrayTreeNode.h:16
Definition: AvalancheTrainingSimulationEngine.h:39
typedef int(CALL_CONVENTION *func_type_com_asprise_ocr_setup)(bool)
bool visible
Definition: GeometricBalancedArrayTreeNode.h:169
virtual void printValue() const
Definition: GeometricBalancedArrayTreeNode.h:26
const GLuint * getBoundsIndex() const
Definition: GeometricBalancedArrayTreeNode.h:129
int children[TREESIZE]
Definition: ArrayTreeNode.h:169
vmml::Vector2d getOrigin() const
Definition: GeometricBalancedArrayTreeNode.h:54
vmml::Vector2d getMidpoint() const
Definition: GeometricBalancedArrayTreeNode.h:60
GLuint boundsIdx[2]
Definition: GeometricBalancedArrayTreeNode.h:166
std::shared_ptr< KEYTYPE > key
Definition: ArrayTreeNode.h:170
bool inside(vmml::Vector2d _coord) const
Definition: GeometricBalancedArrayTreeNode.h:64
GeometricBalancedArrayTreeNode< 4, geSpatial::CullableSpatialKey, 2 > GeometricBalancedArrayQuadTreeNode
Definition: GeometricBalancedArrayTreeNode.h:172
void print()
Definition: GeometricBalancedArrayTreeNode.h:141
void setBoundsIndex(GLuint _min_x, GLuint _min_y)
Definition: GeometricBalancedArrayTreeNode.h:124
void isVisible(bool _input)
Definition: GeometricBalancedArrayTreeNode.h:137
GeometricBalancedArrayTreeNode< 2, geSpatial::BinaryTreeKey, 1 > GeometricBalancedArrayBinTreeNode
Definition: GeometricBalancedArrayTreeNode.h:173
int locateChildIDForCoordinates(vmml::Vector2d _coord) const
Definition: GeometricBalancedArrayTreeNode.h:69
void setBounds(vmml::Vector4d _bound)
Definition: GeometricBalancedArrayTreeNode.h:37
void setBoundIndex(int _maxTreeDepth)
Definition: GeometricBalancedArrayTreeNode.h:47
double edgelength
Definition: GeometricBalancedArrayTreeNode.h:168
const double * getBounds() const
Definition: GeometricBalancedArrayTreeNode.h:32
vmml::Vector4d bounds
Definition: GeometricBalancedArrayTreeNode.h:165
Definition: BalancedArrayTreeNode.h:13
double getEdgelenght() const
Definition: GeometricBalancedArrayTreeNode.h:116