Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/lib/graphics/spatial_separation/quadtree_node.h @ 4887

Last change on this file since 4887 was 4887, checked in by patrick, 19 years ago

orxonox/trunk: center now gets calculated correctly, some nicer debug output

File size: 2.3 KB
Line 
1/*!
2    \file proto_class.h
3 *  Definition of ...
4
5 */
6
7#ifndef _QUADTREE_NODE_H
8#define _QUADTREE_NODE_H
9
10#include "base_object.h"
11#include "vector.h"
12#include "abstract_model.h"
13
14// FORWARD DEFINITION
15class Quadtree;
16
17
18//! A class for a Quadtree Node representation
19class QuadtreeNode : public BaseObject {
20
21  public:
22    QuadtreeNode(sTriangleExt** triangles, int numTriangles,
23                 const float* pVertices, int numVertices, Quadtree* quadtree);
24    QuadtreeNode(modelInfo* pModelInfo);
25    virtual ~QuadtreeNode();
26
27    void separateNode(int treeDepth, const int maxDepth);
28    void separateNode(float minLength);
29    void separateNode();
30
31    void drawTree(int depth, int drawMode) const;
32
33
34  private:
35    void init();
36    Rectangle* getDimension(modelInfo* pModelInfo);
37    Rectangle* getDimension();
38
39  private:
40    Quadtree*                       quadtree;           //!< reference to the quadtree
41    Vector                          center;             //!< center coordinate of the quadtree node - relative coordinates in model space(!)
42    float                           axisLength;         //!< axis length of the quadtree
43    float                           maxHeigth;          //!< max height of the model in the quadtree
44    float                           offset;             //!< offset of the actual quadtree rectangle
45
46    int                             treeDepth;          //!< the depth of the tree
47
48    sTriangleExt**                  pTriangles;         //!< reference to the triangles of the node
49    const float*                    pVertices;          //!< reference to vertices data
50    unsigned int                    numTriangles;       //!< number of triangles of the Node
51    unsigned int                    numVertices;        //!< number of vertices of the node
52    modelInfo*                      pModelInfo;         //!< reference to the modelInfo of the object
53    Rectangle*                      pDimension;         //!< pointer to the local rectangle properties
54
55    QuadtreeNode*                   nodeA;              //!< reference to the node A
56    QuadtreeNode*                   nodeB;              //!< reference to the node B
57    QuadtreeNode*                   nodeC;              //!< reference to the node C
58    QuadtreeNode*                   nodeD;              //!< reference to the node D
59
60};
61
62#endif /* _QUADTREE_NODE_H */
Note: See TracBrowser for help on using the repository browser.