1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #include "XGUI_InspectionPanel.h"
22 #include "XGUI_SelectionMgr.h"
23 #include "XGUI_Selection.h"
24 #include "XGUI_Tools.h"
26 #include <ModuleBase_ViewerPrs.h>
27 #include <ModuleBase_Tools.h>
29 #include <ModelAPI_Result.h>
31 #include <GeomAPI_Ax3.h>
32 #include <GeomAPI_Box.h>
33 #include <GeomAPI_Circ.h>
34 #include <GeomAPI_Cone.h>
35 #include <GeomAPI_Cylinder.h>
36 #include <GeomAPI_Edge.h>
37 #include <GeomAPI_Ellipse.h>
38 #include <GeomAPI_Face.h>
39 #include <GeomAPI_Pln.h>
40 #include <GeomAPI_Pnt.h>
41 #include <GeomAPI_Shell.h>
42 #include <GeomAPI_Solid.h>
43 #include <GeomAPI_Sphere.h>
44 #include <GeomAPI_Torus.h>
45 #include <GeomAPI_Vertex.h>
46 #include <GeomAPI_Wire.h>
49 #include <QScrollArea>
52 #include <QTableWidget>
53 #include <QHeaderView>
54 #include <QTextBrowser>
55 #include <QResizeEvent>
57 #include <BRepBndLib.hxx>
58 #include <TopoDS_Iterator.hxx>
59 #include <TopTools_MapOfShape.hxx>
60 #include <TopTools_ListOfShape.hxx>
61 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic
63 // ================ Auxiliary functions ================
64 #define TITLE(val) ("<b>" + (val) + "</b>")
66 static void appendPointToParameters(const QString& thePointTitle,
67 const GeomPointPtr& theCoord,
70 theParams += TITLE(thePointTitle) +
71 "<br> X: " + QString::number(theCoord->x()) +
72 "<br> Y: " + QString::number(theCoord->y()) +
73 "<br> Z: " + QString::number(theCoord->z()) +
77 static void appendDirToParameters(const QString& theDirTitle,
78 const GeomDirPtr& theDirection,
81 theParams += TITLE(theDirTitle) +
82 "<br> DX: " + QString::number(theDirection->x()) +
83 "<br> DY: " + QString::number(theDirection->y()) +
84 "<br> DZ: " + QString::number(theDirection->z()) +
88 static void appendGroupNameToParameters(const QString& theGroupTitle, QString& theParams)
90 theParams += TITLE(theGroupTitle) + "<br>";
93 static void appendNamedValueToParameters(const QString& theName,
94 const double theValue,
97 theParams += theName + ": " + QString::number(theValue) + "<br>";
100 static void appendNamedValueToParameters(const QString& theName,
104 theParams += theName + ": " + (theValue ? "True" : "False") + "<br>";
108 // ================ XGUI_InspectionPanel ================
110 XGUI_InspectionPanel::XGUI_InspectionPanel(QWidget* theParent, XGUI_SelectionMgr* theMgr)
111 : QDockWidget(theParent),
112 mySelectionMgr(theMgr)
114 setWindowTitle(tr("Inspection Panel"));
115 setObjectName(INSPECTION_PANEL);
116 setStyleSheet("::title { position: relative; padding-left: 5px; text-align: left center }");
118 QScrollArea* aScrollArea = new QScrollArea(this);
119 setWidget(aScrollArea);
121 // Create an internal widget
122 myMainWidget = new QWidget(aScrollArea);
124 myMainLayout = new QVBoxLayout(myMainWidget);
125 myMainLayout->setContentsMargins(5, 5, 5, 5);
127 QWidget* aNameWgt = new QWidget(myMainWidget);
128 QHBoxLayout* aNameLayout = new QHBoxLayout(aNameWgt);
129 aNameLayout->setContentsMargins(0, 0, 0, 0);
130 aNameLayout->addWidget(new QLabel(tr("Object"), aNameWgt));
131 myNameEdt = new QLineEdit(aNameWgt);
132 myNameEdt->setReadOnly(true);
133 aNameLayout->addWidget(myNameEdt);
135 myMainLayout->addWidget(aNameWgt);
137 // Table with sub-shapes
138 mySubShapesTab = new QTableWidget(9, 2, myMainWidget);
139 mySubShapesTab->setFocusPolicy(Qt::NoFocus);
140 mySubShapesTab->verticalHeader()->hide();
142 aTitles << tr("Sub-shapes") << tr("Number");
143 mySubShapesTab->setHorizontalHeaderLabels(aTitles);
145 QStringList aSubShapes;
146 aSubShapes << "SHAPE" << "COMPOUND" << "COMPSOLID" <<
147 "SOLID" << "SHELL" << "FACE" << "WIRE" << "EDGE" << "VERTEX";
149 foreach(QString aType, aSubShapes) {
150 QTableWidgetItem* aItem = new QTableWidgetItem(aType);
151 aItem->setFlags(Qt::ItemIsEnabled);
152 mySubShapesTab->setItem(i++, 0, aItem);
154 for (i = 0; i < 9; i++) {
155 QTableWidgetItem* aItem = new QTableWidgetItem("");
156 aItem->setFlags(Qt::ItemIsEnabled);
157 aItem->setTextAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
158 mySubShapesTab->setItem(i, 1, aItem);
160 mySubShapesTab->setColumnWidth(0, 90);
161 mySubShapesTab->setColumnWidth(1, 70);
163 mySubShapesTab->setMaximumWidth(170);
164 mySubShapesTab->setMinimumHeight(300);
166 myMainLayout->addWidget(mySubShapesTab);
169 QWidget* aTypeWgt = new QWidget(myMainWidget);
170 QHBoxLayout* aTypeLayout = new QHBoxLayout(aTypeWgt);
171 aTypeLayout->setContentsMargins(0, 0, 0, 0);
173 aTypeLayout->addWidget(new QLabel(tr("Type:"), aTypeWgt));
174 myTypeLbl = new QLabel("", aTypeWgt);
175 aTypeLayout->addWidget(myTypeLbl);
177 myMainLayout->addWidget(aTypeWgt);
179 myTypeParams = new QTextBrowser(myMainWidget);
180 myTypeParams->setFixedWidth(170);
181 myTypeParams->setReadOnly(true);
182 myTypeParams->setFocusPolicy(Qt::NoFocus);
183 myTypeParams->setFrameStyle(QFrame::NoFrame);
184 myTypeParams->viewport()->setBackgroundRole(QPalette::Window);
186 myMainLayout->addWidget(myTypeParams, 1);
188 aScrollArea->setWidget(myMainWidget);
190 connect(mySelectionMgr, SIGNAL(selectionChanged()), SLOT(onSelectionChanged()));
193 //********************************************************************
194 XGUI_InspectionPanel::~XGUI_InspectionPanel()
198 //********************************************************************
199 void XGUI_InspectionPanel::setSubShapeValue(SudShape theId, int theVal)
201 mySubShapesTab->item(theId, 1)->setText(QString::number(theVal));
204 //********************************************************************
205 void XGUI_InspectionPanel::clearContent()
208 for (int i = 0; i <= VertexId; i++) {
209 mySubShapesTab->item((SudShape)i, 1)->setText("");
211 myTypeLbl->setText("");
215 //********************************************************************
216 void XGUI_InspectionPanel::onSelectionChanged()
219 XGUI_Selection* aSelection = mySelectionMgr->selection();
220 QList<ModuleBase_ViewerPrsPtr> aSelectedList =
221 aSelection->getSelected(ModuleBase_ISelection::Viewer);
223 QList<ModuleBase_ViewerPrsPtr> anOBSelected =
224 aSelection->getSelected(ModuleBase_ISelection::Browser);
225 if (!anOBSelected.isEmpty())
226 ModuleBase_ISelection::appendSelected(anOBSelected, aSelectedList);
228 if (aSelectedList.count() > 0) {
229 ModuleBase_ViewerPrsPtr aPrs = aSelectedList.first();
230 TopoDS_Shape aShape = ModuleBase_Tools::getSelectedShape(aPrs);
231 if (aShape.IsNull()) {
232 ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aPrs->object());
234 GeomShapePtr aShpPtr = aRes->shape();
236 aShape = aShpPtr->impl<TopoDS_Shape>();
242 GeomShapePtr aShapePtr(new GeomAPI_Shape());
243 aShapePtr->setImpl(new TopoDS_Shape(aShape));
245 ModuleBase_ViewerPrsPtr aPrsCopy(new ModuleBase_ViewerPrs(aPrs->object(), aShapePtr));
246 setName(XGUI_Tools::generateName(aPrsCopy));
247 setShapeContent(aShape);
248 setShapeParams(aShape);
252 //********************************************************************
253 void XGUI_InspectionPanel::setName(const QString& theName)
255 myNameEdt->setText(theName);
258 //********************************************************************
259 void XGUI_InspectionPanel::setShapeContent(const TopoDS_Shape& theShape)
263 int iType, nbTypes[TopAbs_SHAPE];
264 for (iType = 0; iType < TopAbs_SHAPE; ++iType) {
267 nbTypes[theShape.ShapeType()]++;
269 TopTools_MapOfShape aMapOfShape;
270 aMapOfShape.Add(theShape);
271 TopTools_ListOfShape aListOfShape;
272 aListOfShape.Append(theShape);
274 TopTools_ListIteratorOfListOfShape itL(aListOfShape);
275 for (; itL.More(); itL.Next()) {
276 TopoDS_Shape sp = itL.Value();
277 TopoDS_Iterator it(sp);
278 for (; it.More(); it.Next()) {
279 TopoDS_Shape s = it.Value();
280 if (aMapOfShape.Add(s)) {
281 aListOfShape.Append(s);
282 nbTypes[s.ShapeType()]++;
286 setSubShapeValue(VertexId, nbTypes[TopAbs_VERTEX]);
287 setSubShapeValue(EdgeId, nbTypes[TopAbs_EDGE]);
288 setSubShapeValue(WireId, nbTypes[TopAbs_WIRE]);
289 setSubShapeValue(FaceId, nbTypes[TopAbs_FACE]);
290 setSubShapeValue(ShellId, nbTypes[TopAbs_SHELL]);
291 setSubShapeValue(SolidId, nbTypes[TopAbs_SOLID]);
292 setSubShapeValue(CompsolidId, nbTypes[TopAbs_COMPSOLID]);
293 setSubShapeValue(CompoundId, nbTypes[TopAbs_COMPOUND]);
294 setSubShapeValue(ShapeId, aMapOfShape.Extent());
296 catch (Standard_Failure) {
300 //********************************************************************
301 void XGUI_InspectionPanel::setShapeParams(const TopoDS_Shape& theShape)
303 GeomShapePtr aShape(new GeomAPI_Shape);
304 aShape->setImpl(new TopoDS_Shape(theShape));
306 switch (aShape->shapeType()) {
307 case GeomAPI_Shape::VERTEX:
308 fillVertex(aShape->vertex());
310 case GeomAPI_Shape::EDGE:
311 fillEdge(aShape->edge());
313 case GeomAPI_Shape::FACE:
314 fillFace(aShape->face());
316 case GeomAPI_Shape::SOLID:
317 fillSolid(aShape->solid());
319 case GeomAPI_Shape::WIRE:
320 fillWire(aShape->wire());
322 case GeomAPI_Shape::SHELL:
323 fillShell(aShape->shell());
325 case GeomAPI_Shape::COMPSOLID:
326 case GeomAPI_Shape::COMPOUND:
327 fillContainer(aShape);
332 //********************************************************************
333 void XGUI_InspectionPanel::fillVertex(const GeomVertexPtr& theVertex)
335 GeomPointPtr aPoint = theVertex->point();
337 myTypeLbl->setText(tr("Vertex"));
340 appendPointToParameters(tr("Coordinates"), aPoint, aParams);
341 setParamsText(aParams);
344 //********************************************************************
345 void XGUI_InspectionPanel::fillEdge(const GeomEdgePtr& theEdge)
348 if (theEdge->isDegenerated())
349 appendNamedValueToParameters(tr("Degenerated"), true, aParams);
351 GeomPointPtr aStartPnt = theEdge->firstPoint();
352 GeomPointPtr aEndPnt = theEdge->lastPoint();
353 bool addStartEndPoints = false;
355 if (theEdge->isLine()) {
356 myTypeLbl->setText(tr("Line segment"));
357 addStartEndPoints = true;
360 GeomCirclePtr aCircle = theEdge->circle();
362 addStartEndPoints = aStartPnt->distance(aEndPnt) >= Precision::Confusion();
363 if (addStartEndPoints)
364 myTypeLbl->setText("Arc of circle");
366 myTypeLbl->setText("Circle");
368 appendPointToParameters(tr("Center"), aCircle->center(), aParams);
369 appendDirToParameters(tr("Normal"), aCircle->normal(), aParams);
370 appendGroupNameToParameters(tr("Dimensions"), aParams);
371 appendNamedValueToParameters(tr("Radius"), aCircle->radius(), aParams);
374 GeomEllipsePtr anEllipse = theEdge->ellipse();
376 addStartEndPoints = aStartPnt->distance(aEndPnt) >= Precision::Confusion();
377 if (addStartEndPoints)
378 myTypeLbl->setText("Arc of ellipse");
380 myTypeLbl->setText("Ellipse");
382 appendPointToParameters(tr("Center"), anEllipse->center(), aParams);
383 appendDirToParameters(tr("Normal"), anEllipse->normal(), aParams);
384 appendGroupNameToParameters(tr("Dimensions"), aParams);
385 appendNamedValueToParameters(tr("Major radius"), anEllipse->majorRadius(), aParams);
386 appendNamedValueToParameters(tr("Minor radius"), anEllipse->minorRadius(), aParams);
390 myTypeLbl->setText(tr("Edge"));
394 if (addStartEndPoints) {
395 appendPointToParameters(tr("Start point"), aStartPnt, aParams);
396 appendPointToParameters(tr("End point"), aEndPnt, aParams);
398 setParamsText(aParams);
401 //********************************************************************
402 void XGUI_InspectionPanel::fillWire(const GeomWirePtr& theWire)
405 appendNamedValueToParameters(tr("Closed"), theWire->isClosed(), aParams);
407 // check the wire is a polygon
408 std::list<GeomPointPtr> aPolygonPoints;
409 if (theWire->isPolygon(aPolygonPoints)) {
410 myTypeLbl->setText(tr("Polygon"));
411 int aCornerIndex = 0;
412 for (std::list<GeomPointPtr>::const_iterator aPtIt = aPolygonPoints.begin();
413 aPtIt != aPolygonPoints.end(); ++aPtIt)
414 appendPointToParameters(tr("Point") + " " + QString::number(++aCornerIndex),
418 myTypeLbl->setText(tr("Wire"));
420 setParamsText(aParams);
423 //********************************************************************
424 void XGUI_InspectionPanel::fillFace(const GeomFacePtr& theFace)
427 // 1. Plane and planar faces
428 GeomPlanePtr aPlane = theFace->getPlane();
430 bool isCommonCase = true;
431 // Check face bounded by circle or ellipse
432 std::list<GeomShapePtr> aSubs = theFace->subShapes(GeomAPI_Shape::EDGE);
433 if (aSubs.size() == 1) {
434 GeomEdgePtr anEdge = aSubs.front()->edge();
435 if (anEdge->isCircle() || anEdge->isEllipse()) {
437 isCommonCase = false;
441 // Check face bounded by a single wire which is rectangle
442 aSubs = theFace->subShapes(GeomAPI_Shape::WIRE);
443 if (aSubs.size() == 1) {
444 GeomWirePtr aWire = aSubs.front()->wire();
445 std::list<GeomPointPtr> aCorners;
446 if (aWire->isRectangle(aCorners)) {
447 GeomPointPtr aBaseCorner = aCorners.front();
448 aCorners.pop_front();
450 double aWidth = aBaseCorner->distance(aCorners.front());
451 double aHeight = aBaseCorner->distance(aCorners.back());
453 myTypeLbl->setText(tr("Rectangle"));
454 appendPointToParameters(tr("Corner"), aBaseCorner, aParams);
455 appendDirToParameters(tr("Normal"), aPlane->direction(), aParams);
456 appendGroupNameToParameters(tr("Dimensions"), aParams);
457 appendNamedValueToParameters(tr("Width"), aWidth, aParams);
458 appendNamedValueToParameters(tr("Height"), aHeight, aParams);
459 setParamsText(aParams);
461 isCommonCase = false;
467 setPlaneType(tr("Plane"), aPlane);
471 GeomSpherePtr aSphere = theFace->getSphere();
473 setSphereType(tr("Sphere"), aSphere);
476 GeomCylinderPtr aCylinder = theFace->getCylinder();
478 setCylinderType(tr("Cylinder"), aCylinder);
481 GeomConePtr aCone = theFace->getCone();
483 setConeType(tr("Cone"), aCone);
486 GeomTorusPtr aTorus = theFace->getTorus();
488 setTorusType(tr("Torus"), aTorus);
491 myTypeLbl->setText(tr("Face"));
498 //********************************************************************
499 void XGUI_InspectionPanel::fillShell(const GeomShellPtr& theShell)
502 GeomSpherePtr aSphere = theShell->getSphere();
504 setSphereType(tr("Sphere"), aSphere);
507 GeomCylinderPtr aCylinder = theShell->getCylinder();
509 setCylinderType(tr("Cylinder"), aCylinder);
512 GeomConePtr aCone = theShell->getCone();
514 setConeType(tr("Cone"), aCone);
517 GeomTorusPtr aTorus = theShell->getTorus();
519 setTorusType(tr("Torus"), aTorus);
521 // 5. Axis-aligned/Rotated Box
522 GeomBoxPtr aBox = theShell->getParallelepiped();
524 if (aBox->isAxesAligned())
525 setBoxType(tr("Box"), aBox);
527 setRotatedBoxType(tr("Rotated Box"), aBox);
531 myTypeLbl->setText(tr("Shell"));
538 //********************************************************************
539 void XGUI_InspectionPanel::fillSolid(const GeomSolidPtr& theSolid)
542 GeomSpherePtr aSphere = theSolid->getSphere();
544 setSphereType(tr("Sphere"), aSphere);
547 GeomCylinderPtr aCylinder = theSolid->getCylinder();
549 setCylinderType(tr("Cylinder"), aCylinder);
552 GeomConePtr aCone = theSolid->getCone();
554 setConeType(tr("Cone"), aCone);
557 GeomTorusPtr aTorus = theSolid->getTorus();
559 setTorusType(tr("Torus"), aTorus);
561 // 5. Axis-aligned/Rotated Box
562 GeomBoxPtr aBox = theSolid->getParallelepiped();
564 if (aBox->isAxesAligned())
565 setBoxType(tr("Box"), aBox);
567 setRotatedBoxType(tr("Rotated Box"), aBox);
571 myTypeLbl->setText(tr("Solid"));
578 //********************************************************************
579 void XGUI_InspectionPanel::fillContainer(const GeomShapePtr& theShape)
581 if (theShape->shapeType() == GeomAPI_Shape::COMPSOLID)
582 myTypeLbl->setText("CompSolid");
583 else if (theShape->shapeType() == GeomAPI_Shape::COMPOUND)
584 myTypeLbl->setText("Compound");
587 TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
589 BRepBndLib::Add(aShape, aBB);
594 gp_Pnt aMinPnt = aBB.CornerMin();
595 GeomPointPtr aMinPoint(new GeomAPI_Pnt(aMinPnt.X(), aMinPnt.Y(), aMinPnt.Z()));
597 gp_Pnt aMaxPnt = aBB.CornerMax();
598 GeomPointPtr aMaxPoint(new GeomAPI_Pnt(aMaxPnt.X(), aMaxPnt.Y(), aMaxPnt.Z()));
601 appendGroupNameToParameters(tr("Bounding box"), aParams);
602 appendPointToParameters(tr("Minimal corner"), aMinPoint, aParams);
603 appendPointToParameters(tr("Maximal corner"), aMaxPoint, aParams);
606 void XGUI_InspectionPanel::setPlaneType(const QString& theTitle,
607 const std::shared_ptr<GeomAPI_Pln>& thePlane)
609 myTypeLbl->setText(theTitle);
611 appendPointToParameters(tr("Origin"), thePlane->location(), aParams);
612 appendDirToParameters(tr("Normal"), thePlane->direction(), aParams);
613 setParamsText(aParams);
616 void XGUI_InspectionPanel::setSphereType(const QString& theTitle,
617 const std::shared_ptr<GeomAPI_Sphere>& theSphere)
619 myTypeLbl->setText(theTitle);
621 appendPointToParameters(tr("Center"), theSphere->center(), aParams);
622 appendGroupNameToParameters(tr("Dimensions"), aParams);
623 appendNamedValueToParameters(tr("Radius"), theSphere->radius(), aParams);
624 setParamsText(aParams);
627 void XGUI_InspectionPanel::setCylinderType(const QString& theTitle,
628 const std::shared_ptr<GeomAPI_Cylinder>& theCyl)
630 myTypeLbl->setText(theTitle);
632 appendPointToParameters(tr("Position"), theCyl->location(), aParams);
633 appendDirToParameters(tr("Axis"), theCyl->axis(), aParams);
634 appendGroupNameToParameters(tr("Dimensions"), aParams);
635 appendNamedValueToParameters(tr("Radius"), theCyl->radius(), aParams);
636 appendNamedValueToParameters(tr("Height"), theCyl->height(), aParams);
637 setParamsText(aParams);
640 void XGUI_InspectionPanel::setConeType(const QString& theTitle,
641 const std::shared_ptr<GeomAPI_Cone>& theCone)
643 myTypeLbl->setText(theTitle);
645 appendPointToParameters(tr("Position"), theCone->location(), aParams);
646 appendDirToParameters(tr("Axis"), theCone->axis(), aParams);
647 appendGroupNameToParameters(tr("Dimensions"), aParams);
648 appendNamedValueToParameters(tr("Radius 1"), theCone->radius1(), aParams);
649 appendNamedValueToParameters(tr("Radius 2"), theCone->radius2(), aParams);
650 appendNamedValueToParameters(tr("Height"), theCone->height(), aParams);
651 setParamsText(aParams);
654 void XGUI_InspectionPanel::setTorusType(const QString& theTitle,
655 const std::shared_ptr<GeomAPI_Torus>& theTorus)
657 myTypeLbl->setText(theTitle);
659 appendPointToParameters(tr("Center"), theTorus->center(), aParams);
660 appendDirToParameters(tr("Axis"), theTorus->direction(), aParams);
661 appendGroupNameToParameters(tr("Dimensions"), aParams);
662 appendNamedValueToParameters(tr("Major radius"), theTorus->majorRadius(), aParams);
663 appendNamedValueToParameters(tr("Minor radius"), theTorus->minorRadius(), aParams);
664 setParamsText(aParams);
667 void XGUI_InspectionPanel::setBoxType(const QString& theTitle,
668 const std::shared_ptr<GeomAPI_Box>& theBox)
670 myTypeLbl->setText(theTitle);
672 appendPointToParameters(tr("Position"), theBox->axes()->origin(), aParams);
673 appendGroupNameToParameters(tr("Dimensions"), aParams);
674 appendNamedValueToParameters(tr("Width"), theBox->width(), aParams);
675 appendNamedValueToParameters(tr("Depth"), theBox->depth(), aParams);
676 appendNamedValueToParameters(tr("Height"), theBox->height(), aParams);
677 setParamsText(aParams);
680 void XGUI_InspectionPanel::setRotatedBoxType(const QString& theTitle,
681 const std::shared_ptr<GeomAPI_Box>& theBox)
683 myTypeLbl->setText(theTitle);
685 std::shared_ptr<GeomAPI_Ax3> anAxes = theBox->axes();
686 appendPointToParameters(tr("Position"), anAxes->origin(), aParams);
687 appendDirToParameters(tr("Z axis"), anAxes->normal(), aParams);
688 appendDirToParameters(tr("X axis"), anAxes->dirX(), aParams);
689 appendGroupNameToParameters(tr("Dimensions"), aParams);
690 appendNamedValueToParameters(tr("Width"), theBox->width(), aParams);
691 appendNamedValueToParameters(tr("Depth"), theBox->depth(), aParams);
692 appendNamedValueToParameters(tr("Height"), theBox->height(), aParams);
693 setParamsText(aParams);
697 void XGUI_InspectionPanel::setParamsText(const QString& theText)
699 myTypeParams->setText(theText);
702 void XGUI_InspectionPanel::resizeEvent(QResizeEvent* theEvent)
704 QSize aSize = theEvent->size();
706 int aHeight = aSize.height();
708 if (aHeight > 450) // 450 is a a minimal height
709 myMainWidget->setFixedHeight(aHeight - 30);