KurusView  1.0
MModel.h
1 #ifndef INC_KURUSVIEW_MMODEL_H
2 #define INC_KURUSVIEW_MMODEL_H
3 
4 #include <vector>
5 #include <string>
6 #include "MCell.h"
7 #include "MMaterial.h"
8 #include "MVector.h"
9 
13 class MModel {
14 private:
16  std::vector<MVector> vectors;
18  std::vector<std::shared_ptr<MMaterial>> materials;
19 
20 
21 public:
25  MModel() = default;
26 
31  explicit MModel(const std::string &filePath);
32 
36  ~MModel() = default;
37 
42  void loadModel(const std::string &filePath);
43 
48  void saveModel(const std::string &filePath);
49 
50 
54  void displayVertexCount();
55 
59  size_t getCellCount();
60 
66 
71  double calcVolume();
72 
77  double calcWeight();
78 
79  std::string fileType;
80 
81  std::string filePath;
82 
84  std::vector<std::shared_ptr<MCell>> cells;
85 
86  std::vector<std::shared_ptr<MMaterial>> getMaterials();
87 
88  std::vector<MVector> getVectors();
89 
90  std::vector<std::shared_ptr<MCell>> getCells();
91 
92  size_t getVectorCount();
93 
94  size_t getMaterialCount();
95 };
96 
97 
98 #endif //INC_KURUSVIEW_MMODEL_H
double calcWeight()
calcWeight - Calculates the weight of the model
Definition: MModel.cpp:202
Header file for MVector class.
Header file for MCell base class.
~MModel()=default
~MModel - Default Destructor
size_t getCellCount()
getCellCount - Displays the number of cells and the type of each cell
Definition: MModel.cpp:176
MModel()=default
MModel - Default Constructor.
MModel - This object is responsible for reading and writing model entities to .mod data files...
Definition: MModel.h:13
void loadModel(const std::string &filePath)
loadModel - Loads a model from a VTK style data file
Definition: MModel.cpp:22
double calcVolume()
calcVolume - Calculates the volume of the model
Definition: MModel.cpp:194
std::vector< std::shared_ptr< MCell > > cells
cells - List of all the cells in the model
Definition: MModel.h:84
MVector calcCentre()
calcCentre - Calculates the centre of the model
Definition: MModel.cpp:181
Definition: MVector.h:19
void displayVertexCount()
displayVertexCount - Calculates the number of vertices and displays them
Definition: MModel.cpp:172
void saveModel(const std::string &filePath)
saveModel - Saves the currently loaded model to a VTK style data file
Definition: MModel.cpp:141