Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 21, 2005, 4:46:41 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: the last cleanups, now the classes look better

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/graphics/spatial_separation/quadtree.h

    r4922 r4924  
    11/*!
    22    \file quadtree.h
    3   *  Definition of a spatial data separation using quadtree
     3 *  Definition of a spatial data separation using quadtree
    44
    5 */
     5  This is the top element of the quadtree framework. A Quadtree is build of QuadtreeNodes, which are again separated
     6  into QuadtreeNodes until a certain depth is reached
     7 */
    68
    79#ifndef _QUADTREE_H
     
    2022class Quadtree : public BaseObject {
    2123
    22  public:
    23   Quadtree(modelInfo* pModelInfo, const int treeDepth);
    24   virtual ~Quadtree();
    2524
    26   QuadtreeNode* getQuadtreeFromPosition(const Vector& position);
     25  public:
     26    Quadtree(modelInfo* pModelInfo, const int treeDepth);
     27    virtual ~Quadtree();
    2728
    28   void drawTree() const;
    29   inline Material* getMaterial(int indexNode) const { return this->materials[indexNode % 4]; }
     29    QuadtreeNode* getQuadtreeFromPosition(const Vector& position);
     30
     31    void drawTree() const;
     32    inline Material* getMaterial(int indexNode) const { return this->materials[indexNode % 4]; }
     33
    3034
    3135  private:
     
    3337    void sortHashTable(QuadtreeNode** nodes);
    3438
    35  private:
    36    QuadtreeNode*                   rootNode;              //!< reference to the root node of the quadtree
    37    modelInfo*                      pModelInfo;            //!< reference to the modelInfo of the object
    38    int                             treeDepth;             //!< depth of the tree
    3939
    40    float                           quadLength;            //!< length of the leaf quadtree nodes
    41    Vector*                         offset;                //!< vector to the left lower corner of the root quadtree node
    42    int                             maxIndex;              //!< maximal index for the nodes array
     40  private:
     41    QuadtreeNode*                   rootNode;              //!< reference to the root node of the quadtree
     42    QuadtreeNode**                  nodes;                 //!< reference to all quadtree nodes (only leafs of the quad tree)
     43    modelInfo*                      pModelInfo;            //!< reference to the modelInfo of the object
     44    int                             treeDepth;             //!< depth of the tree
    4345
    44    Material**                      materials;             //!< materials for debug drawing purposes
     46    float                           quadLength;            //!< length of the leaf quadtree nodes
     47    Vector*                         offset;                //!< vector to the left lower corner of the root quadtree node
     48    int                             maxIndex;              //!< maximal index for the nodes array
    4549
    46    QuadtreeNode**                  nodes;                 //!< reference to all quadtree nodes (only leafs of the quad tree)
     50    Material**                      materials;             //!< materials for debug drawing purposes
    4751};
    4852
Note: See TracChangeset for help on using the changeset viewer.