1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
|
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file GUI/ba3d/model/particles.h
//! @brief Defines Particle class
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************** //
#ifndef BORNAGAIN_GUI_BA3D_MODEL_PARTICLES_H
#define BORNAGAIN_GUI_BA3D_MODEL_PARTICLES_H
#include "GUI/ba3d/model/object.h"
namespace RealSpace
{
namespace Particles
{
enum class EShape {
None,
FullSphere,
FullSpheroid,
Cylinder,
TruncatedSphere,
TruncatedSpheroid,
Cone,
Icosahedron,
Dodecahedron,
TruncatedCube,
Prism6,
Cone6,
Pyramid,
Cuboctahedron,
Prism3,
Tetrahedron,
EllipsoidalCylinder,
BarGauss,
BarLorentz,
Box,
HemiEllipsoid,
Dot,
CosineRippleBox,
CosineRippleGauss,
CosineRippleLorentz,
SawtoothRippleBox,
SawtoothRippleGauss,
SawtoothRippleLorentz,
AnisoPyramid,
};
QString const& name(EShape);
//------------------------------------------------------------------------------
class Particle : public Object
{
protected:
Particle(GeometricID::Key);
Vector3D turn; // turn before scale
Vector3D scale; // geometries are of 1-size (box 1x1x1, sphere D=1), need scaling
Vector3D offset; // geometries centered around origin; particles stand on z=0 plane
Vector3D rotate, translate; // remembered
void set();
public:
static EShape const firstKind = EShape::None;
static EShape const lastKind = EShape::AnisoPyramid;
void transform(Vector3D rotate, Vector3D translate);
void fancy(Vector3D rotate, float r);
void addTransform(Vector3D rotate, Vector3D translate);
void addTranslation(Vector3D translate_);
void addExtrinsicRotation(Vector3D rotateExtrinsic);
};
//------------------------------------------------------------------------------
// follow BornAgain manual, chapter 11, Particle form factors
class FullSphere : public Particle
{
public:
FullSphere(float R);
};
class FullSpheroid : public Particle
{
public:
FullSpheroid(float R, float H);
};
class Cylinder : public Particle
{
public:
Cylinder(float R, float H);
};
class TruncatedSphere : public Particle
{
public:
TruncatedSphere(float R, float H, float deltaH = 0.0f);
};
class TruncatedSpheroid : public Particle
{
public:
TruncatedSpheroid(float R, float H, float fp, float deltaH = 0.0f);
};
class Cone : public Particle
{
public:
Cone(float R, float H, float alpha);
};
class Icosahedron : public Particle
{
public:
Icosahedron(float L);
};
class Dodecahedron : public Particle
{
public:
Dodecahedron(float L);
};
class Dot : public Particle
{
public:
Dot();
};
class TruncatedCube : public Particle
{
public:
TruncatedCube(float L, float t);
};
class Prism6 : public Particle
{
public:
Prism6(float R, float H);
};
class Cone6 : public Particle
{
public:
Cone6(float R, float H, float alpha);
};
class Pyramid : public Particle
{
public:
Pyramid(float L, float H, float alpha);
};
class Cuboctahedron : public Particle
{
public:
Cuboctahedron(float L, float H, float rH, float alpha);
};
class Prism3 : public Particle
{
public:
Prism3(float L, float H);
};
class Tetrahedron : public Particle
{
public:
Tetrahedron(float L, float H, float alpha);
};
class EllipsoidalCylinder : public Particle
{
public:
EllipsoidalCylinder(float Ra, float Rb, float H);
};
class BarGauss : public Particle
{
public:
BarGauss(float L, float W, float H);
};
class BarLorentz : public Particle
{
public:
BarLorentz(float L, float W, float H);
};
class Box : public Particle
{
public:
Box(float L, float W, float H);
};
class HemiEllipsoid : public Particle
{
public:
HemiEllipsoid(float Ra, float Rb, float H);
};
class CosineRippleBox : public Particle
{
public:
CosineRippleBox(float L, float W, float H);
};
class CosineRippleGauss : public Particle
{
public:
CosineRippleGauss(float L, float W, float H);
};
class CosineRippleLorentz : public Particle
{
public:
CosineRippleLorentz(float L, float W, float H);
};
class SawtoothRippleBox : public Particle
{
public:
SawtoothRippleBox(float L, float W, float H);
};
class SawtoothRippleGauss : public Particle
{
public:
SawtoothRippleGauss(float L, float W, float H);
};
class SawtoothRippleLorentz : public Particle
{
public:
SawtoothRippleLorentz(float L, float W, float H);
};
class SawtoothRipple : public Particle
{
public:
SawtoothRipple(float L, float W, float H, float asymmetry);
};
class AnisoPyramid : public Particle
{
public:
AnisoPyramid(float L, float W, float H, float alpha);
};
} // namespace Particles
} // namespace RealSpace
#endif // BORNAGAIN_GUI_BA3D_MODEL_PARTICLES_H
|