LrOctree.h 1.94 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 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 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 73 74 75 76 77 78 79 80 81 82
/**
 * @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"
#include "LrObject.h"
#include "global.h"

using namespace std;

class LrOctree
{
    private:

        // data
        // ****
        const LrOctree *m_parent;
        LrVector m_pos;
        Real m_taille;
        list<LrObject *> m_listeObj;
        list<LrOctree *> m_listeOct;

    public:

        typedef list<LrObject *> LISTE_OBJETS;
        typedef list<LrOctree *> LISTE_OCTREES_SONS;
        // 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);
    
        const LrOctree* getOctree(int index) const;
        void addOctree(LrOctree *oct);
    
        void addObjet (LrObject *obj);
        LrObject* getObject(int index) const;

};

#endif