9 #ifndef INC_KURUSVIEW_MCELL_H 10 #define INC_KURUSVIEW_MCELL_H 19 #include "MMaterial.h" 28 static unsigned long int MCellInstanceCount;
42 explicit MCell(std::vector<std::shared_ptr<MVector>> vertices, std::shared_ptr<MMaterial> material,
long int id);
177 friend std::ofstream &
operator<<(std::ofstream &os,
const MCell &mCell);
201 double getID()
const;
215 std::vector<std::string>
getType()
const;
233 std::vector<std::shared_ptr<MVector>>
getVertices()
const;
256 void setMaterial(std::shared_ptr<MMaterial> material);
262 void setVertices(std::vector<std::shared_ptr<MVector>> vertices);
266 #endif //INC_KURUSVIEW_MCELL_H Header file for MVector class.
friend std::ostream & operator<<(std::ostream &os, const MCell &mCell)
Unsure if useful. should perform deep (not shallow) copy to avoid accidental freeing.
Definition: MCell.cpp:116
MCellType_TypeDef
Definition: MCell.h:115
const std::vector< unsigned int > & getVertexIndices()
getVertexIndices (accessor)
Definition: MCell.cpp:144
std::shared_ptr< MVector > getCentreOfGrav() const
get MCellCOG (accessor)
Definition: MCell.cpp:35
MCell()=delete
default constructor - deleted
std::vector< std::string > getType() const
get MCellType (accessor)
Definition: MCell.cpp:68
virtual double calcWeight() const =0
calculates weight of the cell
std::shared_ptr< MMaterial > getMaterial() const
get MCellMaterial (accessor)
Definition: MCell.cpp:43
void setVertices(std::vector< std::shared_ptr< MVector >> vertices)
set MCellMaterial accesor
Definition: MCell.cpp:60
std::shared_ptr< MMaterial > MCellMaterial
holds a the material of the cell
Definition: MCell.h:99
const long int MCellID
MCellDensity - stores the density of the cell, , can not be set by accessors.
Definition: MCell.h:68
double MCellWeight
MCellWeight - stores the weight of the cell, can not be set by accessors.
Definition: MCell.h:65
MCell - Interface (abstract) class for all the cell shapes.
Definition: MCell.h:24
std::shared_ptr< MVector > MCellCOG
holds the Centre Of Gravity of the cell as a shared pointer MVector
Definition: MCell.h:106
std::vector< std::shared_ptr< MVector > > getVertices() const
get MCellVertices (accessor)
Definition: MCell.cpp:47
std::vector< unsigned int > vertexIDs
holds a list of all the vertices IDs, populated on construction
Definition: MCell.h:96
virtual double calcVolume() const =0
calculates volume of the cell
~MCell()
destructor - decrements InstanceCount
Definition: MCell.cpp:23
virtual std::shared_ptr< MVector > calcCentreOfGrav() const =0
calculates centre of gravity of the cell
double getVolume() const
get MCellVolume (accessor)
Definition: MCell.cpp:27
double getID() const
get MCellID (accessor)
Definition: MCell.cpp:39
double getWeight() const
get MCellWeight (accessor)
Definition: MCell.cpp:31
MCellType_TypeDef MCellType
MCellType - holds the type of the current cell.
Definition: MCell.h:124
static double getCount()
get MCellInstanceCount (accessor)
Definition: MCell.cpp:51
std::vector< std::shared_ptr< MVector > > MCellVertices
holds a vector of MVectors defining the vertex of the cell
Definition: MCell.h:76
void setMaterial(std::shared_ptr< MMaterial > material)
set MCellMaterial accesor
Definition: MCell.cpp:56
double MCellVolume
MCellVolume - stores the volume of the cell, can not be set by accessors.
Definition: MCell.h:62