25 this->scaleZ->setValidator(
new QDoubleValidator(0, 100, 8,
this));
27 this->transX->setValidator(
new QDoubleValidator(
this));
28 this->transY->setValidator(
new QDoubleValidator(
this));
29 this->transZ->setValidator(
new QDoubleValidator(
this));
37 connect(this->activeScalarComboBox,
38 SIGNAL(currentIndexChanged(
const QString&)),
this,
56 transformTabWidget->setEnabled(
true);
58 auto* transform_filter =
59 dynamic_cast<vtkTransformFilter*
>(
_item->transformFilter());
62 actorPropertiesGroupBox->setEnabled(
true);
63 vtkProperty* vtkProps =
64 static_cast<vtkActor*
>(
_item->actor())->GetProperty();
65 diffuseColorPickerButton->setColor(vtkProps->GetDiffuseColor());
66 visibleEdgesCheckBox->setChecked(vtkProps->GetEdgeVisibility());
67 edgeColorPickerButton->setColor(vtkProps->GetEdgeColor());
68 opacitySlider->setValue(
69 static_cast<int>(vtkProps->GetOpacity() * 100.0));
72 static_cast<vtkTransform*
>(transform_filter->GetTransform());
76 transform->GetScale(scale);
78 transform->GetPosition(trans);
82 this->scaleZ->blockSignals(
true);
83 this->transX->blockSignals(
true);
84 this->transY->blockSignals(
true);
85 this->transZ->blockSignals(
true);
86 this->scaleZ->setText(QString::number(scale[2]));
87 this->transX->setText(QString::number(trans[0] / scale[0]));
88 this->transY->setText(QString::number(trans[1] / scale[1]));
89 this->transZ->setText(QString::number(trans[2] / scale[2]));
90 this->scaleZ->blockSignals(
false);
91 this->transX->blockSignals(
false);
92 this->transY->blockSignals(
false);
93 this->transZ->blockSignals(
false);
99 QString activeAttribute =
_item->GetActiveAttribute();
100 if (activeAttribute.length() > 0)
102 for (
int i = 0; i < this->activeScalarComboBox->count(); i++)
104 QString itemText = this->activeScalarComboBox->itemText(i);
105 if (itemText.compare(activeAttribute) == 0)
107 this->activeScalarComboBox->setCurrentIndex(i);
116 actorPropertiesGroupBox->setEnabled(
false);
120 transform->GetOriginTranslation(trans);
121 this->transX->blockSignals(
true);
122 this->transY->blockSignals(
true);
123 this->transZ->blockSignals(
true);
124 this->transX->setText(QString::number(trans[0]));
125 this->transY->setText(QString::number(trans[1]));
126 this->transZ->setText(QString::number(trans[2]));
127 this->transX->blockSignals(
false);
128 this->transY->blockSignals(
false);
129 this->transZ->blockSignals(
false);
138 actorPropertiesGroupBox->setEnabled(
false);
139 transformTabWidget->setEnabled(
false);
140 this->activeScalarComboBox->clear();
241 static_cast<QFormLayout*
>(this->scrollAreaWidgetContents->layout());
242 while (layout->count())
244 delete layout->takeAt(0)->widget();
247 QMap<QString, QVariant>* propMap =
nullptr;
248 QMap<QString, QList<QVariant>>* propVecMap =
nullptr;
251 if (algProps ==
nullptr)
252 WARN(
"VtkAlgorithmProperties null!");
273 QMapIterator<QString, QVariant> i(*propMap);
277 QString key = i.key();
278 QVariant value = i.value();
282 switch (value.type())
284 case QVariant::Double:
286 QString::number(value.toDouble()), key,
287 QVariant::Double, algProps);
288 connect(lineEdit, SIGNAL(editingFinished()),
this,
290 layout->addRow(key, lineEdit);
295 QString::number(value.toInt()), key, QVariant::Int,
297 connect(lineEdit, SIGNAL(editingFinished()),
this,
299 layout->addRow(key, lineEdit);
305 connect(checkbox, SIGNAL(stateChanged(
int)),
this,
307 layout->addRow(key, checkbox);
318 QMapIterator<QString, QList<QVariant>> i(*propVecMap);
322 QString key = i.key();
323 QList<QVariant> values = i.value();
327 QList<QString> valuesAsString;
328 foreach (QVariant variant, values)
329 valuesAsString.push_back(variant.toString());
333 valuesAsString, key, values.front().type(), algProps);
334 connect(vectorEdit, SIGNAL(editingFinished()),
this,
336 layout->addRow(key, vectorEdit);
345 dataSetAttributesList.push_back(
"Solid Color");
346 this->activeScalarComboBox->blockSignals(
true);
347 this->activeScalarComboBox->clear();
348 this->activeScalarComboBox->insertItems(0, dataSetAttributesList);
349 this->activeScalarComboBox->blockSignals(
false);
351 QList<QString>::iterator it = dataSetAttributesList.begin();
352 if (active_array_name.length() == 0)
359 for (it = dataSetAttributesList.begin();
360 it != dataSetAttributesList.end();
363 if (active_array_name.compare((*it).right((*it).length() - 2)) == 0)
365 this->activeScalarComboBox->setCurrentIndex(idx);