BornAgain  1.19.79
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 GUI::RealSpace {
23 
24 class Model;
25 class Canvas;
26 
27 //! A geometric object
28 class Object {
29  friend class Model;
30 
31 public:
33  virtual ~Object();
34 
35  QColor color;
36 
37  void transform(float scale, Vector3D rotate, Vector3D translate);
38  void transform(Vector3D scale, Vector3D rotate, Vector3D translate);
39  void transform(Vector3D scale, QQuaternion, Vector3D translate);
40  void transform(Vector3D turn, Vector3D scale, Vector3D rotate, Vector3D translate);
41 
42  void addExtrinsicRotation(Vector3D turn, Vector3D scale, Vector3D& rotate,
43  Vector3D rotateExtrinsic, Vector3D& translate);
44 
45 protected:
46  bool isNull;
47 
48 private:
50 
52  GeometryHandle geo; // retrieved on demand
53  void releaseGeometry(); // can be released whenever
54 
55  QMatrix4x4 mat;
56  void draw(Canvas&);
57 };
58 
59 } // namespace GUI::RealSpace
60 
61 #endif // BORNAGAIN_GUI_BA3D_MODEL_OBJECT_H
A geometric object.
Definition: object.h:28
void transform(Vector3D scale, QQuaternion, Vector3D translate)
GeometricID::Key gky
Definition: object.h:51
void transform(float scale, Vector3D rotate, Vector3D translate)
Definition: object.cpp:51
void addExtrinsicRotation(Vector3D turn, Vector3D scale, Vector3D &rotate, Vector3D rotateExtrinsic, Vector3D &translate)
Definition: object.cpp:79
void draw(Canvas &)
Definition: object.cpp:102
GeometryHandle geo
Definition: object.h:52
QMatrix4x4 mat
Definition: object.h:55
Object(GeometricID::Key)
Definition: object.cpp:36
Defines namespace GUI::RealSpace::GeometricID.
std::shared_ptr< Geometry > GeometryHandle
Definition: geometry_inc.h:27
Real shapes will be parameterized by BaseShape enum and possibly two floats.
Definition: geometry_inc.h:51