BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
particles.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/ba3d/model/particles.h
6 //! @brief Defines Particle class
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_BA3D_MODEL_PARTICLES_H
16 #define BORNAGAIN_GUI_BA3D_MODEL_PARTICLES_H
17 
18 #include "GUI/ba3d/model/object.h"
19 
20 namespace GUI::RealSpace::Particles {
21 
22 enum class EShape {
23  BarGauss,
24  BarLorentz,
25  Bipyramid4,
26  Box,
28  Cone,
32  Cylinder,
35  Sphere,
36  Spheroid,
40  None,
43  Prism3,
44  Prism6,
45  Pyramid2,
46  Pyramid3,
47  Pyramid4,
48  Pyramid6,
55 };
56 
57 QString const& name(EShape);
58 
59 //------------------------------------------------------------------------------
60 
61 class Particle : public Object {
62 protected:
64  Vector3D turn; // turn before scale
65  Vector3D scale; // geometries are of 1-size (box 1x1x1, sphere D=1), need scaling
66  Vector3D offset; // geometries centered around origin; particles stand on z=0 plane
67  Vector3D rotate, translate; // remembered
68 
69  void set();
70 
71 public:
74 
76  void fancy(Vector3D rotate, float r);
77 
79  void addTranslation(Vector3D translate_);
80  void addExtrinsicRotation(Vector3D rotateExtrinsic);
81 };
82 
83 //------------------------------------------------------------------------------
84 
85 class Sphere : public Particle {
86 public:
87  Sphere(float R);
88 };
89 
90 class Spheroid : public Particle {
91 public:
92  Spheroid(float R, float H);
93 };
94 
95 class Cylinder : public Particle {
96 public:
97  Cylinder(float R, float H);
98 };
99 
100 class TruncatedSphere : public Particle {
101 public:
102  TruncatedSphere(float R, float H, float deltaH = 0.0f);
103 };
104 
105 class TruncatedSpheroid : public Particle {
106 public:
107  TruncatedSpheroid(float R, float H, float fp, float deltaH = 0.0f);
108 };
109 
110 class Cone : public Particle {
111 public:
112  Cone(float R, float H, float alpha);
113 };
114 
115 class Icosahedron : public Particle {
116 public:
117  Icosahedron(float L);
118 };
119 
120 class Dodecahedron : public Particle {
121 public:
122  Dodecahedron(float L);
123 };
124 
125 class TruncatedCube : public Particle {
126 public:
127  TruncatedCube(float L, float t);
128 };
129 
130 class Prism6 : public Particle {
131 public:
132  Prism6(float R, float H);
133 };
134 
135 class Pyramid6 : public Particle {
136 public:
137  Pyramid6(float R, float H, float alpha);
138 };
139 
140 class Pyramid4 : public Particle {
141 public:
142  Pyramid4(float L, float H, float alpha);
143 };
144 
145 class Bipyramid4 : public Particle {
146 public:
147  Bipyramid4(float L, float H, float rH, float alpha);
148 };
149 
150 class Prism3 : public Particle {
151 public:
152  Prism3(float L, float H);
153 };
154 
155 class Pyramid3 : public Particle {
156 public:
157  Pyramid3(float L, float H, float alpha);
158 };
159 
161 public:
162  EllipsoidalCylinder(float Ra, float Rb, float H);
163 };
164 
165 class BarGauss : public Particle {
166 public:
167  BarGauss(float L, float W, float H);
168 };
169 
170 class BarLorentz : public Particle {
171 public:
172  BarLorentz(float L, float W, float H);
173 };
174 
175 class Box : public Particle {
176 public:
177  Box(float L, float W, float H);
178 };
179 
180 class HemiEllipsoid : public Particle {
181 public:
182  HemiEllipsoid(float Ra, float Rb, float H);
183 };
184 
185 class CosineRippleBox : public Particle {
186 public:
187  CosineRippleBox(float L, float W, float H);
188 };
189 
190 class CosineRippleGauss : public Particle {
191 public:
192  CosineRippleGauss(float L, float W, float H);
193 };
194 
196 public:
197  CosineRippleLorentz(float L, float W, float H);
198 };
199 
200 class SawtoothRippleBox : public Particle {
201 public:
202  SawtoothRippleBox(float L, float W, float H);
203 };
204 
206 public:
207  SawtoothRippleGauss(float L, float W, float H);
208 };
209 
211 public:
212  SawtoothRippleLorentz(float L, float W, float H);
213 };
214 
215 class SawtoothRipple : public Particle {
216 public:
217  SawtoothRipple(float L, float W, float H, float asymmetry);
218 };
219 
220 class CantellatedCube : public Particle {
221 public:
222  CantellatedCube(float L, float t);
223 };
224 
225 class HorizontalCylinder : public Particle {
226 public:
227  HorizontalCylinder(float R, float L, float s_b, float s_t);
228 };
229 
230 class PlatonicOctahedron : public Particle {
231 public:
232  PlatonicOctahedron(float L);
233 };
234 
236 public:
237  PlatonicTetrahedron(float L);
238 };
239 
240 class Pyramid2 : public Particle {
241 public:
242  Pyramid2(float L, float W, float H, float alpha);
243 };
244 
245 } // namespace GUI::RealSpace::Particles
246 
247 #endif // BORNAGAIN_GUI_BA3D_MODEL_PARTICLES_H
A geometric object.
Definition: object.h:28
BarGauss(float L, float W, float H)
Definition: particles.cpp:120
BarLorentz(float L, float W, float H)
Definition: particles.cpp:130
Bipyramid4(float L, float H, float rH, float alpha)
Definition: particles.cpp:168
Box(float L, float W, float H)
Definition: particles.cpp:140
Cone(float R, float H, float alpha)
Definition: particles.cpp:150
CosineRippleBox(float L, float W, float H)
Definition: particles.cpp:271
CosineRippleGauss(float L, float W, float H)
Definition: particles.cpp:281
CosineRippleLorentz(float L, float W, float H)
Definition: particles.cpp:291
EllipsoidalCylinder(float Ra, float Rb, float H)
Definition: particles.cpp:196
HemiEllipsoid(float Ra, float Rb, float H)
Definition: particles.cpp:223
HorizontalCylinder(float R, float L, float s_b, float s_t)
Definition: particles.cpp:379
void transform(Vector3D rotate, Vector3D translate)
Definition: particles.cpp:72
static EShape const firstKind
Definition: particles.h:72
void addExtrinsicRotation(Vector3D rotateExtrinsic)
Definition: particles.cpp:93
void fancy(Vector3D rotate, float r)
Definition: particles.cpp:77
void addTransform(Vector3D rotate, Vector3D translate)
Definition: particles.cpp:82
void addTranslation(Vector3D translate_)
Definition: particles.cpp:88
static EShape const lastKind
Definition: particles.h:73
Pyramid2(float L, float W, float H, float alpha)
Definition: particles.cpp:110
Pyramid3(float L, float H, float alpha)
Definition: particles.cpp:331
Pyramid4(float L, float H, float alpha)
Definition: particles.cpp:260
Pyramid6(float R, float H, float alpha)
Definition: particles.cpp:159
SawtoothRippleBox(float L, float W, float H)
Definition: particles.cpp:301
SawtoothRippleGauss(float L, float W, float H)
Definition: particles.cpp:311
SawtoothRippleLorentz(float L, float W, float H)
Definition: particles.cpp:321
SawtoothRipple(float L, float W, float H, float asymmetry)
TruncatedSphere(float R, float H, float deltaH=0.0f)
Definition: particles.cpp:350
TruncatedSpheroid(float R, float H, float fp, float deltaH=0.0f)
Definition: particles.cpp:359
QString const & name(EShape k)
Definition: particles.cpp:20
Defines Object class.
Real shapes will be parameterized by BaseShape enum and possibly two floats.
Definition: geometry_inc.h:51