FAbstractCell.hpp 2.89 KB
Newer Older
1
// ===================================================================================
2 3 4 5 6 7 8 9
// Logiciel initial: ScalFmm Version 0.5
// Co-auteurs : Olivier Coulaud, Bérenger Bramas.
// Propriétaires : INRIA.
// Copyright © 2011-2012, diffusé sous les termes et conditions d’une licence propriétaire.
// Initial software: ScalFmm Version 0.5
// Co-authors: Olivier Coulaud, Bérenger Bramas.
// Owners: INRIA.
// Copyright © 2011-2012, spread under the terms and conditions of a proprietary license.
10
// ===================================================================================
11 12
#ifndef FABSTRACTCELL_HPP
#define FABSTRACTCELL_HPP
13

14

15
#include "../Utils/FGlobal.hpp"
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FAbstractCell
* @brief
* Please read the license
*
* This class define the method that every cell class
* has to implement.
*
* In fact FOctree & FFmmAlgorithm need this function to be implemented.
* But you cannot use this interface with the extension (as an example :
* because the compiler will faill to know if getMortonIndex is coming
* from this interface or from the extension)
*
* @warning Inherite from this class when implement a specific cell type
*/
class FAbstractCell{
public:	
35 36 37
    /** Default destructor */
    virtual ~FAbstractCell(){
    }
38

39
    /**
40
        * Must be implemented by each user Cell class
41 42 43
 * @return the position of the current cell
 */
    virtual MortonIndex getMortonIndex() const = 0;
44 45


46
    /**
47 48 49
        * Must be implemented by each user Cell class
        * @param inIndex the position of the current cell
        */
50
    virtual void setMortonIndex(const MortonIndex inIndex) = 0;
51

52
    /**
53 54 55
        * Must be implemented by each user Cell class
        * @param inPosition the position of the current cell
        */
56
    virtual void setPosition(const F3DPosition& inPosition) = 0;
57

58 59 60 61
    /**
    * Must be implemented by each user Cell class
    * @return the position in the tree coordinate
    */
62
    virtual const FTreeCoordinate& getCoordinate() const = 0;
63 64 65 66 67 68 69 70

    /**
    * Must be implemented by each user Cell class
    * @param the position in the tree coordinate
    */
    virtual void setCoordinate(const long inX, const long inY, const long inZ) = 0;

    /** Because the system can run in Tsm mode
71 72 73
          * a cell has to express if it has sources
          * @return true if there are sources particles inside
          */
74
    virtual bool hasSrcChild() const = 0;
75

76
    /** Because the system can run in Tsm mode
77 78 79
          * a cell has to express if it has targets
          * @return true if there are targets particles inside
          */
80
    virtual bool hasTargetsChild() const = 0;
81

82
    /**
83 84
          * This function make the cell containing sources
          */
85
    virtual void setSrcChildTrue() = 0;
86

87
    /**
88 89
          * This function make the cell containing targets
          */
90
    virtual void setTargetsChildTrue() = 0;
91 92 93 94 95
};


#endif //FABSTRACTCELL_HPP

96