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 "PartSet_WidgetSketchLabel.h"
22 #include "PartSet_Tools.h"
23 #include "PartSet_Module.h"
24 #include "PartSet_PreviewPlanes.h"
26 #include "SketchPlugin_SketchEntity.h"
28 #include <XGUI_Workshop.h>
29 #include <XGUI_Displayer.h>
30 #include <XGUI_SelectionMgr.h>
31 #include <XGUI_Selection.h>
32 #include <XGUI_ViewerProxy.h>
33 #include <XGUI_ActionsMgr.h>
34 #include <XGUI_Tools.h>
35 #include <XGUI_ModuleConnector.h>
37 #include <ModuleBase_Operation.h>
38 #include <ModuleBase_ViewerPrs.h>
39 #include <ModuleBase_Tools.h>
40 #include <ModuleBase_IModule.h>
42 #include <ModelAPI_ResultBody.h>
43 #include <ModelAPI_Tools.h>
45 #include <GeomAlgoAPI_FaceBuilder.h>
46 #include <GeomAlgoAPI_ShapeTools.h>
47 #include <GeomDataAPI_Point.h>
48 #include <GeomDataAPI_Dir.h>
49 #include <GeomAPI_XYZ.h>
50 #include <GeomAPI_Face.h>
52 #include <SketchPlugin_Sketch.h>
53 #include <SketcherPrs_Tools.h>
55 #include <Precision.hxx>
59 #include <AIS_Shape.hxx>
60 #include <AIS_DimensionSelectionMode.hxx>
61 #include <Bnd_Box.hxx>
63 #include <Config_WidgetAPI.h>
64 #include <Config_PropManager.h>
67 #include <QApplication>
68 #include <QVBoxLayout>
69 #include <QHBoxLayout>
72 #include <QPushButton>
73 #include <QStackedWidget>
75 #include <QDoubleValidator>
78 #define DBL_MAX 1.7976931348623158e+308
81 PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel(QWidget* theParent,
82 ModuleBase_IWorkshop* theWorkshop,
83 const Config_WidgetAPI* theData,
84 const QMap<PartSet_Tools::ConstraintVisibleState, bool>& toShowConstraints)
85 : ModuleBase_WidgetValidated(theParent, theWorkshop, theData)
87 QVBoxLayout* aLayout = new QVBoxLayout(this);
88 ModuleBase_Tools::zeroMargins(aLayout);
90 myStackWidget = new QStackedWidget(this);
91 myStackWidget->setContentsMargins(0,0,0,0);
92 aLayout->addWidget(myStackWidget);
94 // Define label for plane selection
95 QWidget* aFirstWgt = new QWidget(this);
97 // Size of the View control
98 mySizeOfViewWidget = new QWidget(aFirstWgt);
99 QHBoxLayout* aSizeLayout = new QHBoxLayout(mySizeOfViewWidget);
100 aSizeLayout->addWidget(new QLabel("Size of the view", mySizeOfViewWidget));
101 mySizeOfView = new QLineEdit(mySizeOfViewWidget);
103 QDoubleValidator* aValidator = new QDoubleValidator(0, DBL_MAX, 12, mySizeOfView);
104 aValidator->setLocale(ModuleBase_Tools::doubleLocale());
105 aValidator->setNotation(QDoubleValidator::StandardNotation);
106 mySizeOfView->setValidator(aValidator);
107 aSizeLayout->addWidget(mySizeOfView);
109 QString aText = QString::fromStdString(theData->getProperty("title"));
110 QLabel* aLabel = new QLabel(aText, aFirstWgt);
111 aLabel->setWordWrap(true);
112 QString aTooltip = QString::fromStdString(theData->getProperty("tooltip"));
113 aLabel->setToolTip(aTooltip);
114 aLabel->setIndent(5);
116 aLayout = new QVBoxLayout(aFirstWgt);
117 ModuleBase_Tools::zeroMargins(aLayout);
118 aLayout->addWidget(mySizeOfViewWidget);
119 aLayout->addWidget(aLabel);
120 aLayout->addStretch(1);
122 myStackWidget->addWidget(aFirstWgt);
124 // Define widget for sketch manmagement
125 QWidget* aSecondWgt = new QWidget(this);
126 aLayout = new QVBoxLayout(aSecondWgt);
127 ModuleBase_Tools::zeroMargins(aLayout);
129 QGroupBox* aViewBox = new QGroupBox(tr("Sketcher plane"), this);
130 QVBoxLayout* aViewLayout = new QVBoxLayout(aViewBox);
132 myViewInverted = new QCheckBox(tr("Reversed"), aViewBox);
133 aViewLayout->addWidget(myViewInverted);
135 QPushButton* aSetViewBtn =
136 new QPushButton(QIcon(":icons/plane_view.png"), tr("Set plane view"), aViewBox);
137 connect(aSetViewBtn, SIGNAL(clicked(bool)), this, SLOT(onSetPlaneView()));
138 aViewLayout->addWidget(aSetViewBtn);
140 aLayout->addWidget(aViewBox);
142 QMap<PartSet_Tools::ConstraintVisibleState, QString> aStates;
143 aStates[PartSet_Tools::Geometrical] = tr("Show geometrical constraints");
144 aStates[PartSet_Tools::Dimensional] = tr("Show dimensional constraints");
145 aStates[PartSet_Tools::Expressions] = tr("Show existing expressions");
147 QMap<PartSet_Tools::ConstraintVisibleState, QString>::const_iterator anIt = aStates.begin(),
148 aLast = aStates.end();
149 for (; anIt != aLast; anIt++) {
150 QCheckBox* aShowConstraints = new QCheckBox(anIt.value(), this);
151 connect(aShowConstraints, SIGNAL(toggled(bool)), this, SLOT(onShowConstraint(bool)));
152 aLayout->addWidget(aShowConstraints);
154 PartSet_Tools::ConstraintVisibleState aState = anIt.key();
155 myShowConstraints[aState] = aShowConstraints;
157 if (toShowConstraints.contains(aState))
158 aShowConstraints->setChecked(toShowConstraints[aState]);
161 myStackWidget->addWidget(aSecondWgt);
162 //setLayout(aLayout);
164 myPreviewPlanes = new PartSet_PreviewPlanes();
167 PartSet_WidgetSketchLabel::~PartSet_WidgetSketchLabel()
171 bool PartSet_WidgetSketchLabel::setSelection(QList<ModuleBase_ViewerPrsPtr>& theValues,
172 const bool theToValidate)
174 // do not use the given selection if the plane of the sketch has been already set.
175 // If this check is absent, a selected plane in the viewer can be set in the sketch
176 // even if the sketch is built on another plane.
180 ModuleBase_ViewerPrsPtr aPrs = theValues.first();
181 bool aDone = setSelectionInternal(theValues, theToValidate);
183 updateByPlaneSelected(aPrs);
187 QList<QWidget*> PartSet_WidgetSketchLabel::getControls() const
189 QList<QWidget*> aResult;
190 aResult << myStackWidget;
194 void PartSet_WidgetSketchLabel::onSelectionChanged()
196 QList<ModuleBase_ViewerPrsPtr> aSelected = getFilteredSelected();
198 if (aSelected.empty())
200 ModuleBase_ViewerPrsPtr aPrs = aSelected.first();
201 bool aDone = setSelectionInternal(aSelected, false);
203 updateByPlaneSelected(aPrs);
204 updateObject(myFeature);
208 void PartSet_WidgetSketchLabel::onShowConstraint(bool theOn)
210 QCheckBox* aSenderCheckBox = qobject_cast<QCheckBox*>(sender());
212 QMap<PartSet_Tools::ConstraintVisibleState, QCheckBox*>::const_iterator
213 anIt = myShowConstraints.begin(), aLast = myShowConstraints.end();
215 PartSet_Tools::ConstraintVisibleState aState = PartSet_Tools::Geometrical;
217 for (; anIt != aLast && !aFound; anIt++) {
218 aFound = anIt.value() == aSenderCheckBox;
223 emit showConstraintToggled(aState, theOn);
226 void PartSet_WidgetSketchLabel::blockAttribute(const AttributePtr& theAttribute,
227 const bool& theToBlock, bool& isFlushesActived,
228 bool& isAttributeSetInitializedBlocked,
229 bool& isAttributeSendUpdatedBlocked)
231 ModuleBase_WidgetValidated::blockAttribute(theAttribute, theToBlock, isFlushesActived,
232 isAttributeSetInitializedBlocked,
233 isAttributeSendUpdatedBlocked);
234 // We do not restore the previous state of isAttributeSetInitializedBlocked for each of
235 // attributes. It it is necessary, these states should be append to the method attributes
236 // or stored in the widget
238 std::list<AttributePtr> anAttributes = myFeature->data()->attributes("");
239 std::list<AttributePtr>::const_iterator anIt = anAttributes.begin(), aLast = anAttributes.end();
241 for(; anIt != aLast; anIt++) {
242 AttributePtr anAttribute = *anIt;
244 anAttribute->blockSetInitialized(true);
246 anAttribute->blockSetInitialized(isAttributeSetInitializedBlocked);
250 bool PartSet_WidgetSketchLabel::setSelectionInternal(
251 const QList<ModuleBase_ViewerPrsPtr>& theValues,
252 const bool theToValidate)
255 if (theValues.empty()) {
256 // In order to make reselection possible, set empty object and shape should be done
257 setSelectionCustom(std::shared_ptr<ModuleBase_ViewerPrs>(
258 new ModuleBase_ViewerPrs(ObjectPtr(), GeomShapePtr(), NULL)));
262 // it removes the processed value from the parameters list
263 ModuleBase_ViewerPrsPtr aValue = theValues.first();//.takeFirst();
264 if (!theToValidate || isValidInFilters(aValue))
265 aDone = setSelectionCustom(aValue);
271 void PartSet_WidgetSketchLabel::updateByPlaneSelected(const ModuleBase_ViewerPrsPtr& thePrs)
273 // 1. hide main planes if they have been displayed
274 myPreviewPlanes->erasePreviewPlanes(myWorkshop);
275 // 2. if the planes were displayed, change the view projection
276 const GeomShapePtr& aShape = thePrs->shape();
277 std::shared_ptr<GeomAPI_Shape> aGShape;
279 DataPtr aData = feature()->data();
280 AttributeSelectionPtr aSelAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
281 (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID()));
283 // selection happens in OCC viewer
284 if (aShape.get() && !aShape->isNull()) {
287 else { // selection happens in OCC viewer(on body) of in the OB browser
289 aGShape = aSelAttr->value();
292 // If the selected object is a sketch then use its plane
293 std::shared_ptr<GeomAPI_Pln> aPlane;
294 ObjectPtr aObj = thePrs->object();
296 FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
297 if (aFeature.get() && (aFeature != feature())) {
298 if (aFeature->getKind() == SketchPlugin_Sketch::ID()) {
299 CompositeFeaturePtr aSketch =
300 std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFeature);
301 aPlane = PartSet_Tools::sketchPlane(aSketch);
305 if (aGShape.get() != NULL) {
306 // get plane parameters
308 std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aGShape));
309 aPlane = aFace->getPlane();
313 std::shared_ptr<GeomAPI_Dir> aDir = aPlane->direction();
314 gp_XYZ aXYZ = aDir->impl<gp_Dir>().XYZ();
317 // orienting projection is not needed: it is done in GeomAlgoAPI_FaceBuilder::plane
318 /*if (aGShape->impl<TopoDS_Shape>().Orientation() == TopAbs_REVERSED) {
322 // Rotate view if the sketcher plane is selected only from preview planes
323 // Preview planes are created only if there is no any shape
324 bool aRotate = Config_PropManager::boolean(SKETCH_TAB_NAME, "rotate_to_plane");
326 myWorkshop->viewer()->setViewProjection(aXYZ.X(), aXYZ.Y(), aXYZ.Z(), aTwist);
328 QString aSizeOfViewStr = mySizeOfView->text();
329 if (!aSizeOfViewStr.isEmpty()) {
331 double aSizeOfView = aSizeOfViewStr.toDouble(&isOk);
332 if (isOk && aSizeOfView > 0) {
333 Handle(V3d_View) aView3d = myWorkshop->viewer()->activeView();
334 if (!aView3d.IsNull()) {
336 double aHalfSize = aSizeOfView/2.0;
337 aBndBox.Update(-aHalfSize, -aHalfSize, -aHalfSize, aHalfSize, aHalfSize, aHalfSize);
338 aView3d->FitAll(aBndBox, 0.01, false);
342 PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
344 aModule->onViewTransformed();
346 // 3. Clear text in the label
347 myStackWidget->setCurrentIndex(1);
348 //myLabel->setText("");
349 //myLabel->setToolTip("");
350 XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myWorkshop);
351 disconnect(aWorkshop->selector(), SIGNAL(selectionChanged()),
352 this, SLOT(onSelectionChanged()));
353 // 4. deactivate face selection filter
354 activateFilters(false);
356 // 5. Clear selection mode and define sketching mode
357 emit planeSelected(plane());
358 // after the plane is selected in the sketch, the sketch selection should be activated
359 // it can not be performed in the sketch label widget because, we don't need to switch off
360 // the selection by any label deactivation, but need to switch it off by stop the sketch
361 activateSelection(true);
363 // 6. Update sketcher actions
364 XGUI_ActionsMgr* anActMgr = aWorkshop->actionsMgr();
366 myWorkshop->updateCommandStatus();
367 aWorkshop->selector()->clearSelection();
368 myWorkshop->viewer()->update();
371 std::shared_ptr<GeomAPI_Pln> PartSet_WidgetSketchLabel::plane() const
373 CompositeFeaturePtr aSketch = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(myFeature);
374 return PartSet_Tools::sketchPlane(aSketch);
377 bool PartSet_WidgetSketchLabel::focusTo()
379 ModuleBase_Tools::setFocus(myStackWidget, "PartSet_WidgetSketchLabel::focusTo()");
383 void PartSet_WidgetSketchLabel::enableFocusProcessing()
385 myStackWidget->installEventFilter(this);
388 void PartSet_WidgetSketchLabel::storeAttributeValue(const AttributePtr& theAttribute)
390 ModuleBase_WidgetValidated::storeAttributeValue(theAttribute);
393 void PartSet_WidgetSketchLabel::restoreAttributeValue(const AttributePtr& theAttribute,
396 ModuleBase_WidgetValidated::restoreAttributeValue(theAttribute, theValid);
398 // it is not necessary to save the previous plane value because the plane is chosen once
399 DataPtr aData = feature()->data();
400 AttributeSelectionPtr aSelAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
401 (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID()));
403 ResultPtr anEmptyResult;
404 GeomShapePtr anEmptyShape;
405 aSelAttr->setValue(anEmptyResult, anEmptyShape);
409 bool PartSet_WidgetSketchLabel::setSelectionCustom(const ModuleBase_ViewerPrsPtr& thePrs)
411 return fillSketchPlaneBySelection(thePrs);
414 bool PartSet_WidgetSketchLabel::canFillSketch(const ModuleBase_ViewerPrsPtr& thePrs)
416 bool aCanFillSketch = true;
417 // avoid any selection on sketch object
418 ObjectPtr anObject = thePrs->object();
419 ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
421 FeaturePtr aFeature = ModelAPI_Feature::feature(aResult);
422 if (aFeature->getKind() == SketchPlugin_Sketch::ID())
423 aCanFillSketch = false;
425 // check plane or planar face of any non-sketch object
426 if (aCanFillSketch) {
427 std::shared_ptr<GeomAPI_Face> aGeomFace;
429 GeomShapePtr aGeomShape = thePrs->shape();
430 if ((!aGeomShape.get() || aGeomShape->isNull()) && aResult.get()) {
431 aGeomShape = aResult->shape();
434 if (aGeomShape.get() && aGeomShape->shapeType() == GeomAPI_Shape::FACE) {
435 std::shared_ptr<GeomAPI_Face> aGeomFace(new GeomAPI_Face(aGeomShape));
436 aCanFillSketch = aGeomFace.get() && aGeomFace->isPlanar();
439 aCanFillSketch = false;
441 return aCanFillSketch;
444 bool PartSet_WidgetSketchLabel::fillSketchPlaneBySelection(const ModuleBase_ViewerPrsPtr& thePrs)
446 bool isOwnerSet = false;
448 const GeomShapePtr& aShape = thePrs->shape();
449 std::shared_ptr<GeomAPI_Dir> aDir;
451 if (thePrs->object() && (feature() != thePrs->object())) {
452 FeaturePtr aFeature = ModelAPI_Feature::feature(thePrs->object());
453 if (aFeature.get() && (aFeature != feature())) {
454 if (aFeature->getKind() == SketchPlugin_Sketch::ID()) {
455 CompositeFeaturePtr aSketch =
456 std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFeature);
457 std::shared_ptr<GeomAPI_Pln> aPlane = PartSet_Tools::sketchPlane(aSketch);
459 aDir = setSketchPlane(aPlane);
464 DataPtr aData = feature()->data();
465 AttributeSelectionPtr aSelAttr =
466 std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
467 (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID()));
469 ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(thePrs->object());
471 GeomShapePtr aShapePtr(new GeomAPI_Shape());
472 if (!aShape.get() || aShape->isNull()) { // selection happens in the OCC viewer
473 aShapePtr = ModelAPI_Tools::shape(aRes);
475 else { // selection happens in OB browser
478 if (aShapePtr.get() != NULL) {
479 aSelAttr->setValue(aRes, aShapePtr);
485 else if (aShape.get() && !aShape->isNull()) {
486 const TopoDS_Shape& aTDShape = aShape->impl<TopoDS_Shape>();
487 aDir = setSketchPlane(aTDShape);
488 isOwnerSet = aDir.get();
493 void PartSet_WidgetSketchLabel::activateCustom()
495 std::shared_ptr<GeomAPI_Pln> aPlane = plane();
497 myStackWidget->setCurrentIndex(1);
498 activateSelection(true);
502 myStackWidget->setCurrentIndex(0);
503 bool aBodyIsVisualized = myPreviewPlanes->hasVisualizedBodies(myWorkshop);
505 // Clear previous selection mode It is necessary for correct activation of preview planes
506 XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myWorkshop);
507 XGUI_Displayer* aDisp = aWorkshop->displayer();
508 aDisp->activateObjects(QIntList(), aDisp->displayedObjects(), false);
510 if (!aBodyIsVisualized) {
511 // We have to select a plane before any operation
512 myPreviewPlanes->showPreviewPlanes(myWorkshop);
513 mySizeOfViewWidget->setVisible(true);
516 mySizeOfViewWidget->setVisible(false);
518 activateSelection(true);
520 connect(XGUI_Tools::workshop(myWorkshop)->selector(), SIGNAL(selectionChanged()),
521 this, SLOT(onSelectionChanged()));
522 activateFilters(true);
525 void PartSet_WidgetSketchLabel::deactivate()
527 ModuleBase_ModelWidget::deactivate();
528 bool aHidePreview = myPreviewPlanes->isPreviewDisplayed();
529 myPreviewPlanes->erasePreviewPlanes(myWorkshop);
530 activateSelection(false);
532 activateFilters(false);
534 myWorkshop->viewer()->update();
537 void PartSet_WidgetSketchLabel::activateSelection(bool toActivate)
541 std::shared_ptr<GeomAPI_Pln> aPlane = plane();
543 myWorkshop->module()->activeSelectionModes(aModes);
546 aModes << TopAbs_FACE;
548 myWorkshop->activateSubShapesSelection(aModes);
550 myWorkshop->deactivateSubShapesSelection();
555 std::shared_ptr<GeomAPI_Dir>
556 PartSet_WidgetSketchLabel::setSketchPlane(const TopoDS_Shape& theShape)
558 if (theShape.IsNull())
559 return std::shared_ptr<GeomAPI_Dir>();
561 // get selected shape
562 std::shared_ptr<GeomAPI_Shape> aGShape(new GeomAPI_Shape);
563 aGShape->setImpl(new TopoDS_Shape(theShape));
565 // get plane parameters
566 std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aGShape));
567 std::shared_ptr<GeomAPI_Pln> aPlane = aFace->getPlane();
569 return std::shared_ptr<GeomAPI_Dir>();
570 return setSketchPlane(aPlane);
573 std::shared_ptr<GeomAPI_Dir>
574 PartSet_WidgetSketchLabel::setSketchPlane(std::shared_ptr<GeomAPI_Pln> thePlane)
576 // set plane parameters to feature
577 std::shared_ptr<ModelAPI_Data> aData = feature()->data();
578 double anA, aB, aC, aD;
579 thePlane->coefficients(anA, aB, aC, aD);
581 // calculate attributes of the sketch
582 std::shared_ptr<GeomAPI_Dir> aNormDir(new GeomAPI_Dir(anA, aB, aC));
583 std::shared_ptr<GeomAPI_XYZ> aCoords = aNormDir->xyz();
584 std::shared_ptr<GeomAPI_XYZ> aZero(new GeomAPI_XYZ(0, 0, 0));
585 aCoords = aCoords->multiplied(-aD * aCoords->distance(aZero));
586 std::shared_ptr<GeomAPI_Pnt> anOrigPnt(new GeomAPI_Pnt(aCoords));
587 // X axis is preferable to be dirX on the sketch
588 const double tol = Precision::Confusion();
589 bool isX = fabs(anA - 1.0) < tol && fabs(aB) < tol && fabs(aC) < tol;
590 std::shared_ptr<GeomAPI_Dir> aTempDir(
591 isX ? new GeomAPI_Dir(0, 1, 0) : new GeomAPI_Dir(1, 0, 0));
592 std::shared_ptr<GeomAPI_Dir> aYDir(new GeomAPI_Dir(aNormDir->cross(aTempDir)));
593 std::shared_ptr<GeomAPI_Dir> aXDir(new GeomAPI_Dir(aYDir->cross(aNormDir)));
595 std::shared_ptr<GeomDataAPI_Point> anOrigin = std::dynamic_pointer_cast<GeomDataAPI_Point>(
596 aData->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
597 anOrigin->setValue(anOrigPnt);
598 std::shared_ptr<GeomDataAPI_Dir> aNormal = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
599 aData->attribute(SketchPlugin_Sketch::NORM_ID()));
600 aNormal->setValue(aNormDir);
601 std::shared_ptr<GeomDataAPI_Dir> aDirX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
602 aData->attribute(SketchPlugin_Sketch::DIRX_ID()));
603 aDirX->setValue(aXDir);
604 std::shared_ptr<GeomAPI_Dir> aDir = thePlane->direction();
608 void PartSet_WidgetSketchLabel::onSetPlaneView()
610 std::shared_ptr<GeomAPI_Pln> aPlane = plane();
612 std::shared_ptr<GeomAPI_Dir> aDirection = aPlane->direction();
613 gp_Dir aDir = aDirection->impl<gp_Dir>();
614 if (myViewInverted->isChecked())
616 myWorkshop->viewer()->setViewProjection(aDir.X(), aDir.Y(), aDir.Z(), 0.);
617 PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
619 aModule->onViewTransformed();