LrOctree.h 1.91 KB
Newer Older
paps's avatar
paps committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/**
 * @brief OBJET : represente un octree pour la structure acceleratrice
 * @file LrOctree.h
 * @date Lundi 10 Mars 2008
 * @note 
 * @author Josselin Francois
 * @author Michael Nauge
 * @author Axel Richard
 * @author Hervé Souchaud
 * @author Emeric Verschuur
 * 
 * Ce fichier contient la classe qui gère la creation d'un octree
 */

#ifndef LROCTREE_H
#define LROCTREE_H

#include <list>
#include "LrVector.h"
paps's avatar
paps committed
20 21 22
#include "LrEntity.h"


paps's avatar
paps committed
23 24 25 26 27


class LrOctree
{
    private:
Emeric Verschuur's avatar
Emeric Verschuur committed
28 29
        typedef std::list<LrEntity *> LrEntityList;
        typedef std::list<LrOctree *> LrOctreeList;
paps's avatar
paps committed
30 31 32 33 34 35

        // data
        // ****
        const LrOctree *m_parent;
        LrVector m_pos;
        Real m_taille;
36
        LrEntityList m_listeObj;
37
        LrOctreeList m_listeOct;
paps's avatar
paps committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72

    public:
        // constructors and destructor
        // ***************************
    
        LrOctree();
        LrOctree(const LrOctree &source);
        LrOctree * clone() const;
        LrOctree(const LrOctree &parent, const LrVector &pos, const Real &taille);
    
        virtual ~LrOctree();
    
        // assignement operator(s)
        // ***********************
    
        LrOctree & operator = (const LrOctree &source);
    
        // comparison operator(s)
        // **********************
    
        friend bool operator == ( const LrOctree &lhs,  const LrOctree &rhs);
        friend bool operator != ( const LrOctree &lhs,  const LrOctree &rhs);
    
        // accessors
        // *********
    
        const LrOctree* getParent() const;
        void setParent(const LrOctree &parent);
    
        LrVector getPos() const;
        void setPos(const LrVector &pos);
    
        Real getTaille() const;
        void setTaille(const Real &taille);
    
73
        const LrOctree* getOctree(unsigned int index) const;
paps's avatar
paps committed
74 75
        void addOctree(LrOctree *oct);
    
paps's avatar
paps committed
76
        void addObjet (LrEntity *obj);
77
        LrEntity* getObject(unsigned int index) const;
paps's avatar
paps committed
78 79 80 81

};

#endif