41 #include "../common/metatreeitem.h"
42 #include "../../3dhelpers/geometrymultiplier.h"
43 #include "../../materials/geometrymultipliermaterial.h"
52 #include <Qt3DExtras/QSphereGeometry>
54 #include <Qt3DCore/QTransform>
64 using namespace DISP3DLIB;
80 this->setEditable(
false);
81 this->setCheckable(
true);
82 this->setCheckState(Qt::Checked);
83 this->setToolTip(this->text());
91 if(!m_pSphereMesh && !tDigitizer.isEmpty())
93 QSharedPointer<Qt3DExtras::QSphereGeometry> pSourceSphereGeometry = QSharedPointer<Qt3DExtras::QSphereGeometry>::create();
94 pSourceSphereGeometry->setRadius(tSphereRadius);
99 this->addComponent(m_pSphereMesh);
104 this->addComponent(pMaterial);
108 if(!tDigitizer.isEmpty())
110 QVector<QColor> vColorsEdges;
112 QVector<QMatrix4x4> vTransforms;
113 vTransforms.reserve(tDigitizer.size());
117 for(
int i = 0; i < tDigitizer.size(); ++i) {
118 QMatrix4x4 tempTransform;
120 tempPos.setX(tDigitizer[i].r[0]);
121 tempPos.setY(tDigitizer[i].r[1]);
122 tempPos.setZ(tDigitizer[i].r[2]);
124 tempTransform.translate(tempPos);
125 vTransforms.push_back(tempTransform);
127 vColorsEdges.push_back(tSphereColor);
131 m_pSphereMesh->setTransforms(vTransforms);
132 m_pSphereMesh->setColors(vColorsEdges);
140 for(
int i = 0; i < items.size(); ++i) {
143 data.setValue(alpha);
144 item->setData(data, MetaTreeItemRoles::AlphaValue);
145 item->setData(data, Qt::DecorationRole);
152 for(
int i = 0; i < items.size(); ++i) {
155 data.setValue(tSphereColor);
156 item->setData(data, MetaTreeItemRoles::Color);
157 item->setData(data, Qt::DecorationRole);