BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
GUI::RealSpace::Particles::CosineRippleBox Class Reference

Description

Definition at line 185 of file particles.h.

Inheritance diagram for GUI::RealSpace::Particles::CosineRippleBox:
[legend]
Collaboration diagram for GUI::RealSpace::Particles::CosineRippleBox:
[legend]

Public Member Functions

 CosineRippleBox (float L, float W, float H)
 
void addExtrinsicRotation (Vector3D rotateExtrinsic)
 
void addExtrinsicRotation (Vector3D turn, Vector3D scale, Vector3D &rotate, Vector3D rotateExtrinsic, Vector3D &translate)
 
void addTransform (Vector3D rotate, Vector3D translate)
 
void addTranslation (Vector3D translate_)
 
void fancy (Vector3D rotate, float r)
 
void transform (float scale, Vector3D rotate, Vector3D translate)
 
void transform (Vector3D rotate, Vector3D translate)
 
void transform (Vector3D scale, QQuaternion, Vector3D translate)
 
void transform (Vector3D scale, Vector3D rotate, Vector3D translate)
 
void transform (Vector3D turn, Vector3D scale, Vector3D rotate, Vector3D translate)
 

Public Attributes

QColor color
 

Static Public Attributes

static EShape const firstKind = EShape::BarGauss
 
static EShape const lastKind = EShape::TruncatedSpheroid
 

Protected Member Functions

void set ()
 

Protected Attributes

bool isNull
 
Vector3D offset
 
Vector3D rotate
 
Vector3D scale
 
Vector3D translate
 
Vector3D turn
 

Private Member Functions

void draw (Canvas &)
 
void releaseGeometry ()
 

Private Attributes

GeometryHandle geo
 
GeometricID::Key gky
 
QMatrix4x4 mat
 
Modelmodel
 

Constructor & Destructor Documentation

◆ CosineRippleBox()

GUI::RealSpace::Particles::CosineRippleBox::CosineRippleBox ( float  L,
float  W,
float  H 
)

Definition at line 271 of file particles.cpp.

272  : Particle(Key(BaseShape::Ripple, 0, 0))
273 {
274  isNull = (L < 0 || W < 0 || H < 0) || (L <= 0 && W <= 0 && H <= 0);
275  turn = Vector3D(0, 0, 0);
276  scale = Vector3D(L, W, H);
277  offset = Vector3D(0, 0, 0);
278  set();
279 }

References GUI::RealSpace::Object::isNull, GUI::RealSpace::Particles::Particle::offset, GUI::RealSpace::GeometricID::Ripple, GUI::RealSpace::Particles::Particle::scale, GUI::RealSpace::Particles::Particle::set(), and GUI::RealSpace::Particles::Particle::turn.

Here is the call graph for this function:

Member Function Documentation

◆ addExtrinsicRotation() [1/2]

void GUI::RealSpace::Particles::Particle::addExtrinsicRotation ( Vector3D  rotateExtrinsic)
inherited

Definition at line 93 of file particles.cpp.

94 {
95  Object::addExtrinsicRotation(turn, scale, rotate, rotateExtrinsic,
96  (translate = offset + translate));
97 }
void addExtrinsicRotation(Vector3D turn, Vector3D scale, Vector3D &rotate, Vector3D rotateExtrinsic, Vector3D &translate)
Definition: object.cpp:79

References GUI::RealSpace::Object::addExtrinsicRotation(), GUI::RealSpace::Particles::Particle::offset, GUI::RealSpace::Particles::Particle::rotate, GUI::RealSpace::Particles::Particle::scale, GUI::RealSpace::Particles::Particle::translate, and GUI::RealSpace::Particles::Particle::turn.

Here is the call graph for this function:

◆ addExtrinsicRotation() [2/2]

void GUI::RealSpace::Object::addExtrinsicRotation ( Vector3D  turn,
Vector3D  scale,
Vector3D rotate,
Vector3D  rotateExtrinsic,
Vector3D translate 
)
inherited

Definition at line 79 of file object.cpp.

81 {
82  mat.setToIdentity();
83  mat.rotate(EulerToQuaternion(rotateExtrinsic));
84  mat.translate(translate);
85  mat.rotate(EulerToQuaternion(rotate));
86  mat.scale(scale);
87  mat.rotate(EulerToQuaternion(turn));
88 
89  // first apply the particle's intrinsic and then extrinsic rotations
90  QQuaternion q = EulerToQuaternion(rotateExtrinsic) * EulerToQuaternion(rotate);
91  rotate = QuaternionToEuler(q);
92 
93  // translate the object to the extrinsically rotated translation vector
94  translate = EulerToQuaternion(rotateExtrinsic).rotatedVector(translate);
95 }
QMatrix4x4 mat
Definition: object.h:55

References GUI::RealSpace::Object::mat.

Referenced by GUI::RealSpace::Particles::Particle::addExtrinsicRotation().

◆ addTransform()

void GUI::RealSpace::Particles::Particle::addTransform ( Vector3D  rotate,
Vector3D  translate 
)
inherited

Definition at line 82 of file particles.cpp.

83 {
84  Object::transform(turn, scale, (rotate = rotate + rotate_),
85  offset + (translate = translate + translate_));
86 }
void transform(float scale, Vector3D rotate, Vector3D translate)
Definition: object.cpp:51

References GUI::RealSpace::Particles::Particle::offset, GUI::RealSpace::Particles::Particle::rotate, GUI::RealSpace::Particles::Particle::scale, GUI::RealSpace::Object::transform(), GUI::RealSpace::Particles::Particle::translate, and GUI::RealSpace::Particles::Particle::turn.

Referenced by GUI::RealSpace::BuilderUtils::applyParticleTransformations().

Here is the call graph for this function:

◆ addTranslation()

void GUI::RealSpace::Particles::Particle::addTranslation ( Vector3D  translate_)
inherited

Definition at line 88 of file particles.cpp.

89 {
91 }

References GUI::RealSpace::Particles::Particle::offset, GUI::RealSpace::Particles::Particle::rotate, GUI::RealSpace::Particles::Particle::scale, GUI::RealSpace::Object::transform(), GUI::RealSpace::Particles::Particle::translate, and GUI::RealSpace::Particles::Particle::turn.

Here is the call graph for this function:

◆ draw()

void GUI::RealSpace::Object::draw ( Canvas canvas)
privateinherited

Definition at line 102 of file object.cpp.

103 {
104  if (isNull)
105  return;
106 
107  if (!geo)
109  canvas.draw(color, mat, *geo);
110 }
GeometryHandle getGeometry(GeometricID::Key)
Definition: geometry.cpp:158
GeometricID::Key gky
Definition: object.h:51
GeometryHandle geo
Definition: object.h:52
GeometryStore & geometryStore()
Definition: geometry.cpp:176

References GUI::RealSpace::Object::color, GUI::RealSpace::Canvas::draw(), GUI::RealSpace::Object::geo, GUI::RealSpace::geometryStore(), GUI::RealSpace::GeometryStore::getGeometry(), GUI::RealSpace::Object::gky, GUI::RealSpace::Object::isNull, and GUI::RealSpace::Object::mat.

Here is the call graph for this function:

◆ fancy()

void GUI::RealSpace::Particles::Particle::fancy ( Vector3D  rotate,
float  r 
)
inherited

Definition at line 77 of file particles.cpp.

78 {
80 }

References GUI::RealSpace::Particles::Particle::offset, GUI::RealSpace::Particles::Particle::rotate, GUI::RealSpace::Particles::Particle::scale, GUI::RealSpace::Object::transform(), GUI::RealSpace::Particles::Particle::translate, and GUI::RealSpace::Particles::Particle::turn.

Here is the call graph for this function:

◆ releaseGeometry()

void GUI::RealSpace::Object::releaseGeometry ( )
privateinherited

Definition at line 97 of file object.cpp.

98 {
99  geo.reset();
100 }

References GUI::RealSpace::Object::geo.

Referenced by GUI::RealSpace::Object::~Object(), and GUI::RealSpace::Model::rem().

◆ set()

void GUI::RealSpace::Particles::Particle::set ( )
protectedinherited

Definition at line 67 of file particles.cpp.

68 {
70 }
void transform(Vector3D rotate, Vector3D translate)
Definition: particles.cpp:72
static Vector3D const _0
Definition: def.h:46

References GUI::RealSpace::Vector3D::_0, and GUI::RealSpace::Particles::Particle::transform().

Referenced by GUI::RealSpace::Particles::BarGauss::BarGauss(), GUI::RealSpace::Particles::BarLorentz::BarLorentz(), GUI::RealSpace::Particles::Bipyramid4::Bipyramid4(), GUI::RealSpace::Particles::Box::Box(), GUI::RealSpace::Particles::CantellatedCube::CantellatedCube(), GUI::RealSpace::Particles::Cone::Cone(), CosineRippleBox(), GUI::RealSpace::Particles::CosineRippleGauss::CosineRippleGauss(), GUI::RealSpace::Particles::CosineRippleLorentz::CosineRippleLorentz(), GUI::RealSpace::Particles::Cylinder::Cylinder(), GUI::RealSpace::Particles::Dodecahedron::Dodecahedron(), GUI::RealSpace::Particles::EllipsoidalCylinder::EllipsoidalCylinder(), GUI::RealSpace::Particles::HemiEllipsoid::HemiEllipsoid(), GUI::RealSpace::Particles::HorizontalCylinder::HorizontalCylinder(), GUI::RealSpace::Particles::Icosahedron::Icosahedron(), GUI::RealSpace::Particles::PlatonicOctahedron::PlatonicOctahedron(), GUI::RealSpace::Particles::PlatonicTetrahedron::PlatonicTetrahedron(), GUI::RealSpace::Particles::Prism3::Prism3(), GUI::RealSpace::Particles::Prism6::Prism6(), GUI::RealSpace::Particles::Pyramid2::Pyramid2(), GUI::RealSpace::Particles::Pyramid3::Pyramid3(), GUI::RealSpace::Particles::Pyramid4::Pyramid4(), GUI::RealSpace::Particles::Pyramid6::Pyramid6(), GUI::RealSpace::Particles::SawtoothRippleBox::SawtoothRippleBox(), GUI::RealSpace::Particles::SawtoothRippleGauss::SawtoothRippleGauss(), GUI::RealSpace::Particles::SawtoothRippleLorentz::SawtoothRippleLorentz(), GUI::RealSpace::Particles::Sphere::Sphere(), GUI::RealSpace::Particles::Spheroid::Spheroid(), GUI::RealSpace::Particles::TruncatedCube::TruncatedCube(), GUI::RealSpace::Particles::TruncatedSphere::TruncatedSphere(), and GUI::RealSpace::Particles::TruncatedSpheroid::TruncatedSpheroid().

Here is the call graph for this function:

◆ transform() [1/5]

void GUI::RealSpace::Object::transform ( float  scale,
Vector3D  rotate,
Vector3D  translate 
)
inherited

◆ transform() [2/5]

void GUI::RealSpace::Particles::Particle::transform ( Vector3D  rotate,
Vector3D  translate 
)
inherited

◆ transform() [3/5]

void GUI::RealSpace::Object::transform ( Vector3D  scale,
QQuaternion  ,
Vector3D  translate 
)
inherited

◆ transform() [4/5]

void GUI::RealSpace::Object::transform ( Vector3D  scale,
Vector3D  rotate,
Vector3D  translate 
)
inherited

Definition at line 56 of file object.cpp.

57 {
58  mat.setToIdentity();
59  mat.translate(translate);
60  mat.rotate(EulerToQuaternion(rotate));
61  mat.scale(scale);
62 }

References GUI::RealSpace::Object::mat.

◆ transform() [5/5]

void GUI::RealSpace::Object::transform ( Vector3D  turn,
Vector3D  scale,
Vector3D  rotate,
Vector3D  translate 
)
inherited

Definition at line 64 of file object.cpp.

65 {
66  // 1. turn to align with x/y/z as needed
67  // 2. scale to desired x/y/z size
68  // 3. rotate as needed by the scene
69  // 4. move to the position
70  mat.setToIdentity();
71  mat.translate(translate);
72  mat.rotate(EulerToQuaternion(rotate));
73  mat.scale(scale);
74  mat.rotate(EulerToQuaternion(turn));
75 }

References GUI::RealSpace::Object::mat.

Member Data Documentation

◆ color

QColor GUI::RealSpace::Object::color
inherited

◆ firstKind

EShape const GUI::RealSpace::Particles::Particle::firstKind = EShape::BarGauss
staticinherited

Definition at line 72 of file particles.h.

◆ geo

GeometryHandle GUI::RealSpace::Object::geo
privateinherited

◆ gky

GeometricID::Key GUI::RealSpace::Object::gky
privateinherited

Definition at line 51 of file object.h.

Referenced by GUI::RealSpace::Object::draw().

◆ isNull

bool GUI::RealSpace::Object::isNull
protectedinherited

Definition at line 46 of file object.h.

Referenced by GUI::RealSpace::Particles::BarGauss::BarGauss(), GUI::RealSpace::Particles::BarLorentz::BarLorentz(), GUI::RealSpace::Particles::Bipyramid4::Bipyramid4(), GUI::RealSpace::Particles::Box::Box(), GUI::RealSpace::Particles::CantellatedCube::CantellatedCube(), GUI::RealSpace::Particles::Cone::Cone(), CosineRippleBox(), GUI::RealSpace::Particles::CosineRippleGauss::CosineRippleGauss(), GUI::RealSpace::Particles::CosineRippleLorentz::CosineRippleLorentz(), GUI::RealSpace::Particles::Cylinder::Cylinder(), GUI::RealSpace::Particles::Dodecahedron::Dodecahedron(), GUI::RealSpace::Particles::EllipsoidalCylinder::EllipsoidalCylinder(), GUI::RealSpace::Particles::HemiEllipsoid::HemiEllipsoid(), GUI::RealSpace::Particles::HorizontalCylinder::HorizontalCylinder(), GUI::RealSpace::Particles::Icosahedron::Icosahedron(), GUI::RealSpace::Particles::PlatonicOctahedron::PlatonicOctahedron(), GUI::RealSpace::Particles::PlatonicTetrahedron::PlatonicTetrahedron(), GUI::RealSpace::Particles::Prism3::Prism3(), GUI::RealSpace::Particles::Prism6::Prism6(), GUI::RealSpace::Particles::Pyramid2::Pyramid2(), GUI::RealSpace::Particles::Pyramid3::Pyramid3(), GUI::RealSpace::Particles::Pyramid4::Pyramid4(), GUI::RealSpace::Particles::Pyramid6::Pyramid6(), GUI::RealSpace::Particles::SawtoothRippleBox::SawtoothRippleBox(), GUI::RealSpace::Particles::SawtoothRippleGauss::SawtoothRippleGauss(), GUI::RealSpace::Particles::SawtoothRippleLorentz::SawtoothRippleLorentz(), GUI::RealSpace::Particles::Sphere::Sphere(), GUI::RealSpace::Particles::Spheroid::Spheroid(), GUI::RealSpace::Particles::TruncatedCube::TruncatedCube(), GUI::RealSpace::Particles::TruncatedSphere::TruncatedSphere(), GUI::RealSpace::Particles::TruncatedSpheroid::TruncatedSpheroid(), and GUI::RealSpace::Object::draw().

◆ lastKind

EShape const GUI::RealSpace::Particles::Particle::lastKind = EShape::TruncatedSpheroid
staticinherited

Definition at line 73 of file particles.h.

◆ mat

QMatrix4x4 GUI::RealSpace::Object::mat
privateinherited

◆ model

Model* GUI::RealSpace::Object::model
privateinherited

◆ offset

Vector3D GUI::RealSpace::Particles::Particle::offset
protectedinherited

Definition at line 66 of file particles.h.

Referenced by GUI::RealSpace::Particles::BarGauss::BarGauss(), GUI::RealSpace::Particles::BarLorentz::BarLorentz(), GUI::RealSpace::Particles::Bipyramid4::Bipyramid4(), GUI::RealSpace::Particles::Box::Box(), GUI::RealSpace::Particles::CantellatedCube::CantellatedCube(), GUI::RealSpace::Particles::Cone::Cone(), CosineRippleBox(), GUI::RealSpace::Particles::CosineRippleGauss::CosineRippleGauss(), GUI::RealSpace::Particles::CosineRippleLorentz::CosineRippleLorentz(), GUI::RealSpace::Particles::Cylinder::Cylinder(), GUI::RealSpace::Particles::Dodecahedron::Dodecahedron(), GUI::RealSpace::Particles::EllipsoidalCylinder::EllipsoidalCylinder(), GUI::RealSpace::Particles::HemiEllipsoid::HemiEllipsoid(), GUI::RealSpace::Particles::HorizontalCylinder::HorizontalCylinder(), GUI::RealSpace::Particles::Icosahedron::Icosahedron(), GUI::RealSpace::Particles::PlatonicOctahedron::PlatonicOctahedron(), GUI::RealSpace::Particles::PlatonicTetrahedron::PlatonicTetrahedron(), GUI::RealSpace::Particles::Prism3::Prism3(), GUI::RealSpace::Particles::Prism6::Prism6(), GUI::RealSpace::Particles::Pyramid2::Pyramid2(), GUI::RealSpace::Particles::Pyramid3::Pyramid3(), GUI::RealSpace::Particles::Pyramid4::Pyramid4(), GUI::RealSpace::Particles::Pyramid6::Pyramid6(), GUI::RealSpace::Particles::SawtoothRippleBox::SawtoothRippleBox(), GUI::RealSpace::Particles::SawtoothRippleGauss::SawtoothRippleGauss(), GUI::RealSpace::Particles::SawtoothRippleLorentz::SawtoothRippleLorentz(), GUI::RealSpace::Particles::Sphere::Sphere(), GUI::RealSpace::Particles::Spheroid::Spheroid(), GUI::RealSpace::Particles::TruncatedCube::TruncatedCube(), GUI::RealSpace::Particles::TruncatedSphere::TruncatedSphere(), GUI::RealSpace::Particles::TruncatedSpheroid::TruncatedSpheroid(), GUI::RealSpace::Particles::Particle::addExtrinsicRotation(), GUI::RealSpace::Particles::Particle::addTransform(), GUI::RealSpace::Particles::Particle::addTranslation(), GUI::RealSpace::Particles::Particle::fancy(), and GUI::RealSpace::Particles::Particle::transform().

◆ rotate

◆ scale

Vector3D GUI::RealSpace::Particles::Particle::scale
protectedinherited

Definition at line 65 of file particles.h.

Referenced by GUI::RealSpace::Particles::BarGauss::BarGauss(), GUI::RealSpace::Particles::BarLorentz::BarLorentz(), GUI::RealSpace::Particles::Bipyramid4::Bipyramid4(), GUI::RealSpace::Particles::Box::Box(), GUI::RealSpace::Particles::CantellatedCube::CantellatedCube(), GUI::RealSpace::Particles::Cone::Cone(), CosineRippleBox(), GUI::RealSpace::Particles::CosineRippleGauss::CosineRippleGauss(), GUI::RealSpace::Particles::CosineRippleLorentz::CosineRippleLorentz(), GUI::RealSpace::Particles::Cylinder::Cylinder(), GUI::RealSpace::Particles::Dodecahedron::Dodecahedron(), GUI::RealSpace::Particles::EllipsoidalCylinder::EllipsoidalCylinder(), GUI::RealSpace::Particles::HemiEllipsoid::HemiEllipsoid(), GUI::RealSpace::Particles::HorizontalCylinder::HorizontalCylinder(), GUI::RealSpace::Particles::Icosahedron::Icosahedron(), GUI::RealSpace::Particles::PlatonicOctahedron::PlatonicOctahedron(), GUI::RealSpace::Particles::PlatonicTetrahedron::PlatonicTetrahedron(), GUI::RealSpace::Particles::Prism3::Prism3(), GUI::RealSpace::Particles::Prism6::Prism6(), GUI::RealSpace::Particles::Pyramid2::Pyramid2(), GUI::RealSpace::Particles::Pyramid3::Pyramid3(), GUI::RealSpace::Particles::Pyramid4::Pyramid4(), GUI::RealSpace::Particles::Pyramid6::Pyramid6(), GUI::RealSpace::Particles::SawtoothRippleBox::SawtoothRippleBox(), GUI::RealSpace::Particles::SawtoothRippleGauss::SawtoothRippleGauss(), GUI::RealSpace::Particles::SawtoothRippleLorentz::SawtoothRippleLorentz(), GUI::RealSpace::Particles::Sphere::Sphere(), GUI::RealSpace::Particles::Spheroid::Spheroid(), GUI::RealSpace::Particles::TruncatedCube::TruncatedCube(), GUI::RealSpace::Particles::TruncatedSphere::TruncatedSphere(), GUI::RealSpace::Particles::TruncatedSpheroid::TruncatedSpheroid(), GUI::RealSpace::Particles::Particle::addExtrinsicRotation(), GUI::RealSpace::Particles::Particle::addTransform(), GUI::RealSpace::Particles::Particle::addTranslation(), GUI::RealSpace::Particles::Particle::fancy(), and GUI::RealSpace::Particles::Particle::transform().

◆ translate

◆ turn


The documentation for this class was generated from the following files: