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 email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
20 #include "PartSet_WidgetSketchLabel.h"
21 #include "PartSet_Tools.h"
22 #include "PartSet_Module.h"
23 #include "PartSet_PreviewPlanes.h"
25 #include "SketchPlugin_SketchEntity.h"
27 #include <XGUI_Workshop.h>
28 #include <XGUI_Displayer.h>
29 #include <XGUI_SelectionMgr.h>
30 #include <XGUI_Selection.h>
31 #include <XGUI_ViewerProxy.h>
32 #include <XGUI_ActionsMgr.h>
33 #include <XGUI_Tools.h>
34 #include <XGUI_ModuleConnector.h>
36 #include <ModuleBase_Operation.h>
37 #include <ModuleBase_ViewerPrs.h>
38 #include <ModuleBase_Tools.h>
39 #include <ModuleBase_IModule.h>
41 #include <ModelAPI_ResultBody.h>
42 #include <ModelAPI_Tools.h>
44 #include <GeomAlgoAPI_FaceBuilder.h>
45 #include <GeomAlgoAPI_ShapeTools.h>
46 #include <GeomDataAPI_Point.h>
47 #include <GeomDataAPI_Dir.h>
48 #include <GeomAPI_XYZ.h>
49 #include <GeomAPI_Face.h>
51 #include <SketchPlugin_Sketch.h>
52 #include <SketcherPrs_Tools.h>
54 #include <Precision.hxx>
58 #include <AIS_Shape.hxx>
59 #include <AIS_DimensionSelectionMode.hxx>
60 #include <Bnd_Box.hxx>
62 #include <Config_WidgetAPI.h>
63 #include <Config_PropManager.h>
66 #include <QApplication>
67 #include <QVBoxLayout>
68 #include <QHBoxLayout>
71 #include <QPushButton>
72 #include <QStackedWidget>
74 #include <QDoubleValidator>
77 #define DBL_MAX 1.7976931348623158e+308
80 PartSet_WidgetSketchLabel::PartSet_WidgetSketchLabel(QWidget* theParent,
81 ModuleBase_IWorkshop* theWorkshop,
82 const Config_WidgetAPI* theData,
83 const QMap<PartSet_Tools::ConstraintVisibleState, bool>& toShowConstraints)
84 : ModuleBase_WidgetValidated(theParent, theWorkshop, theData)
86 QVBoxLayout* aLayout = new QVBoxLayout(this);
87 ModuleBase_Tools::zeroMargins(aLayout);
89 myStackWidget = new QStackedWidget(this);
90 myStackWidget->setContentsMargins(0,0,0,0);
91 aLayout->addWidget(myStackWidget);
93 // Define label for plane selection
94 QWidget* aFirstWgt = new QWidget(this);
96 // Size of the View control
97 mySizeOfViewWidget = new QWidget(aFirstWgt);
98 QHBoxLayout* aSizeLayout = new QHBoxLayout(mySizeOfViewWidget);
99 aSizeLayout->addWidget(new QLabel("Size of the view", mySizeOfViewWidget));
100 mySizeOfView = new QLineEdit(mySizeOfViewWidget);
102 QDoubleValidator* aValidator = new QDoubleValidator(0, DBL_MAX, 12, mySizeOfView);
103 aValidator->setLocale(ModuleBase_Tools::doubleLocale());
104 aValidator->setNotation(QDoubleValidator::StandardNotation);
105 mySizeOfView->setValidator(aValidator);
106 aSizeLayout->addWidget(mySizeOfView);
108 QString aText = QString::fromStdString(theData->getProperty("title"));
109 QLabel* aLabel = new QLabel(aText, aFirstWgt);
110 aLabel->setWordWrap(true);
111 QString aTooltip = QString::fromStdString(theData->getProperty("tooltip"));
112 aLabel->setToolTip(aTooltip);
113 aLabel->setIndent(5);
115 aLayout = new QVBoxLayout(aFirstWgt);
116 ModuleBase_Tools::zeroMargins(aLayout);
117 aLayout->addWidget(mySizeOfViewWidget);
118 aLayout->addWidget(aLabel);
119 aLayout->addStretch(1);
121 myStackWidget->addWidget(aFirstWgt);
123 // Define widget for sketch manmagement
124 QWidget* aSecondWgt = new QWidget(this);
125 aLayout = new QVBoxLayout(aSecondWgt);
126 ModuleBase_Tools::zeroMargins(aLayout);
128 QGroupBox* aViewBox = new QGroupBox(tr("Sketcher plane"), this);
129 QVBoxLayout* aViewLayout = new QVBoxLayout(aViewBox);
131 myViewInverted = new QCheckBox(tr("Reversed"), aViewBox);
132 aViewLayout->addWidget(myViewInverted);
134 QPushButton* aSetViewBtn =
135 new QPushButton(QIcon(":icons/plane_view.png"), tr("Set plane view"), aViewBox);
136 connect(aSetViewBtn, SIGNAL(clicked(bool)), this, SLOT(onSetPlaneView()));
137 aViewLayout->addWidget(aSetViewBtn);
139 aLayout->addWidget(aViewBox);
141 QMap<PartSet_Tools::ConstraintVisibleState, QString> aStates;
142 aStates[PartSet_Tools::Geometrical] = tr("Show geometrical constraints");
143 aStates[PartSet_Tools::Dimensional] = tr("Show dimensional constraints");
144 aStates[PartSet_Tools::Expressions] = tr("Show existing expressions");
146 QMap<PartSet_Tools::ConstraintVisibleState, QString>::const_iterator anIt = aStates.begin(),
147 aLast = aStates.end();
148 for (; anIt != aLast; anIt++) {
149 QCheckBox* aShowConstraints = new QCheckBox(anIt.value(), this);
150 connect(aShowConstraints, SIGNAL(toggled(bool)), this, SLOT(onShowConstraint(bool)));
151 aLayout->addWidget(aShowConstraints);
153 PartSet_Tools::ConstraintVisibleState aState = anIt.key();
154 myShowConstraints[aState] = aShowConstraints;
156 if (toShowConstraints.contains(aState))
157 aShowConstraints->setChecked(toShowConstraints[aState]);
160 myStackWidget->addWidget(aSecondWgt);
161 //setLayout(aLayout);
163 myPreviewPlanes = new PartSet_PreviewPlanes();
166 PartSet_WidgetSketchLabel::~PartSet_WidgetSketchLabel()
170 bool PartSet_WidgetSketchLabel::setSelection(QList<ModuleBase_ViewerPrsPtr>& theValues,
171 const bool theToValidate)
173 // do not use the given selection if the plane of the sketch has been already set.
174 // If this check is absent, a selected plane in the viewer can be set in the sketch
175 // even if the sketch is built on another plane.
179 ModuleBase_ViewerPrsPtr aPrs = theValues.first();
180 bool aDone = setSelectionInternal(theValues, theToValidate);
182 updateByPlaneSelected(aPrs);
186 QList<QWidget*> PartSet_WidgetSketchLabel::getControls() const
188 QList<QWidget*> aResult;
189 aResult << myStackWidget;
193 void PartSet_WidgetSketchLabel::onSelectionChanged()
195 QList<ModuleBase_ViewerPrsPtr> aSelected = getFilteredSelected();
197 if (aSelected.empty())
199 ModuleBase_ViewerPrsPtr aPrs = aSelected.first();
200 bool aDone = setSelectionInternal(aSelected, false);
202 updateByPlaneSelected(aPrs);
203 updateObject(myFeature);
207 void PartSet_WidgetSketchLabel::onShowConstraint(bool theOn)
209 QCheckBox* aSenderCheckBox = qobject_cast<QCheckBox*>(sender());
211 QMap<PartSet_Tools::ConstraintVisibleState, QCheckBox*>::const_iterator
212 anIt = myShowConstraints.begin(), aLast = myShowConstraints.end();
214 PartSet_Tools::ConstraintVisibleState aState = PartSet_Tools::Geometrical;
216 for (; anIt != aLast && !aFound; anIt++) {
217 aFound = anIt.value() == aSenderCheckBox;
222 emit showConstraintToggled(aState, theOn);
225 void PartSet_WidgetSketchLabel::blockAttribute(const AttributePtr& theAttribute,
226 const bool& theToBlock, bool& isFlushesActived,
227 bool& isAttributeSetInitializedBlocked,
228 bool& isAttributeSendUpdatedBlocked)
230 ModuleBase_WidgetValidated::blockAttribute(theAttribute, theToBlock, isFlushesActived,
231 isAttributeSetInitializedBlocked,
232 isAttributeSendUpdatedBlocked);
233 // We do not restore the previous state of isAttributeSetInitializedBlocked for each of
234 // attributes. It it is necessary, these states should be append to the method attributes
235 // or stored in the widget
237 std::list<AttributePtr> anAttributes = myFeature->data()->attributes("");
238 std::list<AttributePtr>::const_iterator anIt = anAttributes.begin(), aLast = anAttributes.end();
240 for(; anIt != aLast; anIt++) {
241 AttributePtr anAttribute = *anIt;
243 anAttribute->blockSetInitialized(true);
245 anAttribute->blockSetInitialized(isAttributeSetInitializedBlocked);
249 bool PartSet_WidgetSketchLabel::setSelectionInternal(
250 const QList<ModuleBase_ViewerPrsPtr>& theValues,
251 const bool theToValidate)
254 if (theValues.empty()) {
255 // In order to make reselection possible, set empty object and shape should be done
256 setSelectionCustom(std::shared_ptr<ModuleBase_ViewerPrs>(
257 new ModuleBase_ViewerPrs(ObjectPtr(), GeomShapePtr(), NULL)));
261 // it removes the processed value from the parameters list
262 ModuleBase_ViewerPrsPtr aValue = theValues.first();//.takeFirst();
263 if (!theToValidate || isValidInFilters(aValue))
264 aDone = setSelectionCustom(aValue);
270 void PartSet_WidgetSketchLabel::updateByPlaneSelected(const ModuleBase_ViewerPrsPtr& thePrs)
272 // 1. hide main planes if they have been displayed
273 myPreviewPlanes->erasePreviewPlanes(myWorkshop);
274 // 2. if the planes were displayed, change the view projection
275 const GeomShapePtr& aShape = thePrs->shape();
276 std::shared_ptr<GeomAPI_Shape> aGShape;
278 DataPtr aData = feature()->data();
279 AttributeSelectionPtr aSelAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
280 (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID()));
282 // selection happens in OCC viewer
283 if (aShape.get() && !aShape->isNull()) {
286 else { // selection happens in OCC viewer(on body) of in the OB browser
288 aGShape = aSelAttr->value();
291 // If the selected object is a sketch then use its plane
292 std::shared_ptr<GeomAPI_Pln> aPlane;
293 ObjectPtr aObj = thePrs->object();
295 FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
296 if (aFeature.get() && (aFeature != feature())) {
297 if (aFeature->getKind() == SketchPlugin_Sketch::ID()) {
298 CompositeFeaturePtr aSketch =
299 std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFeature);
300 aPlane = PartSet_Tools::sketchPlane(aSketch);
304 if (aGShape.get() != NULL) {
305 // get plane parameters
307 std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aGShape));
308 aPlane = aFace->getPlane();
312 std::shared_ptr<GeomAPI_Dir> aDir = aPlane->direction();
313 gp_XYZ aXYZ = aDir->impl<gp_Dir>().XYZ();
316 // orienting projection is not needed: it is done in GeomAlgoAPI_FaceBuilder::plane
317 /*if (aGShape->impl<TopoDS_Shape>().Orientation() == TopAbs_REVERSED) {
321 // Rotate view if the sketcher plane is selected only from preview planes
322 // Preview planes are created only if there is no any shape
323 bool aRotate = Config_PropManager::boolean(SKETCH_TAB_NAME, "rotate_to_plane");
325 myWorkshop->viewer()->setViewProjection(aXYZ.X(), aXYZ.Y(), aXYZ.Z(), aTwist);
327 QString aSizeOfViewStr = mySizeOfView->text();
328 if (!aSizeOfViewStr.isEmpty()) {
330 double aSizeOfView = aSizeOfViewStr.toDouble(&isOk);
331 if (isOk && aSizeOfView > 0) {
332 Handle(V3d_View) aView3d = myWorkshop->viewer()->activeView();
333 if (!aView3d.IsNull()) {
335 double aHalfSize = aSizeOfView/2.0;
336 aBndBox.Update(-aHalfSize, -aHalfSize, -aHalfSize, aHalfSize, aHalfSize, aHalfSize);
337 aView3d->FitAll(aBndBox, 0.01, false);
341 PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
343 aModule->onViewTransformed();
345 // 3. Clear text in the label
346 myStackWidget->setCurrentIndex(1);
347 //myLabel->setText("");
348 //myLabel->setToolTip("");
349 XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myWorkshop);
350 disconnect(aWorkshop->selector(), SIGNAL(selectionChanged()),
351 this, SLOT(onSelectionChanged()));
352 // 4. deactivate face selection filter
353 activateFilters(false);
355 // 5. Clear selection mode and define sketching mode
356 emit planeSelected(plane());
357 // after the plane is selected in the sketch, the sketch selection should be activated
358 // it can not be performed in the sketch label widget because, we don't need to switch off
359 // the selection by any label deactivation, but need to switch it off by stop the sketch
360 activateSelection(true);
362 // 6. Update sketcher actions
363 XGUI_ActionsMgr* anActMgr = aWorkshop->actionsMgr();
365 myWorkshop->updateCommandStatus();
366 aWorkshop->selector()->clearSelection();
367 myWorkshop->viewer()->update();
370 std::shared_ptr<GeomAPI_Pln> PartSet_WidgetSketchLabel::plane() const
372 CompositeFeaturePtr aSketch = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(myFeature);
373 return PartSet_Tools::sketchPlane(aSketch);
376 bool PartSet_WidgetSketchLabel::focusTo()
378 ModuleBase_Tools::setFocus(myStackWidget, "PartSet_WidgetSketchLabel::focusTo()");
382 void PartSet_WidgetSketchLabel::enableFocusProcessing()
384 myStackWidget->installEventFilter(this);
387 void PartSet_WidgetSketchLabel::storeAttributeValue(const AttributePtr& theAttribute)
389 ModuleBase_WidgetValidated::storeAttributeValue(theAttribute);
392 void PartSet_WidgetSketchLabel::restoreAttributeValue(const AttributePtr& theAttribute,
395 ModuleBase_WidgetValidated::restoreAttributeValue(theAttribute, theValid);
397 // it is not necessary to save the previous plane value because the plane is chosen once
398 DataPtr aData = feature()->data();
399 AttributeSelectionPtr aSelAttr = std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
400 (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID()));
402 ResultPtr anEmptyResult;
403 GeomShapePtr anEmptyShape;
404 aSelAttr->setValue(anEmptyResult, anEmptyShape);
408 bool PartSet_WidgetSketchLabel::setSelectionCustom(const ModuleBase_ViewerPrsPtr& thePrs)
410 return fillSketchPlaneBySelection(thePrs);
413 bool PartSet_WidgetSketchLabel::canFillSketch(const ModuleBase_ViewerPrsPtr& thePrs)
415 bool aCanFillSketch = true;
416 // avoid any selection on sketch object
417 ObjectPtr anObject = thePrs->object();
418 ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObject);
420 FeaturePtr aFeature = ModelAPI_Feature::feature(aResult);
421 if (aFeature->getKind() == SketchPlugin_Sketch::ID())
422 aCanFillSketch = false;
424 // check plane or planar face of any non-sketch object
425 if (aCanFillSketch) {
426 std::shared_ptr<GeomAPI_Face> aGeomFace;
428 GeomShapePtr aGeomShape = thePrs->shape();
429 if ((!aGeomShape.get() || aGeomShape->isNull()) && aResult.get()) {
430 aGeomShape = aResult->shape();
433 if (aGeomShape.get() && aGeomShape->shapeType() == GeomAPI_Shape::FACE) {
434 std::shared_ptr<GeomAPI_Face> aGeomFace(new GeomAPI_Face(aGeomShape));
435 aCanFillSketch = aGeomFace.get() && aGeomFace->isPlanar();
438 aCanFillSketch = false;
440 return aCanFillSketch;
443 bool PartSet_WidgetSketchLabel::fillSketchPlaneBySelection(const ModuleBase_ViewerPrsPtr& thePrs)
445 bool isOwnerSet = false;
447 const GeomShapePtr& aShape = thePrs->shape();
448 std::shared_ptr<GeomAPI_Dir> aDir;
450 if (thePrs->object() && (feature() != thePrs->object())) {
451 FeaturePtr aFeature = ModelAPI_Feature::feature(thePrs->object());
452 if (aFeature.get() && (aFeature != feature())) {
453 if (aFeature->getKind() == SketchPlugin_Sketch::ID()) {
454 CompositeFeaturePtr aSketch =
455 std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFeature);
456 std::shared_ptr<GeomAPI_Pln> aPlane = PartSet_Tools::sketchPlane(aSketch);
458 aDir = setSketchPlane(aPlane);
463 DataPtr aData = feature()->data();
464 AttributeSelectionPtr aSelAttr =
465 std::dynamic_pointer_cast<ModelAPI_AttributeSelection>
466 (aData->attribute(SketchPlugin_SketchEntity::EXTERNAL_ID()));
468 ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(thePrs->object());
470 GeomShapePtr aShapePtr(new GeomAPI_Shape());
471 if (!aShape.get() || aShape->isNull()) { // selection happens in the OCC viewer
472 aShapePtr = ModelAPI_Tools::shape(aRes);
474 else { // selection happens in OB browser
477 if (aShapePtr.get() != NULL) {
478 aSelAttr->setValue(aRes, aShapePtr);
484 else if (aShape.get() && !aShape->isNull()) {
485 const TopoDS_Shape& aTDShape = aShape->impl<TopoDS_Shape>();
486 aDir = setSketchPlane(aTDShape);
487 isOwnerSet = aDir.get();
492 void PartSet_WidgetSketchLabel::activateCustom()
494 std::shared_ptr<GeomAPI_Pln> aPlane = plane();
496 myStackWidget->setCurrentIndex(1);
497 activateSelection(true);
501 myStackWidget->setCurrentIndex(0);
502 bool aBodyIsVisualized = myPreviewPlanes->hasVisualizedBodies(myWorkshop);
504 // Clear previous selection mode It is necessary for correct activation of preview planes
505 XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myWorkshop);
506 XGUI_Displayer* aDisp = aWorkshop->displayer();
507 aDisp->activateObjects(QIntList(), aDisp->displayedObjects(), false);
509 if (!aBodyIsVisualized) {
510 // We have to select a plane before any operation
511 myPreviewPlanes->showPreviewPlanes(myWorkshop);
512 mySizeOfViewWidget->setVisible(true);
515 mySizeOfViewWidget->setVisible(false);
517 activateSelection(true);
519 connect(XGUI_Tools::workshop(myWorkshop)->selector(), SIGNAL(selectionChanged()),
520 this, SLOT(onSelectionChanged()));
521 activateFilters(true);
524 void PartSet_WidgetSketchLabel::deactivate()
526 ModuleBase_ModelWidget::deactivate();
527 bool aHidePreview = myPreviewPlanes->isPreviewDisplayed();
528 myPreviewPlanes->erasePreviewPlanes(myWorkshop);
529 activateSelection(false);
531 activateFilters(false);
533 myWorkshop->viewer()->update();
536 void PartSet_WidgetSketchLabel::activateSelection(bool toActivate)
540 std::shared_ptr<GeomAPI_Pln> aPlane = plane();
542 myWorkshop->module()->activeSelectionModes(aModes);
545 aModes << TopAbs_FACE;
547 myWorkshop->activateSubShapesSelection(aModes);
549 myWorkshop->deactivateSubShapesSelection();
554 std::shared_ptr<GeomAPI_Dir>
555 PartSet_WidgetSketchLabel::setSketchPlane(const TopoDS_Shape& theShape)
557 if (theShape.IsNull())
558 return std::shared_ptr<GeomAPI_Dir>();
560 // get selected shape
561 std::shared_ptr<GeomAPI_Shape> aGShape(new GeomAPI_Shape);
562 aGShape->setImpl(new TopoDS_Shape(theShape));
564 // get plane parameters
565 std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aGShape));
566 std::shared_ptr<GeomAPI_Pln> aPlane = aFace->getPlane();
568 return std::shared_ptr<GeomAPI_Dir>();
569 return setSketchPlane(aPlane);
572 std::shared_ptr<GeomAPI_Dir>
573 PartSet_WidgetSketchLabel::setSketchPlane(std::shared_ptr<GeomAPI_Pln> thePlane)
575 // set plane parameters to feature
576 std::shared_ptr<ModelAPI_Data> aData = feature()->data();
577 double anA, aB, aC, aD;
578 thePlane->coefficients(anA, aB, aC, aD);
580 // calculate attributes of the sketch
581 std::shared_ptr<GeomAPI_Dir> aNormDir(new GeomAPI_Dir(anA, aB, aC));
582 std::shared_ptr<GeomAPI_XYZ> aCoords = aNormDir->xyz();
583 std::shared_ptr<GeomAPI_XYZ> aZero(new GeomAPI_XYZ(0, 0, 0));
584 aCoords = aCoords->multiplied(-aD * aCoords->distance(aZero));
585 std::shared_ptr<GeomAPI_Pnt> anOrigPnt(new GeomAPI_Pnt(aCoords));
586 // X axis is preferable to be dirX on the sketch
587 const double tol = Precision::Confusion();
588 bool isX = fabs(anA - 1.0) < tol && fabs(aB) < tol && fabs(aC) < tol;
589 std::shared_ptr<GeomAPI_Dir> aTempDir(
590 isX ? new GeomAPI_Dir(0, 1, 0) : new GeomAPI_Dir(1, 0, 0));
591 std::shared_ptr<GeomAPI_Dir> aYDir(new GeomAPI_Dir(aNormDir->cross(aTempDir)));
592 std::shared_ptr<GeomAPI_Dir> aXDir(new GeomAPI_Dir(aYDir->cross(aNormDir)));
594 std::shared_ptr<GeomDataAPI_Point> anOrigin = std::dynamic_pointer_cast<GeomDataAPI_Point>(
595 aData->attribute(SketchPlugin_Sketch::ORIGIN_ID()));
596 anOrigin->setValue(anOrigPnt);
597 std::shared_ptr<GeomDataAPI_Dir> aNormal = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
598 aData->attribute(SketchPlugin_Sketch::NORM_ID()));
599 aNormal->setValue(aNormDir);
600 std::shared_ptr<GeomDataAPI_Dir> aDirX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
601 aData->attribute(SketchPlugin_Sketch::DIRX_ID()));
602 aDirX->setValue(aXDir);
603 std::shared_ptr<GeomAPI_Dir> aDir = thePlane->direction();
607 void PartSet_WidgetSketchLabel::onSetPlaneView()
609 std::shared_ptr<GeomAPI_Pln> aPlane = plane();
611 std::shared_ptr<GeomAPI_Dir> aDirection = aPlane->direction();
612 gp_Dir aDir = aDirection->impl<gp_Dir>();
613 if (myViewInverted->isChecked())
615 myWorkshop->viewer()->setViewProjection(aDir.X(), aDir.Y(), aDir.Z(), 0.);
616 PartSet_Module* aModule = dynamic_cast<PartSet_Module*>(myWorkshop->module());
618 aModule->onViewTransformed();