Computer Assisted Medical Intervention Tool Kit  version 5.2
Loads.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2024 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef LOADS_H
27 #define LOADS_H
28 
29 #include "Load.h"
30 #include "ValueEvent.h"
31 #include "Direction.h"
32 
33 #include <vector>
34 
71 class Loads {
72 
73 public:
75  Loads() = default;
76 
78  Loads(std::string);
79 
81  ~Loads();
82 
84  void addLoad(Load* ld);
85 
87  Load* getLoad(const unsigned int i) const;
88 
90  void deleteLoad(const unsigned int i);
91 
93  unsigned int numberOfLoads() const;
94 
98  friend std::ostream& operator << (std::ostream&, const Loads);
99 
102  void xmlRead(std::string filename);
103 
105  void xmlPrint(std::ostream&) const;
106 
108  void ansysPrint(std::ostream&) const;
109 
113  double getFirstEventDate();
114 
118  double getLastEventDate();
119 
121  static const char* VERSION;
122 
123 private:
125  std::vector <Load*> loads;
126 
127 };
128 
129 
130 #endif //LOADS_H
Class that describes a load to be used in the simulation.
Definition: Load.h:53
This class makes it possible to manage a list of "Load".
Definition: Loads.h:71
void xmlPrint(std::ostream &) const
Print to an ostream.
Definition: Loads.cpp:187
void ansysPrint(std::ostream &) const
Print the load list in ansys format (BEWARE: not everything is implemented)
Definition: Loads.cpp:206
friend std::ostream & operator<<(std::ostream &, const Loads)
print to an output stream in XML format.
Definition: Loads.cpp:225
Load * getLoad(const unsigned int i) const
get a load by its index in the list
Definition: Loads.cpp:249
void deleteLoad(const unsigned int i)
delete a load and remove it from the list using its index
Definition: Loads.cpp:264
void addLoad(Load *ld)
add a load to the list
Definition: Loads.cpp:244
double getLastEventDate()
get the last event date present in the list of loads
Definition: Loads.cpp:297
Loads()=default
default constructor
double getFirstEventDate()
get the first event date present in the list of loads
Definition: Loads.cpp:272
unsigned int numberOfLoads() const
get the number of "Load" stored in the list
Definition: Loads.cpp:259
void xmlRead(std::string filename)
read the input xml file using xsd and instantiate the loads
Definition: Loads.cpp:70
~Loads()
destructor
Definition: Loads.cpp:55
static const char * VERSION
current version of the library
Definition: Loads.h:121