40 #include "../common/metatreeitem.h"
46 #include <Qt3DExtras/QPhongMaterial>
56 using namespace DISP3DLIB;
74 this->setToolTip(
"Abstract 3D Tree Item");
77 QList<QStandardItem*> list;
87 list <<
new QStandardItem(
"The transformation options");
88 this->appendRow(list);
91 itemXTrans->setEditable(
true);
96 list <<
new QStandardItem(itemXTrans->toolTip());
100 itemYTrans->setEditable(
true);
105 list <<
new QStandardItem(itemYTrans->toolTip());
109 itemZTrans->setEditable(
true);
114 list <<
new QStandardItem(itemZTrans->toolTip());
119 itemScale->setEditable(
true);
124 list <<
new QStandardItem(itemZTrans->toolTip());
125 data.setValue(fScale);
126 itemScale->setData(data, MetaTreeItemRoles::Scale);
137 list <<
new QStandardItem(
"The color options");
138 this->appendRow(list);
140 float fAlpha = 0.75f;
146 list <<
new QStandardItem(itemAlpha->toolTip());
148 data.setValue(fAlpha);
149 itemAlpha->setData(data, MetaTreeItemRoles::AlphaValue);
155 list << pItemSurfCol;
156 list <<
new QStandardItem(pItemSurfCol->toolTip());
158 data.setValue(QColor(100,100,100));
159 pItemSurfCol->setData(data, MetaTreeItemRoles::Color);
160 pItemSurfCol->setData(data, Qt::DecorationRole);
171 QStandardItem::setData(value, role);
174 case Qt::CheckStateRole:{
183 int Abstract3DTreeItem::type()
const
192 QList<QStandardItem*> itemList;
194 if(this->hasChildren()) {
195 for(
int row = 0; row<this->rowCount(); row++) {
196 for(
int col = 0; col<this->columnCount(); col++) {
197 if(this->child(row, col)->type() == type) {
198 itemList.append(this->child(row, col));
211 QList<QStandardItem*> itemList;
213 if(this->hasChildren()) {
214 for(
int row = 0; row<this->rowCount(); row++) {
215 for(
int col = 0; col<this->columnCount(); col++) {
216 if(this->child(row, col)->text() == text) {
217 itemList.append(this->child(row, col));
230 this->appendRow(newItem);
239 this->appendRow(&newItem);
248 Eigen::MatrixX4f matColor(numVert,4);
250 for(
int i = 0; i < numVert; ++i) {
251 matColor(i,0) = color.redF();
252 matColor(i,1) = color.greenF();
253 matColor(i,2) = color.blueF();
254 matColor(i,3) = color.alphaF();
265 data.setValue(fAlpha);
274 for(
int i = 0; i<this->rowCount(); i++) {
275 if(this->child(i)->isCheckable()) {
276 this->child(i)->setCheckState(checkState);
280 this->
setVisible(checkState == Qt::Unchecked ?
false :
true);
287 if(fTransX.canConvert<
float>()) {
288 QVector3D position = this->position();
289 position.setX(fTransX.toFloat());
298 if(fTransY.canConvert<
float>()) {
299 QVector3D position = this->position();
300 position.setY(fTransY.toFloat());
309 if(fTransZ.canConvert<
float>()) {
310 QVector3D position = this->position();
311 position.setZ(fTransZ.toFloat());
320 if(fScale.canConvert<
float>()) {