1 | #ifndef ABSTRACTELEMENTDEFINITION_SEEN |
---|
2 | #define ABSTRACTELEMENTDEFINITION_SEEN |
---|
3 | |
---|
4 | #include <iostream> |
---|
5 | #include <sstream> |
---|
6 | #include <string> |
---|
7 | |
---|
8 | #include "mathematicalTools.h" |
---|
9 | #include "nomdElements.h" |
---|
10 | |
---|
11 | using namespace std; |
---|
12 | |
---|
13 | |
---|
14 | class abstractElement |
---|
15 | { |
---|
16 | |
---|
17 | protected: |
---|
18 | |
---|
19 | bool parmelaOk_; |
---|
20 | bool transportOk_; |
---|
21 | |
---|
22 | int nbParam_; |
---|
23 | string* parametersString_; |
---|
24 | |
---|
25 | |
---|
26 | |
---|
27 | // double phaseStep_; // a recuperer dans les parametres globaux (methode setPhaseStep) |
---|
28 | double phaseStepMax_; |
---|
29 | |
---|
30 | double defaultLength_; |
---|
31 | double defaultAperture_; |
---|
32 | |
---|
33 | |
---|
34 | |
---|
35 | string label_; |
---|
36 | nomdElement elementName_; |
---|
37 | double lenghtElem_; // cm |
---|
38 | double aperture_; // cm |
---|
39 | |
---|
40 | double stepmaxcm_; |
---|
41 | // bool curvedTrajectory_; |
---|
42 | |
---|
43 | void setDefaultValues() |
---|
44 | { |
---|
45 | label_ = ""; |
---|
46 | nbParam_ = 2; |
---|
47 | defaultLength_ = 0.0; |
---|
48 | defaultAperture_ = 1.e+6; |
---|
49 | phaseStepMax_ = 10.; |
---|
50 | } |
---|
51 | |
---|
52 | |
---|
53 | void setDefaults() |
---|
54 | { |
---|
55 | lenghtElem_ = defaultLength_; |
---|
56 | aperture_ = defaultAperture_; |
---|
57 | parmelaOk_ = false; |
---|
58 | transportOk_ = false; |
---|
59 | } |
---|
60 | |
---|
61 | public : |
---|
62 | |
---|
63 | |
---|
64 | abstractElement() |
---|
65 | { |
---|
66 | label_ = string(""); |
---|
67 | setDefaultValues(); |
---|
68 | setDefaults(); |
---|
69 | stepmaxcm_ = 1000000; |
---|
70 | // curvedTrajectory_ = false; |
---|
71 | } |
---|
72 | |
---|
73 | |
---|
74 | abstractElement(string lab) |
---|
75 | { |
---|
76 | label_ = lab; |
---|
77 | setDefaultValues(); |
---|
78 | setDefaults(); |
---|
79 | stepmaxcm_ = 1000000; |
---|
80 | // curvedTrajectory_ = false; |
---|
81 | } |
---|
82 | |
---|
83 | virtual ~abstractElement() {if (parametersString_ != NULL) delete [] parametersString_ ;} |
---|
84 | |
---|
85 | virtual void setPhaseStep(double ) { cout << " setPhaseStep : ce n'est pas celui la qu'il faut ! " ; return;} |
---|
86 | |
---|
87 | |
---|
88 | void setParameters(double ll, double aper) |
---|
89 | { |
---|
90 | lenghtElem_ = ll; |
---|
91 | aperture_ = aper; |
---|
92 | } |
---|
93 | |
---|
94 | virtual void setParametersString(string* param) = 0; |
---|
95 | |
---|
96 | string getLabel() const |
---|
97 | { |
---|
98 | return label_; |
---|
99 | } |
---|
100 | |
---|
101 | |
---|
102 | nomdElement getName() const |
---|
103 | { |
---|
104 | return elementName_; |
---|
105 | } |
---|
106 | |
---|
107 | |
---|
108 | double getLenghtOfElement() const { return lenghtElem_;} |
---|
109 | |
---|
110 | int getNbParams() const {return nbParam_;}; |
---|
111 | |
---|
112 | bool is_parmela_element() const {return parmelaOk_;}; |
---|
113 | bool is_transport_element() const {return transportOk_;}; |
---|
114 | |
---|
115 | virtual string* getParametersString() const = 0; |
---|
116 | |
---|
117 | |
---|
118 | virtual string parmelaOutputFlow() const =0; |
---|
119 | virtual string transportOutputFlow() const =0; |
---|
120 | |
---|
121 | |
---|
122 | virtual double getInitialKineticEnergy() const {return 0.0;} |
---|
123 | |
---|
124 | |
---|
125 | virtual string FileOutputFlow() const=0; |
---|
126 | virtual void FileInput(ifstream& ifs) = 0; |
---|
127 | |
---|
128 | }; |
---|
129 | |
---|
130 | |
---|
131 | |
---|
132 | #endif |
---|