46 #include <Qt3DCore/QTransform>
58 #include <QSharedPointer>
60 #include <Qt3DRender/QMaterial>
61 #include <Qt3DExtras/QPerVertexColorMaterial>
62 #include <Qt3DExtras/QPhongMaterial>
63 #include <Qt3DCore/QComponent>
64 #include <Qt3DRender/QEffect>
65 #include <Qt3DRender/QParameter>
71 using namespace DISP3DLIB;
72 using namespace Eigen;
73 using namespace Qt3DCore;
74 using namespace FIFFLIB;
75 using namespace Qt3DRender;
82 : Qt3DCore::QEntity(parent)
87 , m_position(QVector3D(0.0f,0.0f,0.0f))
132 Qt3DCore::QTransform transform3d;
135 QMatrix4x4 matrix(transform.
invtrans(0,0),
151 transform3d.setMatrix(matrix);
153 QMatrix4x4 matrix(transform.
trans(0,0),
154 transform.
trans(0,1),
155 transform.
trans(0,2),
156 transform.
trans(0,3),
157 transform.
trans(1,0),
158 transform.
trans(1,1),
159 transform.
trans(1,2),
160 transform.
trans(1,3),
161 transform.
trans(2,0),
162 transform.
trans(2,1),
163 transform.
trans(2,2),
164 transform.
trans(2,3),
165 transform.
trans(3,0),
166 transform.
trans(3,1),
167 transform.
trans(3,2),
168 transform.
trans(3,3));
169 transform3d.setMatrix(matrix);
186 Qt3DCore::QTransform transform3d;
189 QMatrix4x4 matrix(transform.
invtrans(0,0),
205 transform3d.setMatrix(matrix);
207 QMatrix4x4 matrix(transform.
trans(0,0),
208 transform.
trans(0,1),
209 transform.
trans(0,2),
210 transform.
trans(0,3),
211 transform.
trans(1,0),
212 transform.
trans(1,1),
213 transform.
trans(1,2),
214 transform.
trans(1,3),
215 transform.
trans(2,0),
216 transform.
trans(2,1),
217 transform.
trans(2,2),
218 transform.
trans(2,3),
219 transform.
trans(3,0),
220 transform.
trans(3,1),
221 transform.
trans(3,2),
222 transform.
trans(3,3));
223 transform3d.setMatrix(matrix);
238 float Renderable3DEntity::rotX()
const
245 float Renderable3DEntity::rotY()
const
252 float Renderable3DEntity::rotZ()
const
259 QVector3D Renderable3DEntity::position()
const
276 m.rotate(rotX, QVector3D(1.0f, 0.0f, 0.0f));
290 m.rotate(-
m_fRotX + rotX, QVector3D(1.0f, 0.0f, 0.0f));
309 m.rotate(rotY, QVector3D(0.0f, 1.0f, 0.0f));
323 m.rotate(-
m_fRotY + rotY, QVector3D(0.0f, 1.0f, 0.0f));
342 m.rotate(rotZ, QVector3D(0.0f, 0.0f, 1.0f));
356 m.rotate(-
m_fRotZ + rotZ, QVector3D(0.0f, 0.0f, 1.0f));
375 m.translate(position);
433 for(
int i = 0; i < this->childNodes().size(); ++i) {
434 this->childNodes()[i]->setEnabled(state);
436 this->setEnabled(state);
442 const QString &sParameterName)
453 return resultPair.second;
459 const QVariant &data,
460 const QString &sParameterName)
462 if(QParameter* pParameter =
dynamic_cast<QParameter*
>(pObject)) {
463 if(pParameter->name() == sParameterName) {
464 pParameter->setValue(data);
468 for(
int i = 0; i < pObject->children().size(); ++i) {
476 const QString &sParameterName)
478 if(QParameter* pParameter =
dynamic_cast<QParameter*
>(pObject)) {
479 if(pParameter->name() == sParameterName) {
480 return QPair<bool, QVariant>(
true, pParameter->value());
484 for(
int i = 0; i < pObject->children().size(); ++i) {
492 return QPair<bool, QVariant>(
false, QVariant());