9 #ifndef UI_PQCOORDINATEFRAMEPROPERTYWIDGET_H 10 #define UI_PQCOORDINATEFRAMEPROPERTYWIDGET_H 12 #include <QtCore/QVariant> 13 #include <QtWidgets/QAction> 14 #include <QtWidgets/QApplication> 15 #include <QtWidgets/QCheckBox> 16 #include <QtWidgets/QComboBox> 17 #include <QtWidgets/QGridLayout> 18 #include <QtWidgets/QHBoxLayout> 19 #include <QtWidgets/QLabel> 20 #include <QtWidgets/QSpacerItem> 21 #include <QtWidgets/QToolButton> 22 #include <QtWidgets/QVBoxLayout> 23 #include <QtWidgets/QWidget> 69 void setupUi(QWidget *CoordinateFramePropertyWidget)
71 if (CoordinateFramePropertyWidget->objectName().isEmpty())
72 CoordinateFramePropertyWidget->setObjectName(QString::fromUtf8(
"CoordinateFramePropertyWidget"));
73 CoordinateFramePropertyWidget->resize(400, 221);
74 actionAxisAlignWorld =
new QAction(CoordinateFramePropertyWidget);
75 actionAxisAlignWorld->setObjectName(QString::fromUtf8(
"actionAxisAlignWorld"));
76 actionAlignToCameraIn =
new QAction(CoordinateFramePropertyWidget);
77 actionAlignToCameraIn->setObjectName(QString::fromUtf8(
"actionAlignToCameraIn"));
78 actionAlignToCameraOut =
new QAction(CoordinateFramePropertyWidget);
79 actionAlignToCameraOut->setObjectName(QString::fromUtf8(
"actionAlignToCameraOut"));
80 actionRecenterOnBounds =
new QAction(CoordinateFramePropertyWidget);
81 actionRecenterOnBounds->setObjectName(QString::fromUtf8(
"actionRecenterOnBounds"));
82 actionUpdateToUserEntry =
new QAction(CoordinateFramePropertyWidget);
83 actionUpdateToUserEntry->setObjectName(QString::fromUtf8(
"actionUpdateToUserEntry"));
84 actionAlignToWorldX =
new QAction(CoordinateFramePropertyWidget);
85 actionAlignToWorldX->setObjectName(QString::fromUtf8(
"actionAlignToWorldX"));
86 actionAlignToWorldY =
new QAction(CoordinateFramePropertyWidget);
87 actionAlignToWorldY->setObjectName(QString::fromUtf8(
"actionAlignToWorldY"));
88 actionAlignToWorldZ =
new QAction(CoordinateFramePropertyWidget);
89 actionAlignToWorldZ->setObjectName(QString::fromUtf8(
"actionAlignToWorldZ"));
90 actionAlignCameraToAxis =
new QAction(CoordinateFramePropertyWidget);
91 actionAlignCameraToAxis->setObjectName(QString::fromUtf8(
"actionAlignCameraToAxis"));
92 verticalLayout =
new QVBoxLayout(CoordinateFramePropertyWidget);
93 verticalLayout->setObjectName(QString::fromUtf8(
"verticalLayout"));
94 horizontalLayout =
new QHBoxLayout();
95 horizontalLayout->setObjectName(QString::fromUtf8(
"horizontalLayout"));
96 show3DWidget =
new QCheckBox(CoordinateFramePropertyWidget);
97 show3DWidget->setObjectName(QString::fromUtf8(
"show3DWidget"));
98 show3DWidget->setChecked(
true);
100 horizontalLayout->addWidget(show3DWidget);
102 horizontalSpacer =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
104 horizontalLayout->addItem(horizontalSpacer);
106 actionButton =
new QToolButton(CoordinateFramePropertyWidget);
107 actionButton->setObjectName(QString::fromUtf8(
"actionButton"));
109 QBrush brush(QColor(154, 153, 150, 255));
110 brush.setStyle(Qt::SolidPattern);
111 palette.setBrush(QPalette::Active, QPalette::HighlightedText, brush);
112 palette.setBrush(QPalette::Inactive, QPalette::HighlightedText, brush);
113 palette.setBrush(QPalette::Disabled, QPalette::HighlightedText, brush);
114 actionButton->setPalette(palette);
115 actionButton->setPopupMode(QToolButton::InstantPopup);
117 horizontalLayout->addWidget(actionButton);
119 horizontalSpacer_2 =
new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
121 horizontalLayout->addItem(horizontalSpacer_2);
123 labelLockAxis =
new QLabel(CoordinateFramePropertyWidget);
124 labelLockAxis->setObjectName(QString::fromUtf8(
"labelLockAxis"));
126 horizontalLayout->addWidget(labelLockAxis);
128 lockAxis =
new QComboBox(CoordinateFramePropertyWidget);
129 lockAxis->addItem(QString());
130 lockAxis->addItem(QString());
131 lockAxis->addItem(QString());
132 lockAxis->addItem(QString());
133 lockAxis->setObjectName(QString::fromUtf8(
"lockAxis"));
134 QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
135 sizePolicy.setHorizontalStretch(0);
136 sizePolicy.setVerticalStretch(0);
137 sizePolicy.setHeightForWidth(lockAxis->sizePolicy().hasHeightForWidth());
138 lockAxis->setSizePolicy(sizePolicy);
140 horizontalLayout->addWidget(lockAxis);
143 verticalLayout->addLayout(horizontalLayout);
145 gridLayout =
new QGridLayout();
146 gridLayout->setObjectName(QString::fromUtf8(
"gridLayout"));
147 labelYAxis =
new QLabel(CoordinateFramePropertyWidget);
148 labelYAxis->setObjectName(QString::fromUtf8(
"labelYAxis"));
150 gridLayout->addWidget(labelYAxis, 2, 0, 1, 1);
153 originY->setObjectName(QString::fromUtf8(
"originY"));
155 gridLayout->addWidget(originY, 0, 2, 1, 1);
158 zAxisX->setObjectName(QString::fromUtf8(
"zAxisX"));
160 gridLayout->addWidget(zAxisX, 3, 1, 1, 1);
163 zAxisZ->setObjectName(QString::fromUtf8(
"zAxisZ"));
165 gridLayout->addWidget(zAxisZ, 3, 3, 1, 1);
168 originZ->setObjectName(QString::fromUtf8(
"originZ"));
170 gridLayout->addWidget(originZ, 0, 3, 1, 1);
172 labelOrigin =
new QLabel(CoordinateFramePropertyWidget);
173 labelOrigin->setObjectName(QString::fromUtf8(
"labelOrigin"));
175 gridLayout->addWidget(labelOrigin, 0, 0, 1, 1);
178 yAxisX->setObjectName(QString::fromUtf8(
"yAxisX"));
180 gridLayout->addWidget(yAxisX, 2, 1, 1, 1);
183 xAxisY->setObjectName(QString::fromUtf8(
"xAxisY"));
185 gridLayout->addWidget(xAxisY, 1, 2, 1, 1);
188 yAxisY->setObjectName(QString::fromUtf8(
"yAxisY"));
190 gridLayout->addWidget(yAxisY, 2, 2, 1, 1);
193 yAxisZ->setObjectName(QString::fromUtf8(
"yAxisZ"));
195 gridLayout->addWidget(yAxisZ, 2, 3, 1, 1);
198 zAxisY->setObjectName(QString::fromUtf8(
"zAxisY"));
200 gridLayout->addWidget(zAxisY, 3, 2, 1, 1);
203 originX->setObjectName(QString::fromUtf8(
"originX"));
205 gridLayout->addWidget(originX, 0, 1, 1, 1);
208 xAxisZ->setObjectName(QString::fromUtf8(
"xAxisZ"));
210 gridLayout->addWidget(xAxisZ, 1, 3, 1, 1);
212 labelXAxis =
new QLabel(CoordinateFramePropertyWidget);
213 labelXAxis->setObjectName(QString::fromUtf8(
"labelXAxis"));
215 gridLayout->addWidget(labelXAxis, 1, 0, 1, 1);
217 labelZAxis =
new QLabel(CoordinateFramePropertyWidget);
218 labelZAxis->setObjectName(QString::fromUtf8(
"labelZAxis"));
220 gridLayout->addWidget(labelZAxis, 3, 0, 1, 1);
223 xAxisX->setObjectName(QString::fromUtf8(
"xAxisX"));
225 gridLayout->addWidget(xAxisX, 1, 1, 1, 1);
227 acceptXAxis =
new QToolButton(CoordinateFramePropertyWidget);
228 acceptXAxis->setObjectName(QString::fromUtf8(
"acceptXAxis"));
230 QBrush brush1(QColor(224, 27, 36, 255));
231 brush1.setStyle(Qt::SolidPattern);
232 palette1.setBrush(QPalette::Active, QPalette::ButtonText, brush1);
233 QBrush brush2(QColor(223, 169, 171, 255));
234 brush2.setStyle(Qt::SolidPattern);
235 palette1.setBrush(QPalette::Active, QPalette::HighlightedText, brush2);
236 palette1.setBrush(QPalette::Inactive, QPalette::ButtonText, brush1);
237 palette1.setBrush(QPalette::Inactive, QPalette::HighlightedText, brush2);
238 QBrush brush3(QColor(146, 149, 149, 255));
239 brush3.setStyle(Qt::SolidPattern);
240 palette1.setBrush(QPalette::Disabled, QPalette::ButtonText, brush3);
241 palette1.setBrush(QPalette::Disabled, QPalette::HighlightedText, brush2);
242 acceptXAxis->setPalette(palette1);
243 acceptXAxis->setArrowType(Qt::NoArrow);
245 gridLayout->addWidget(acceptXAxis, 1, 4, 1, 1);
247 acceptYAxis =
new QToolButton(CoordinateFramePropertyWidget);
248 acceptYAxis->setObjectName(QString::fromUtf8(
"acceptYAxis"));
250 QBrush brush4(QColor(245, 194, 17, 255));
251 brush4.setStyle(Qt::SolidPattern);
252 palette2.setBrush(QPalette::Active, QPalette::ButtonText, brush4);
253 QBrush brush5(QColor(245, 230, 180, 255));
254 brush5.setStyle(Qt::SolidPattern);
255 palette2.setBrush(QPalette::Active, QPalette::HighlightedText, brush5);
256 palette2.setBrush(QPalette::Inactive, QPalette::ButtonText, brush4);
257 palette2.setBrush(QPalette::Inactive, QPalette::HighlightedText, brush5);
258 palette2.setBrush(QPalette::Disabled, QPalette::ButtonText, brush3);
259 palette2.setBrush(QPalette::Disabled, QPalette::HighlightedText, brush5);
260 acceptYAxis->setPalette(palette2);
262 gridLayout->addWidget(acceptYAxis, 2, 4, 1, 1);
264 acceptZAxis =
new QToolButton(CoordinateFramePropertyWidget);
265 acceptZAxis->setObjectName(QString::fromUtf8(
"acceptZAxis"));
267 QBrush brush6(QColor(38, 162, 105, 255));
268 brush6.setStyle(Qt::SolidPattern);
269 palette3.setBrush(QPalette::Active, QPalette::ButtonText, brush6);
270 QBrush brush7(QColor(185, 227, 208, 255));
271 brush7.setStyle(Qt::SolidPattern);
272 palette3.setBrush(QPalette::Active, QPalette::HighlightedText, brush7);
273 palette3.setBrush(QPalette::Inactive, QPalette::ButtonText, brush6);
274 palette3.setBrush(QPalette::Inactive, QPalette::HighlightedText, brush7);
275 palette3.setBrush(QPalette::Disabled, QPalette::ButtonText, brush3);
276 palette3.setBrush(QPalette::Disabled, QPalette::HighlightedText, brush7);
277 acceptZAxis->setPalette(palette3);
279 gridLayout->addWidget(acceptZAxis, 3, 4, 1, 1);
282 verticalLayout->addLayout(gridLayout);
284 QWidget::setTabOrder(show3DWidget, actionButton);
285 QWidget::setTabOrder(actionButton, lockAxis);
286 QWidget::setTabOrder(lockAxis, originX);
287 QWidget::setTabOrder(originX, originY);
288 QWidget::setTabOrder(originY, originZ);
289 QWidget::setTabOrder(originZ, xAxisX);
290 QWidget::setTabOrder(xAxisX, xAxisY);
291 QWidget::setTabOrder(xAxisY, xAxisZ);
292 QWidget::setTabOrder(xAxisZ, acceptXAxis);
293 QWidget::setTabOrder(acceptXAxis, yAxisX);
294 QWidget::setTabOrder(yAxisX, yAxisY);
295 QWidget::setTabOrder(yAxisY, yAxisZ);
296 QWidget::setTabOrder(yAxisZ, acceptYAxis);
297 QWidget::setTabOrder(acceptYAxis, zAxisX);
298 QWidget::setTabOrder(zAxisX, zAxisY);
299 QWidget::setTabOrder(zAxisY, zAxisZ);
300 QWidget::setTabOrder(zAxisZ, acceptZAxis);
304 QMetaObject::connectSlotsByName(CoordinateFramePropertyWidget);
309 CoordinateFramePropertyWidget->setWindowTitle(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Form",
nullptr));
310 actionAxisAlignWorld->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Align axes to world axes",
nullptr));
311 #if QT_CONFIG(tooltip) 312 actionAxisAlignWorld->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Click to reset the coordinate frame axes to the world X, Y, and Z axes.",
nullptr));
313 #endif // QT_CONFIG(tooltip) 314 actionAlignToCameraIn->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Align to Camera (In \342\250\202)",
nullptr));
315 #if QT_CONFIG(tooltip) 316 actionAlignToCameraIn->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Align the locked (or nearest otherwise) axis to the camera normal, pointing into the screen.",
nullptr));
317 #endif // QT_CONFIG(tooltip) 318 actionAlignToCameraOut->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Align to Camera (Out \342\250\200)",
nullptr));
319 #if QT_CONFIG(tooltip) 320 actionAlignToCameraOut->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Align the locked (or nearest otherwise) axis to the camera normal, pointing out of the screen.",
nullptr));
321 #endif // QT_CONFIG(tooltip) 322 actionRecenterOnBounds->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Recenter On Bounds",
nullptr));
323 #if QT_CONFIG(tooltip) 324 actionRecenterOnBounds->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Reset the origin of the frame to the center of the associated object's bounds and align the axes with the object's principal axes.",
nullptr));
325 #endif // QT_CONFIG(tooltip) 326 actionUpdateToUserEntry->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Update with entered values",
nullptr));
327 #if QT_CONFIG(tooltip) 328 actionUpdateToUserEntry->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Normalize the values to the left and apply them to the axis.",
nullptr));
329 #endif // QT_CONFIG(tooltip) 330 actionAlignToWorldX->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Align to world X",
nullptr));
331 #if QT_CONFIG(tooltip) 332 actionAlignToWorldX->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Align to the world coordinate X axis.",
nullptr));
333 #endif // QT_CONFIG(tooltip) 334 actionAlignToWorldY->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Align to world Y",
nullptr));
335 #if QT_CONFIG(tooltip) 336 actionAlignToWorldY->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Align to the world coordinate Y axis.",
nullptr));
337 #endif // QT_CONFIG(tooltip) 338 actionAlignToWorldZ->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Align to world Z",
nullptr));
339 #if QT_CONFIG(tooltip) 340 actionAlignToWorldZ->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Align to the world coordinate Z axis.",
nullptr));
341 #endif // QT_CONFIG(tooltip) 342 actionAlignCameraToAxis->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Make camera normal to axis",
nullptr));
343 #if QT_CONFIG(tooltip) 344 actionAlignCameraToAxis->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Align the camera looking down the locked or nearest axis toward the origin.",
nullptr));
345 #endif // QT_CONFIG(tooltip) 346 #if QT_CONFIG(tooltip) 347 show3DWidget->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Show the coordinate axes in the 3D render view.",
nullptr));
348 #endif // QT_CONFIG(tooltip) 349 show3DWidget->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Show",
nullptr));
350 #if QT_CONFIG(tooltip) 351 actionButton->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"<html><head/><body><p>Note: Use 'P' to pick a "Point" on the mesh or 'Ctrl+P' to snap to the closest mesh point. Use 'N' to align a vector with a surface "Normal" ( 'Ctrl+N' to snap to the closest mesh point's normal), if availiable. Use 'T' ('Ctrl+T') to point an axis "Toward" the clicked point (or its nearest mesh point).</p></body></html>",
nullptr));
352 #endif // QT_CONFIG(tooltip) 353 actionButton->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"\342\206\227",
nullptr));
354 labelLockAxis->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Lock:",
nullptr));
355 lockAxis->setItemText(0, QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"\342\200\223",
nullptr));
356 lockAxis->setItemText(1, QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"\342\227\211X",
nullptr));
357 lockAxis->setItemText(2, QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"\342\227\211Y",
nullptr));
358 lockAxis->setItemText(3, QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"\342\227\211Z",
nullptr));
360 #if QT_CONFIG(tooltip) 361 lockAxis->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"<html><head/><body><p>Select an axis to lock (or "\342\200\223" for none). When an axis is locked, editing other axes with the pointer will rotate them around the locked axis. When picking directions with a locked axis, the locked axis will always be modified (rather than the closest axis to the picked direction).</p></body></html>",
nullptr));
362 #endif // QT_CONFIG(tooltip) 363 #if QT_CONFIG(tooltip) 364 labelYAxis->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Click the button to the right of an axis to normalize manually-entered values to a unit-length vector. The axis values do not auto-update the widget because the normalization required would prevent you from entering a desired direction.",
nullptr));
365 #endif // QT_CONFIG(tooltip) 366 labelYAxis->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Y Axis",
nullptr));
367 labelOrigin->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Origin",
nullptr));
368 #if QT_CONFIG(tooltip) 369 labelXAxis->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Click the button to the right of an axis to normalize manually-entered values to a unit-length vector. The axis values do not auto-update the widget because the normalization required would prevent you from entering a desired direction.",
nullptr));
370 #endif // QT_CONFIG(tooltip) 371 labelXAxis->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"X Axis",
nullptr));
372 #if QT_CONFIG(tooltip) 373 labelZAxis->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Click the button to the right of an axis to normalize manually-entered values to a unit-length vector. The axis values do not auto-update the widget because the normalization required would prevent you from entering a desired direction.",
nullptr));
374 #endif // QT_CONFIG(tooltip) 375 labelZAxis->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Z Axis",
nullptr));
376 #if QT_CONFIG(tooltip) 377 acceptXAxis->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Normalize to unit length and set the X axis to point this direction.",
nullptr));
378 #endif // QT_CONFIG(tooltip) 379 acceptXAxis->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"\342\227\211",
nullptr));
380 #if QT_CONFIG(tooltip) 381 acceptYAxis->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Normalize to unit length and set the Y axis to point this direction.",
nullptr));
382 #endif // QT_CONFIG(tooltip) 383 acceptYAxis->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"\342\227\211",
nullptr));
384 #if QT_CONFIG(tooltip) 385 acceptZAxis->setToolTip(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"Normalize to unit length and set the Z axis to point this direction.",
nullptr));
386 #endif // QT_CONFIG(tooltip) 387 acceptZAxis->setText(QCoreApplication::translate(
"CoordinateFramePropertyWidget",
"\342\227\211",
nullptr));
398 #endif // UI_PQCOORDINATEFRAMEPROPERTYWIDGET_H
pqLineEdit subclass that supports a low precision view when inactive