File: object.h

package info (click to toggle)
bornagain 1.18.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 118,800 kB
  • sloc: cpp: 469,684; python: 38,920; xml: 805; awk: 630; sh: 286; ansic: 37; makefile: 25
file content (61 lines) | stat: -rw-r--r-- 1,661 bytes parent folder | download
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
// ************************************************************************** //
//
//  BornAgain: simulate and fit scattering at grazing incidence
//
//! @file      GUI/ba3d/model/object.h
//! @brief     Defines Object 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_OBJECT_H
#define BORNAGAIN_GUI_BA3D_MODEL_OBJECT_H

#include "GUI/ba3d/model/geometry_inc.h"
#include <QColor>
#include <QMatrix4x4>

namespace RealSpace
{

class Model;
class Canvas;

class Object
{
    friend class Model;

public:
    Object(GeometricID::Key);
    virtual ~Object();

    QColor color;

    void transform(float scale, Vector3D rotate, Vector3D translate);
    void transform(Vector3D scale, Vector3D rotate, Vector3D translate);
    void transform(Vector3D scale, QQuaternion, Vector3D translate);
    void transform(Vector3D turn, Vector3D scale, Vector3D rotate, Vector3D translate);

    void addExtrinsicRotation(Vector3D turn, Vector3D scale, Vector3D& rotate,
                              Vector3D rotateExtrinsic, Vector3D& translate);

protected:
    bool isNull;

private:
    Model* model;

    GeometricID::Key gky;
    GeometryHandle geo;     // retrieved on demand
    void releaseGeometry(); // can be released whenever

    QMatrix4x4 mat;
    void draw(Canvas&);
};

} // namespace RealSpace
#endif // BORNAGAIN_GUI_BA3D_MODEL_OBJECT_H