9 #ifndef UI_PQCOLOROPACITYEDITORWIDGET_H 10 #define UI_PQCOLOROPACITYEDITORWIDGET_H 12 #include <QtCore/QVariant> 13 #include <QtGui/QIcon> 14 #include <QtWidgets/QApplication> 15 #include <QtWidgets/QCheckBox> 16 #include <QtWidgets/QFrame> 17 #include <QtWidgets/QHBoxLayout> 18 #include <QtWidgets/QHeaderView> 19 #include <QtWidgets/QLabel> 20 #include <QtWidgets/QSpacerItem> 21 #include <QtWidgets/QToolButton> 22 #include <QtWidgets/QVBoxLayout> 23 #include <QtWidgets/QWidget> 71 void setupUi(QWidget *ColorOpacityEditorWidget)
73 if (ColorOpacityEditorWidget->objectName().isEmpty())
74 ColorOpacityEditorWidget->setObjectName(QString::fromUtf8(
"ColorOpacityEditorWidget"));
75 ColorOpacityEditorWidget->resize(334, 774);
76 mainLayout =
new QVBoxLayout(ColorOpacityEditorWidget);
77 mainLayout->setSpacing(6);
78 mainLayout->setObjectName(QString::fromUtf8(
"mainLayout"));
79 horizontalLayout_2 =
new QHBoxLayout();
80 horizontalLayout_2->setSpacing(0);
81 horizontalLayout_2->setObjectName(QString::fromUtf8(
"horizontalLayout_2"));
82 verticalLayout =
new QVBoxLayout();
83 verticalLayout->setSpacing(0);
84 verticalLayout->setObjectName(QString::fromUtf8(
"verticalLayout"));
85 verticalLayout->setSizeConstraint(QLayout::SetMinimumSize);
87 OpacityEditor->setObjectName(QString::fromUtf8(
"OpacityEditor"));
88 OpacityEditor->setMinimumSize(QSize(0, 80));
90 verticalLayout->addWidget(OpacityEditor);
93 ColorEditor->setObjectName(QString::fromUtf8(
"ColorEditor"));
94 QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
95 sizePolicy.setHorizontalStretch(0);
96 sizePolicy.setVerticalStretch(0);
97 sizePolicy.setHeightForWidth(ColorEditor->sizePolicy().hasHeightForWidth());
98 ColorEditor->setSizePolicy(sizePolicy);
99 ColorEditor->setMinimumSize(QSize(40, 40));
100 ColorEditor->setMaximumSize(QSize(16777215, 40));
102 verticalLayout->addWidget(ColorEditor);
104 verticalLayout->setStretch(0, 1);
106 horizontalLayout_2->addLayout(verticalLayout);
108 verticalLayout_2 =
new QVBoxLayout();
109 verticalLayout_2->setSpacing(1);
110 verticalLayout_2->setObjectName(QString::fromUtf8(
"verticalLayout_2"));
111 ResetRangeToData =
new QToolButton(ColorOpacityEditorWidget);
112 ResetRangeToData->setObjectName(QString::fromUtf8(
"ResetRangeToData"));
114 icon.addFile(QString::fromUtf8(
":/pqWidgets/Icons/pqResetRange.svg"), QSize(), QIcon::Normal, QIcon::Off);
115 ResetRangeToData->setIcon(icon);
117 verticalLayout_2->addWidget(ResetRangeToData);
119 ResetRangeToCustom =
new QToolButton(ColorOpacityEditorWidget);
120 ResetRangeToCustom->setObjectName(QString::fromUtf8(
"ResetRangeToCustom"));
122 icon1.addFile(QString::fromUtf8(
":/pqWidgets/Icons/pqResetRangeCustom.svg"), QSize(), QIcon::Normal, QIcon::Off);
123 ResetRangeToCustom->setIcon(icon1);
125 verticalLayout_2->addWidget(ResetRangeToCustom);
127 ResetRangeToDataOverTime =
new QToolButton(ColorOpacityEditorWidget);
128 ResetRangeToDataOverTime->setObjectName(QString::fromUtf8(
"ResetRangeToDataOverTime"));
130 icon2.addFile(QString::fromUtf8(
":/pqWidgets/Icons/pqResetRangeTemporal.svg"), QSize(), QIcon::Normal, QIcon::Off);
131 ResetRangeToDataOverTime->setIcon(icon2);
133 verticalLayout_2->addWidget(ResetRangeToDataOverTime);
135 ResetRangeToVisibleData =
new QToolButton(ColorOpacityEditorWidget);
136 ResetRangeToVisibleData->setObjectName(QString::fromUtf8(
"ResetRangeToVisibleData"));
138 icon3.addFile(QString::fromUtf8(
":/pqWidgets/Icons/pqResetToVisibleRange.svg"), QSize(), QIcon::Normal, QIcon::Off);
139 ResetRangeToVisibleData->setIcon(icon3);
141 verticalLayout_2->addWidget(ResetRangeToVisibleData);
143 InvertTransferFunctions =
new QToolButton(ColorOpacityEditorWidget);
144 InvertTransferFunctions->setObjectName(QString::fromUtf8(
"InvertTransferFunctions"));
146 icon4.addFile(QString::fromUtf8(
":/pqWidgets/Icons/pqInvert.svg"), QSize(), QIcon::Normal, QIcon::Off);
147 InvertTransferFunctions->setIcon(icon4);
149 verticalLayout_2->addWidget(InvertTransferFunctions);
151 verticalSpacer =
new QSpacerItem(0, 1, QSizePolicy::Minimum, QSizePolicy::Expanding);
153 verticalLayout_2->addItem(verticalSpacer);
155 ChoosePreset =
new QToolButton(ColorOpacityEditorWidget);
156 ChoosePreset->setObjectName(QString::fromUtf8(
"ChoosePreset"));
158 icon5.addFile(QString::fromUtf8(
":/pqWidgets/Icons/pqFavorites.svg"), QSize(), QIcon::Normal, QIcon::Off);
159 ChoosePreset->setIcon(icon5);
161 verticalLayout_2->addWidget(ChoosePreset);
163 SaveAsPreset =
new QToolButton(ColorOpacityEditorWidget);
164 SaveAsPreset->setObjectName(QString::fromUtf8(
"SaveAsPreset"));
166 icon6.addFile(QString::fromUtf8(
":/pqWidgets/Icons/pqSave.svg"), QSize(), QIcon::Normal, QIcon::Off);
167 SaveAsPreset->setIcon(icon6);
169 verticalLayout_2->addWidget(SaveAsPreset);
172 ComputeDataHistogram->setObjectName(QString::fromUtf8(
"ComputeDataHistogram"));
173 ComputeDataHistogram->setEnabled(
false);
175 icon7.addFile(QString::fromUtf8(
":/pqWidgets/Icons/pqHistogramReload24.png"), QSize(), QIcon::Normal, QIcon::Off);
176 ComputeDataHistogram->setIcon(icon7);
178 verticalLayout_2->addWidget(ComputeDataHistogram);
180 AdvancedButton =
new QToolButton(ColorOpacityEditorWidget);
181 AdvancedButton->setObjectName(QString::fromUtf8(
"AdvancedButton"));
183 icon8.addFile(QString::fromUtf8(
":/pqWidgets/Icons/pqAdvanced.svg"), QSize(), QIcon::Normal, QIcon::Off);
184 AdvancedButton->setIcon(icon8);
185 AdvancedButton->setCheckable(
true);
187 verticalLayout_2->addWidget(AdvancedButton);
190 horizontalLayout_2->addLayout(verticalLayout_2);
192 horizontalLayout_2->setStretch(0, 1);
194 mainLayout->addLayout(horizontalLayout_2);
196 horizontalLayout =
new QHBoxLayout();
197 horizontalLayout->setObjectName(QString::fromUtf8(
"horizontalLayout"));
198 label =
new QLabel(ColorOpacityEditorWidget);
199 label->setObjectName(QString::fromUtf8(
"label"));
201 horizontalLayout->addWidget(label);
204 CurrentDataValue->setObjectName(QString::fromUtf8(
"CurrentDataValue"));
205 QSizePolicy sizePolicy1(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
206 sizePolicy1.setHorizontalStretch(0);
207 sizePolicy1.setVerticalStretch(0);
208 sizePolicy1.setHeightForWidth(CurrentDataValue->sizePolicy().hasHeightForWidth());
209 CurrentDataValue->setSizePolicy(sizePolicy1);
211 horizontalLayout->addWidget(CurrentDataValue);
213 horizontalLayout->setStretch(1, 1);
215 mainLayout->addLayout(horizontalLayout);
217 UseOpacityControlPointsFreehandDrawing =
new QCheckBox(ColorOpacityEditorWidget);
218 UseOpacityControlPointsFreehandDrawing->setObjectName(QString::fromUtf8(
"UseOpacityControlPointsFreehandDrawing"));
220 mainLayout->addWidget(UseOpacityControlPointsFreehandDrawing);
222 UseLogScale =
new QCheckBox(ColorOpacityEditorWidget);
223 UseLogScale->setObjectName(QString::fromUtf8(
"UseLogScale"));
225 mainLayout->addWidget(UseLogScale);
227 EnableOpacityMapping =
new QCheckBox(ColorOpacityEditorWidget);
228 EnableOpacityMapping->setObjectName(QString::fromUtf8(
"EnableOpacityMapping"));
230 mainLayout->addWidget(EnableOpacityMapping);
232 UseLogScaleOpacity =
new QCheckBox(ColorOpacityEditorWidget);
233 UseLogScaleOpacity->setObjectName(QString::fromUtf8(
"UseLogScaleOpacity"));
234 UseLogScaleOpacity->setEnabled(
false);
236 mainLayout->addWidget(UseLogScaleOpacity);
238 ColorLabel =
new QLabel(ColorOpacityEditorWidget);
239 ColorLabel->setObjectName(QString::fromUtf8(
"ColorLabel"));
240 QSizePolicy sizePolicy2(QSizePolicy::Preferred, QSizePolicy::Preferred);
241 sizePolicy2.setHorizontalStretch(0);
242 sizePolicy2.setVerticalStretch(0);
243 sizePolicy2.setHeightForWidth(ColorLabel->sizePolicy().hasHeightForWidth());
244 ColorLabel->setSizePolicy(sizePolicy2);
246 mainLayout->addWidget(ColorLabel);
249 ColorTable->setObjectName(QString::fromUtf8(
"ColorTable"));
250 ColorTable->setEditTriggers(QAbstractItemView::DoubleClicked);
251 ColorTable->setAlternatingRowColors(
true);
252 ColorTable->setSelectionBehavior(QAbstractItemView::SelectRows);
253 ColorTable->setProperty(
"maximumRowCountBeforeScrolling", QVariant(10));
255 mainLayout->addWidget(ColorTable);
257 OpacityLabel =
new QLabel(ColorOpacityEditorWidget);
258 OpacityLabel->setObjectName(QString::fromUtf8(
"OpacityLabel"));
260 mainLayout->addWidget(OpacityLabel);
263 OpacityTable->setObjectName(QString::fromUtf8(
"OpacityTable"));
264 OpacityTable->setEditTriggers(QAbstractItemView::DoubleClicked);
265 OpacityTable->setAlternatingRowColors(
true);
266 OpacityTable->setSelectionBehavior(QAbstractItemView::SelectRows);
267 OpacityTable->setProperty(
"maximumRowCountBeforeScrolling", QVariant(10));
269 mainLayout->addWidget(OpacityTable);
271 verticalLayout_3 =
new QVBoxLayout();
272 verticalLayout_3->setSpacing(0);
273 verticalLayout_3->setObjectName(QString::fromUtf8(
"verticalLayout_3"));
274 label_2 =
new QLabel(ColorOpacityEditorWidget);
275 label_2->setObjectName(QString::fromUtf8(
"label_2"));
276 label_2->setWordWrap(
true);
277 label_2->setAlignment(Qt::AlignBottom|Qt::AlignLeft);
279 verticalLayout_3->addWidget(label_2);
281 line =
new QFrame(ColorOpacityEditorWidget);
282 line->setObjectName(QString::fromUtf8(
"line"));
283 line->setFrameShape(QFrame::HLine);
284 line->setFrameShadow(QFrame::Sunken);
286 verticalLayout_3->addWidget(line);
289 mainLayout->addLayout(verticalLayout_3);
291 ShowDataHistogram =
new QCheckBox(ColorOpacityEditorWidget);
292 ShowDataHistogram->setObjectName(QString::fromUtf8(
"ShowDataHistogram"));
294 mainLayout->addWidget(ShowDataHistogram);
296 AutomaticDataHistogramComputation =
new QCheckBox(ColorOpacityEditorWidget);
297 AutomaticDataHistogramComputation->setObjectName(QString::fromUtf8(
"AutomaticDataHistogramComputation"));
299 mainLayout->addWidget(AutomaticDataHistogramComputation);
301 horizontalLayout1 =
new QHBoxLayout();
302 horizontalLayout1->setObjectName(QString::fromUtf8(
"horizontalLayout1"));
303 label1 =
new QLabel(ColorOpacityEditorWidget);
304 label1->setObjectName(QString::fromUtf8(
"label1"));
306 horizontalLayout1->addWidget(label1);
309 DataHistogramNumberOfBins->setObjectName(QString::fromUtf8(
"DataHistogramNumberOfBins"));
310 sizePolicy1.setHeightForWidth(DataHistogramNumberOfBins->sizePolicy().hasHeightForWidth());
311 DataHistogramNumberOfBins->setSizePolicy(sizePolicy1);
315 horizontalLayout1->addWidget(DataHistogramNumberOfBins);
317 horizontalLayout1->setStretch(1, 1);
319 mainLayout->addLayout(horizontalLayout1);
323 QObject::connect(EnableOpacityMapping, SIGNAL(toggled(
bool)), UseLogScaleOpacity, SLOT(setEnabled(
bool)));
325 QMetaObject::connectSlotsByName(ColorOpacityEditorWidget);
330 ColorOpacityEditorWidget->setWindowTitle(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Form",
nullptr));
331 #if QT_CONFIG(tooltip) 332 ResetRangeToData->setToolTip(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Rescale to data range",
nullptr));
333 #endif // QT_CONFIG(tooltip) 334 ResetRangeToData->setText(QString());
335 #if QT_CONFIG(tooltip) 336 ResetRangeToCustom->setToolTip(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Rescale to custom range",
nullptr));
337 #endif // QT_CONFIG(tooltip) 338 ResetRangeToCustom->setText(QString());
339 #if QT_CONFIG(tooltip) 340 ResetRangeToDataOverTime->setToolTip(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Rescale to data range over all timesteps",
nullptr));
341 #endif // QT_CONFIG(tooltip) 342 ResetRangeToDataOverTime->setText(QString());
343 #if QT_CONFIG(tooltip) 344 ResetRangeToVisibleData->setToolTip(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Rescale to visible range",
nullptr));
345 #endif // QT_CONFIG(tooltip) 346 ResetRangeToVisibleData->setText(QString());
347 #if QT_CONFIG(tooltip) 348 InvertTransferFunctions->setToolTip(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Invert the transfer functions",
nullptr));
349 #endif // QT_CONFIG(tooltip) 350 InvertTransferFunctions->setText(QString());
351 #if QT_CONFIG(tooltip) 352 ChoosePreset->setToolTip(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Choose preset",
nullptr));
353 #endif // QT_CONFIG(tooltip) 354 ChoosePreset->setText(QString());
355 #if QT_CONFIG(tooltip) 356 SaveAsPreset->setToolTip(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Save to preset",
nullptr));
357 #endif // QT_CONFIG(tooltip) 358 SaveAsPreset->setText(QString());
359 #if QT_CONFIG(tooltip) 360 ComputeDataHistogram->setToolTip(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Compute data histogram",
nullptr));
361 #endif // QT_CONFIG(tooltip) 362 ComputeDataHistogram->setText(QString());
363 #if QT_CONFIG(tooltip) 364 AdvancedButton->setToolTip(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Manually edit transfer functions",
nullptr));
365 #endif // QT_CONFIG(tooltip) 366 AdvancedButton->setText(QString());
367 label->setText(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Data:",
nullptr));
368 #if QT_CONFIG(tooltip) 369 UseOpacityControlPointsFreehandDrawing->setToolTip(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"<html><head/><body><p>When checked, the control point of the opacity transfer fonction can be \"drawn\" instead of being placed one by one.</p></body></html>",
nullptr));
370 #endif // QT_CONFIG(tooltip) 371 UseOpacityControlPointsFreehandDrawing->setText(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Enable freehand drawing of opacity transfer function",
nullptr));
372 #if QT_CONFIG(tooltip) 373 UseLogScale->setToolTip(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"<html><head/><body><p>When checked, the mapping from data to colors is done using a log-scale. Note that this does not affect the mapping of data to opacity.</p></body></html>",
nullptr));
374 #endif // QT_CONFIG(tooltip) 375 UseLogScale->setText(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Use log scale when mapping data to colors",
nullptr));
376 EnableOpacityMapping->setText(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Enable opacity mapping for surfaces",
nullptr));
377 UseLogScaleOpacity->setText(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Use log scale when mapping data to opacity",
nullptr));
378 ColorLabel->setText(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Color transfer function values",
nullptr));
379 OpacityLabel->setText(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Opacity transfer function values",
nullptr));
380 label_2->setText(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"<html><b>Data Histogram</b></html>",
nullptr));
381 #if QT_CONFIG(tooltip) 382 ShowDataHistogram->setToolTip(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"<html><head/><body><p>When checked, a data histogram will be shown below the opacity function. Please update it by clicking on its dedicated button when needed.</p></body></html>",
nullptr));
383 #endif // QT_CONFIG(tooltip) 384 ShowDataHistogram->setText(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Display data histogram",
nullptr));
385 #if QT_CONFIG(tooltip) 386 AutomaticDataHistogramComputation->setToolTip(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"<html><head/><body><p>When checked, the data histogram will be automatically recomputed when needed instead of needing to click on the compute data histogram button.</p></body></html>",
nullptr));
387 #endif // QT_CONFIG(tooltip) 388 AutomaticDataHistogramComputation->setText(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Automatically recompute data histogram",
nullptr));
389 label1->setText(QCoreApplication::translate(
"ColorOpacityEditorWidget",
"Number of bins:",
nullptr));
400 #endif // UI_PQCOLOROPACITYEDITORWIDGET_H
pqLineEdit subclass that supports a low precision view when inactive
pqExpandableTableView extends pqTableView to add support for the following features: ...