FAbstractLoader.hpp 1.59 KB
Newer Older
1 2
#ifndef FABSTRACTLOADER_HPP
#define FABSTRACTLOADER_HPP
3
// [--License--]
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

#include "../Utils/FGlobal.hpp"
class F3DPosition;

/**
* @author Berenger Bramas (berenger.bramas@inria.fr)
* @class FAbstractLoader
* Please read the license
*
* This class defined the FMB usual loader. A loader is the component
* that fills an octree.
*
* If you want to use a specific file format you then need to inherite from this loader
* and implemente several methods.
*
* Please look at FBasicLoader or FFmaLoader to see an example.
*
* @warning Inherite from this class when defining a loader class
*/
template <class ParticleClass>
class FAbstractLoader {
public:	
	/** Default destructor */
	virtual ~FAbstractLoader(){
	}

        /**
        * Get the number of particles for this simulation
        * @return number of particles that the loader can fill
        */
34
        virtual FSize getNumberOfParticles() const = 0;
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

        /**
        * Get the center of the simulation box
        * @return box center needed by the octree
        */
        virtual F3DPosition getCenterOfBox() const = 0;

        /**
        * Get the simulation box width
        * @return box width needed by the octree
        */
        virtual FReal getBoxWidth() const = 0;

        /**
        * To know if the loader is valide (file opened, etc.)
        * @return true if file is open
        */
52
        virtual bool isOpen() const = 0;
53 54 55 56 57

        /**
        * Fill the next particle
        * @param inParticle the particle to fill
        */
58
        virtual void fillParticle(ParticleClass& inParticle) = 0;
59 60 61 62 63
};


#endif //FABSTRACTLOADER_HPP

64
// [--END--]