MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
renderable3Dentity.h
Go to the documentation of this file.
1//=============================================================================================================
36#ifndef DISP3DLIB_RENDERABLE3DENTITY_H
37#define DISP3DLIB_RENDERABLE3DENTITY_H
38
39//=============================================================================================================
40// INCLUDES
41//=============================================================================================================
42
43#include "../../../disp3D_global.h"
44
45//=============================================================================================================
46// QT INCLUDES
47//=============================================================================================================
48
49#include <Qt3DCore/QEntity>
50#include <QVector3D>
51#include <QPointer>
52
53//=============================================================================================================
54// EIGEN INCLUDES
55//=============================================================================================================
56
57#include <Eigen/Core>
58
59//=============================================================================================================
60// FORWARD DECLARATIONS
61//=============================================================================================================
62
63namespace Qt3DCore {
64 class QTransform;
65}
66
67namespace FIFFLIB {
68 class FiffCoordTrans;
69}
70
71//=============================================================================================================
72// DEFINE NAMESPACE DISP3DLIB
73//=============================================================================================================
74
75namespace DISP3DLIB
76{
77
78//=============================================================================================================
79// DISP3DLIB FORWARD DECLARATIONS
80//=============================================================================================================
81
82//=============================================================================================================
88class DISP3DSHARED_EXPORT Renderable3DEntity : public Qt3DCore::QEntity
89{
90 Q_OBJECT
91 Q_PROPERTY(float scale READ scaleValue WRITE applyScale NOTIFY scaleChanged)
92 Q_PROPERTY(float rotX READ rotX WRITE setRotX NOTIFY rotXChanged)
93 Q_PROPERTY(float rotY READ rotY WRITE setRotY NOTIFY rotYChanged)
94 Q_PROPERTY(float rotZ READ rotZ WRITE setRotZ NOTIFY rotZChanged)
95 Q_PROPERTY(QVector3D position READ position WRITE applyPosition NOTIFY positionChanged)
96
97public:
98 typedef QSharedPointer<Renderable3DEntity> SPtr;
99 typedef QSharedPointer<const Renderable3DEntity> ConstSPtr;
101 //=========================================================================================================
107 explicit Renderable3DEntity(Qt3DCore::QEntity* parent = 0);
108
109 //=========================================================================================================
113 virtual ~Renderable3DEntity();
114
115 //=========================================================================================================
119 //void releaseNode(Qt3DCore::QNode *node);
120
121 //=========================================================================================================
127 virtual void setTransform(const Qt3DCore::QTransform &transform);
128
129 //=========================================================================================================
136 virtual void setTransform(const FIFFLIB::FiffCoordTrans& transform,
137 bool bApplyInverse = false);
138
139 //=========================================================================================================
145 virtual void applyTransform(const Qt3DCore::QTransform& transform);
146
147 //=========================================================================================================
154 virtual void applyTransform(const FIFFLIB::FiffCoordTrans& transform,
155 bool bApplyInverse = false);
156
157 //=========================================================================================================
163 virtual float scaleValue() const;
164
165 //=========================================================================================================
171 virtual float rotX() const;
172
173 //=========================================================================================================
179 virtual float rotY() const;
180
181 //=========================================================================================================
187 virtual float rotZ() const;
188
189 //=========================================================================================================
195 virtual QVector3D position() const;
196
197 //=========================================================================================================
203 virtual void applyRotX(float rotX);
204
205 //=========================================================================================================
211 virtual void setRotX(float rotX);
212
213 //=========================================================================================================
219 virtual void applyRotY(float rotY);
220
221 //=========================================================================================================
227 virtual void setRotY(float rotY);
228
229 //=========================================================================================================
235 virtual void applyRotZ(float rotZ);
236
237 //=========================================================================================================
243 virtual void setRotZ(float rotZ);
244
245 //=========================================================================================================
251 virtual void applyPosition(const QVector3D& position);
252
253 //=========================================================================================================
259 virtual void setPosition(const QVector3D& position);
260
261 //=========================================================================================================
267 virtual void applyScale(float scale);
268
269 //=========================================================================================================
275 virtual void setScale(float scale);
276
277 //=========================================================================================================
283 virtual void setVisible(bool state);
284
285 //=========================================================================================================
292 virtual void setMaterialParameter(const QVariant &data,
293 const QString &sParameterName);
294
295 //=========================================================================================================
303 virtual QVariant getMaterialParameter(const QString &sParameterName);
304
305protected:
306 //=========================================================================================================
314 virtual void setMaterialParameterRecursive(QObject * pObject,
315 const QVariant &data,
316 const QString &sParameterName);
317
318 //=========================================================================================================
327 virtual QPair<bool, QVariant> getMaterialParameterRecursive(QObject * pObject,
328 const QString &sParameterName);
329
330 QPointer<Qt3DCore::QTransform> m_pTransform;
332 float m_fScale;
333 float m_fRotX;
334 float m_fRotY;
335 float m_fRotZ;
336 QVector3D m_position;
338signals:
339 //=========================================================================================================
345 void scaleChanged(float scale);
346
347 //=========================================================================================================
353 void rotXChanged(float rotX);
354
355 //=========================================================================================================
361 void rotYChanged(float rotY);
362
363 //=========================================================================================================
369 void rotZChanged(float rotZ);
370
371 //=========================================================================================================
377 void positionChanged(QVector3D position);
378};
379} // NAMESPACE
380
381#endif // DISP3DLIB_RENDERABLE3DENTITY_H
#define DISP3DSHARED_EXPORT
Base class for renederable 3D QEntities.
void rotYChanged(float rotY)
QSharedPointer< const Renderable3DEntity > ConstSPtr
QSharedPointer< Renderable3DEntity > SPtr
QPointer< Qt3DCore::QTransform > m_pTransform
void scaleChanged(float scale)
void rotZChanged(float rotZ)
void rotXChanged(float rotX)
void positionChanged(QVector3D position)
Coordinate transformation description.