43 class axlInspectorObjectManagerPrivate
49 QString lastScalarFieldName;
50 QString lastVectorFieldName;
78 d->inspector_object->setController(d->controller);
86 d->lastScalarFieldName =
"";
87 d->lastVectorFieldName =
"";
105 d->layout =
new QVBoxLayout(
this);
106 d->layout->setAlignment(Qt::AlignTop);
107 d->layout->setContentsMargins(0, 0, 0, 0);
108 d->layout->setSpacing(0);
109 d->layout->addWidget(d->tree);
111 d->layout->addWidget(d->inspector_object);
112 d->layout->addWidget(d->listSeparator);
113 d->layout->addWidget(d->list);
114 d->layout->addWidget(d->fieldSeparator);
115 d->layout->addWidget(d->field);
118 d->inspector_object->hide();
119 d->listSeparator->hide();
122 d->fieldSeparator->hide();
127 connect(d->list, SIGNAL(currentItemChanged(QListWidgetItem *,QListWidgetItem *)),
this, SLOT(
onTransmitDataSelected(QListWidgetItem *,QListWidgetItem *)));
130 connect(d->tree, SIGNAL(itemSelectionChanged()),
this, SLOT(onListSelectionChanged()));
138 connect(d->tree, SIGNAL(
dataSetRemoved(QList<dtkAbstractData *>)), d->inspector_object, SLOT(onDataSetRemoved(QList<dtkAbstractData*>)));
140 connect(d->tree, SIGNAL(selected(dtkAbstractData *)), d->inspector_object, SLOT(onDataSelected(dtkAbstractData *)));
141 connect(d->tree, SIGNAL(dataSetSelected(QList<dtkAbstractData *>)), d->inspector_object, SLOT(onDataSetSelected(QList<dtkAbstractData *>)));
142 connect(d->inspector_object, SIGNAL(
update()),
this, SIGNAL(
update()));
143 connect(d->inspector_object, SIGNAL(
showCurrentPoint(
double,
double, dtkAbstractData *)),
this, SIGNAL(
showCurrentPoint(
double,
double, dtkAbstractData *)));
144 connect(d->inspector_object, SIGNAL(
hideCurrentPoint(
double,
double, dtkAbstractData *)),
this, SIGNAL(
hideCurrentPoint(
double,
double, dtkAbstractData *)));
145 connect(d->inspector_object, SIGNAL(
moveCurrentPoint(
double,
double, dtkAbstractData *)),
this, SIGNAL(
moveCurrentPoint(
double,
double, dtkAbstractData *)));
167 return d->tree->insert(data);
171 d->tree->remove(data);
176 return d->tree->dataSet();
181 for(
int i = 0; i < d->tree->columnCount(); i++)
183 d->tree->resizeColumnToContents(i);
189 d->tree->onStateChanged(data, mode);
195 foreach(dtkAbstractData *data, dataToRemoved){
196 if(dynamic_cast<axlAbstractVolumeDiscrete *>(data)){
199 d->layout->removeWidget(d->editor);
205 d->tree->onDataRemoved(dataToRemoved);
211 d->tree->removeAllItems();
216 d->controller = controller;
217 d->inspector_object->setController(controller);
218 d->tree->setController(controller);
222 void axlInspectorObjectManager::onListSelectionChanged(
void)
224 if(d->tree->selectedItems().size() == 0 && d->controller)
226 d->inspector_object->hide();
228 d->listSeparator->hide();
230 d->fieldSeparator->hide();
233 d->layout->removeWidget(d->editor);
243 if(d->tree->selectedItems().size() == 1 && d->controller)
245 d->inspector_object->show();
248 if(
axlAbstractData *axlData = dynamic_cast<axlAbstractData *>(d->controller->data(axlCurrentItem)))
250 if(axlData->fields().count() != 0)
253 d->listSeparator->show();
257 if(dynamic_cast<axlAbstractVolumeDiscrete *>(axlData)){
259 d->layout->addWidget(d->editor);
260 d->editor->setView(d->view);
261 d->editor->setData(axlData);
266 d->layout->removeWidget(d->editor);
274 d->list->setData(axlData);
335 for (
int i = 0 ; i < d->controller->items().size() ; i++)
339 if(axldata->
fields().size() > 0){
340 d->list->setData(axldata);
345 for (
int i = 0 ; i < d->list->count() ; i++)
347 QListWidgetItem *listItem = d->list->item(i);
348 if(dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()->kind() ==
axlAbstractField::Scalar && dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()->kind() == dynamic_cast<axlInspectorObjectManagerListItem *>(d->list->item(d->list->count() - 1))->field()->kind())
349 dynamic_cast<axlAbstractActorField *>(d->view->actor(dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()))->displayAsNoneScalar();
351 if( dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()->kind() ==
axlAbstractField::Vector && dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()->kind() == dynamic_cast<axlInspectorObjectManagerListItem *>(d->list->item(d->list->count() - 1))->field()->kind())
361 this->onListSelectionChanged();
367 d->field->setField(field);
374 d->lastScalarFieldName = field->name();
382 d->lastVectorFieldName = field->name();
388 if ( dynamic_cast<axlAbstractActorField *>(d->view->actor(field)) )
396 qDebug() <<
"axlInspectorObjectManager::onTransmitDataSelected" <<
"error";
404 if(d->list->selectedItems().isEmpty())
407 d->fieldSeparator->hide();
413 d->fieldSeparator->show();
439 for (
int i = 0 ; i < d->controller->items().size() ; i++)
443 if(axldata->
fields().size() > 0){
444 d->list->setData(axldata);
449 for (
int i = 0 ; i < d->list->count() ; i++)
451 QListWidgetItem *listItem = d->list->item(i);
452 if(dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()->kind() ==
axlAbstractField::Scalar && dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()->kind() == dynamic_cast<axlInspectorObjectManagerListItem *>(d->list->item(d->list->count() - 1))->field()->kind())
453 dynamic_cast<axlAbstractActorField *>(d->view->actor(dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()))->displayAsNoneScalar();
455 if( dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()->kind() ==
axlAbstractField::Vector && dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()->kind() == dynamic_cast<axlInspectorObjectManagerListItem *>(d->list->item(d->list->count() - 1))->field()->kind())
472 if(currentField->name() == fieldName)
473 field = currentField;
482 dynamic_cast<axlAbstractActorField *>(d->view->actor(currentField))->displayAsNoneScalar();
484 dynamic_cast<axlAbstractActorField *>(d->view->actor(currentField))->displayAsNoneVector();
490 dynamic_cast<axlAbstractActorField *>(d->view->actor(field))->displayAsColor();
492 dynamic_cast<axlAbstractActorField *>(d->view->actor(field))->displayAsGlyph();
502 if(d->tree->selectedItems().size() > 1 )
509 if(currentField->name() == fieldName)
510 field = currentField;
518 dynamic_cast<axlAbstractActorField *>(d->view->actor(currentField))->displayAsNoneScalar();
520 dynamic_cast<axlAbstractActorField *>(d->view->actor(currentField))->displayAsNoneVector();
526 dynamic_cast<axlAbstractActorField *>(d->view->actor(field))->displayAsColor();
528 dynamic_cast<axlAbstractActorField *>(d->view->actor(field))->displayAsGlyph();
540 for (
int i = 0 ; i < d->controller->items().size() ; i++)
544 if(axldata->
fields().size() > 0){
545 d->list->setData(axldata);
549 for (
int i = 0 ; i < d->list->count() ; i++)
551 QListWidgetItem *listItem = d->list->item(i);
552 if(dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()->kind() ==
axlAbstractField::Scalar && dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()->kind() == dynamic_cast<axlInspectorObjectManagerListItem *>(d->list->item(d->list->count() - 1))->field()->kind())
553 dynamic_cast<axlAbstractActorField *>(d->view->actor(dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()))->displayAsNoneScalar();
555 if( dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()->kind() ==
axlAbstractField::Vector && dynamic_cast<axlInspectorObjectManagerListItem *>(listItem)->field()->kind() == dynamic_cast<axlInspectorObjectManagerListItem *>(d->list->item(d->list->count() - 1))->field()->kind())
568 d->list->setData(dataList.last());
577 d->field->setField(field);
583 d->fieldSeparator->show();
589 d->lastScalarFieldName = field->name();
597 d->lastVectorFieldName = field->name();
640 d->field->setView(view);
647 connect(d->inspector_object, SIGNAL(tubeFilterRadiusChanged(dtkAbstractData *,
double)), d->view, SLOT(onTubeFilterRadiusChanged(dtkAbstractData *,
double)));
axlInspectorObjectManagerTreeItem * insert(axlAbstractData *data)
void modifiedProperty(dtkAbstractData *, int)
void actorVisibilityChanged(dtkAbstractData *data, bool actorVisibility)
QList< dtkAbstractData * > dataSet(void)
axlAbstractField * onTransmitDataSelected(QListWidgetItem *fromItem, QListWidgetItem *toItem)
void removeData(dtkAbstractData *data)
void onDataRemoved(QList< dtkAbstractData * > dataToRemoved)
void setController(axlInspectorObjectController *controller)
void interpolationChanded(dtkAbstractData *data, int interpolation)
void onStateChanged(dtkAbstractData *data, int mode)
void dataChangedByGeometry(dtkAbstractData *data)
virtual void displayAsNoneVector(void)
void onFieldsCreatedOnData(QList< axlAbstractData * > dataList, QString fieldName)
void resizeColumnToContents()
void onFieldOpened(QList< axlAbstractData * > dataList, QString fieldName)
void dataSetRemoved(QList< dtkAbstractData * > dataSetRemoved)
void showCurrentPoint(double u, double v, dtkAbstractData *data)
void setView(axlAbstractView *view)
axlInspectorObjectManager(QWidget *parent=0)
Class axlAbstractField defines an API for arrays of numeric data.
void stateChanged(dtkAbstractData *data, int mode)
~axlInspectorObjectManager(void)
virtual void displayAsColor(void)
QList< axlAbstractField * > fields(void)
void hideCurrentPoint(double u, double v, dtkAbstractData *data)
void moveCurrentPoint(double u, double v, dtkAbstractData *data)
void onFieldListSelectionChanged(void)
Class axlAbstractData defines an API for all type of axel data.
virtual void displayAsGlyph(void)