BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
object.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/ba3d/model/object.h
6 //! @brief Defines Object 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_OBJECT_H
16 #define BORNAGAIN_GUI_BA3D_MODEL_OBJECT_H
17 
19 #include <QColor>
20 #include <QMatrix4x4>
21 
22 namespace RealSpace {
23 
24 class Model;
25 class Canvas;
26 
27 class Object {
28  friend class Model;
29 
30 public:
32  virtual ~Object();
33 
34  QColor color;
35 
36  void transform(float scale, Vector3D rotate, Vector3D translate);
37  void transform(Vector3D scale, Vector3D rotate, Vector3D translate);
38  void transform(Vector3D scale, QQuaternion, Vector3D translate);
39  void transform(Vector3D turn, Vector3D scale, Vector3D rotate, Vector3D translate);
40 
41  void addExtrinsicRotation(Vector3D turn, Vector3D scale, Vector3D& rotate,
42  Vector3D rotateExtrinsic, Vector3D& translate);
43 
44 protected:
45  bool isNull;
46 
47 private:
49 
51  GeometryHandle geo; // retrieved on demand
52  void releaseGeometry(); // can be released whenever
53 
54  QMatrix4x4 mat;
55  void draw(Canvas&);
56 };
57 
58 } // namespace RealSpace
59 #endif // BORNAGAIN_GUI_BA3D_MODEL_OBJECT_H
void addExtrinsicRotation(Vector3D turn, Vector3D scale, Vector3D &rotate, Vector3D rotateExtrinsic, Vector3D &translate)
Definition: object.cpp:73
virtual ~Object()
Definition: object.cpp:38
QMatrix4x4 mat
Definition: object.h:54
Object(GeometricID::Key)
Definition: object.cpp:34
GeometryHandle geo
Definition: object.h:51
Model * model
Definition: object.h:48
void transform(Vector3D scale, QQuaternion, Vector3D translate)
void transform(float scale, Vector3D rotate, Vector3D translate)
Definition: object.cpp:45
void releaseGeometry()
Definition: object.cpp:91
GeometricID::Key gky
Definition: object.h:50
QColor color
Definition: object.h:34
void draw(Canvas &)
Definition: object.cpp:96
Defines geometry namespace.
std::shared_ptr< Geometry > GeometryHandle
Definition: geometry_inc.h:26