Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: again some very fundamental changes in the tree spawing algorithm. some strange effects left

File size: 2.6 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,
24                 Quadtree* quadtree, QuadtreeNode* parent,
25                 Rectangle* rect, int treeDepth, const int maxDepth);
26    QuadtreeNode(modelInfo* pModelInfo, const int maxDepth);
27    virtual ~QuadtreeNode();
28
29    void drawTree(int depth, int drawMode) const;
30
31
32  private:
33    void init();
34
35    void separateNode(int treeDepth, const int maxDepth);
36    void separateNode(float minLength);
37    void separateNode();
38
39    Rectangle* getDimFromModel();
40
41  protected:
42    QuadtreeNode*                   parent;             //!< reference to the paren QuadtreeNode (NULL if rootnode)
43    QuadtreeNode*                   nodeA;              //!< reference to the node A
44    QuadtreeNode*                   nodeB;              //!< reference to the node B
45    QuadtreeNode*                   nodeC;              //!< reference to the node C
46    QuadtreeNode*                   nodeD;              //!< reference to the node D
47
48  private:
49    Quadtree*                       quadtree;           //!< reference to the quadtree
50    Vector                          center;             //!< center coordinate of the quadtree node - relative coordinates in model space(!)
51    float                           axisLength;         //!< axis length of the quadtree
52    float                           maxHeigth;          //!< max height of the model in the quadtree
53    float                           offset;             //!< offset of the actual quadtree rectangle
54
55    int                             treeDepth;          //!< the depth of the tree
56    int                             maxDepth;           //!< the maximal depth of the tree
57
58    sTriangleExt**                  pTriangles;         //!< reference to the triangles of the node
59    const float*                    pVertices;          //!< reference to vertices data
60    unsigned int                    numTriangles;       //!< number of triangles of the Node
61    unsigned int                    numVertices;        //!< number of vertices of the node
62    modelInfo*                      pModelInfo;         //!< reference to the modelInfo of the object
63    Rectangle*                      pDimension;         //!< pointer to the local rectangle properties
64};
65
66#endif /* _QUADTREE_NODE_H */
Note: See TracBrowser for help on using the repository browser.