1 // Copyright (C) 2014-2019 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
20 #include "XGUI_ViewerProxy.h"
21 #include "XGUI_Workshop.h"
22 #include "XGUI_SalomeConnector.h"
23 #include "XGUI_Displayer.h"
26 #include <AppElements_MainWindow.h>
27 #include <AppElements_ViewPort.h>
28 #include <AppElements_ViewWindow.h>
29 #include <AppElements_Viewer.h>
32 #include <ModuleBase_IViewWindow.h>
33 #include <ModuleBase_Preferences.h>
34 #include <GeomAPI_Shape.h>
35 #include <ModelAPI_ResultConstruction.h>
37 #include <Config_PropManager.h>
39 #include <SUIT_ResourceMgr.h>
40 #include <AIS_Shape.hxx>
41 #include <StdSelect_BRepOwner.hxx>
47 #define HIGHLIGHT_COLOR Quantity_NOC_YELLOW
49 XGUI_ViewerProxy::XGUI_ViewerProxy(XGUI_Workshop* theParent)
50 : ModuleBase_IViewer(theParent),
55 void XGUI_ViewerProxy::connectViewProxy()
58 connect(myWorkshop->salomeConnector()->viewer(), SIGNAL(trihedronVisibilityChanged(bool)),
59 SIGNAL(trihedronVisibilityChanged(bool)));
61 connect(myWorkshop->mainWindow()->viewer(), SIGNAL(trihedronVisibilityChanged(bool)),
62 SIGNAL(trihedronVisibilityChanged(bool)));
66 Handle(AIS_InteractiveContext) XGUI_ViewerProxy::AISContext() const
68 Handle(AIS_InteractiveContext) aContext;
70 aContext = myWorkshop->salomeConnector()->viewer()->AISContext();
72 aContext = myWorkshop->mainWindow()->viewer()->AISContext();
77 Handle(AIS_Trihedron) XGUI_ViewerProxy::trihedron() const
80 return myWorkshop->salomeConnector()->viewer()->trihedron();
82 return myWorkshop->mainWindow()->viewer()->trihedron();
86 Handle(V3d_Viewer) XGUI_ViewerProxy::v3dViewer() const
89 return myWorkshop->salomeConnector()->viewer()->v3dViewer();
91 return myWorkshop->mainWindow()->viewer()->v3dViewer();
95 Handle(V3d_View) XGUI_ViewerProxy::activeView() const
98 return myWorkshop->salomeConnector()->viewer()->activeView();
100 AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
101 return (aViewer->activeViewWindow()) ?
102 aViewer->activeViewWindow()->viewPortApp()->getView() :
107 QWidget* XGUI_ViewerProxy::activeViewPort() const
110 return myWorkshop->salomeConnector()->viewer()->activeViewPort();
112 AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
113 return (aViewer->activeViewWindow()) ?
114 aViewer->activeViewWindow()->viewPortApp(): 0;
118 void XGUI_ViewerProxy::setViewProjection(double theX, double theY, double theZ, double theTwist)
120 Handle(V3d_View) aView3d = activeView();
121 if (!aView3d.IsNull()) {
122 aView3d->SetProj(theX, theY, theZ);
123 aView3d->SetTwist( theTwist );
124 aView3d->FitAll(0.01, false);
125 aView3d->SetZSize(0.);
126 if (aView3d->Depth() < 0.1)
127 aView3d->DepthFitAll();
131 void XGUI_ViewerProxy::fitAll()
134 myWorkshop->salomeConnector()->viewer()->fitAll();
136 AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
137 if (aViewer->activeViewWindow())
138 aViewer->activeViewWindow()->viewPortApp()->fitAll();
142 void XGUI_ViewerProxy::eraseAll()
145 myWorkshop->salomeConnector()->viewer()->eraseAll();
150 void XGUI_ViewerProxy::connectToViewer()
153 ModuleBase_IViewer* aViewer = myWorkshop->salomeConnector()->viewer();
155 connect(aViewer, SIGNAL(lastViewClosed()), this, SIGNAL(lastViewClosed()));
156 connect(aViewer, SIGNAL(tryCloseView(ModuleBase_IViewWindow*)),
157 this, SIGNAL(tryCloseView(ModuleBase_IViewWindow*)));
159 connect(aViewer, SIGNAL(deleteView(ModuleBase_IViewWindow*)),
160 this, SIGNAL(deleteView(ModuleBase_IViewWindow*)));
162 connect(aViewer, SIGNAL(viewCreated(ModuleBase_IViewWindow*)),
163 this, SLOT(onViewCreated(ModuleBase_IViewWindow*)));
165 connect(aViewer, SIGNAL(activated(ModuleBase_IViewWindow*)),
166 this, SIGNAL(activated(ModuleBase_IViewWindow*)));
168 connect(aViewer, SIGNAL(mousePress(ModuleBase_IViewWindow*, QMouseEvent*)),
169 this, SIGNAL(mousePress(ModuleBase_IViewWindow*, QMouseEvent*)));
171 connect(aViewer, SIGNAL(mouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)),
172 this, SIGNAL(mouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)));
174 connect(aViewer, SIGNAL(mouseDoubleClick(ModuleBase_IViewWindow*, QMouseEvent*)), this,
175 SIGNAL(mouseDoubleClick(ModuleBase_IViewWindow*, QMouseEvent*)));
177 connect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)),
178 this, SLOT(onMouseMove(ModuleBase_IViewWindow*, QMouseEvent*)));
180 connect(aViewer, SIGNAL(keyPress(ModuleBase_IViewWindow*, QKeyEvent*)),
181 this, SLOT(onKeyPress(ModuleBase_IViewWindow*, QKeyEvent*)));
183 connect(aViewer, SIGNAL(keyRelease(ModuleBase_IViewWindow*, QKeyEvent*)),
184 this, SLOT(onKeyRelease(ModuleBase_IViewWindow*, QKeyEvent*)));
186 connect(aViewer, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged()));
188 connect(aViewer, SIGNAL(viewTransformed(int)), this, SIGNAL(viewTransformed(int)));
190 connect(aViewer, SIGNAL(contextMenuRequested(QContextMenuEvent*)), this,
191 SIGNAL(contextMenuRequested(QContextMenuEvent*)));
194 AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
196 connect(aViewer, SIGNAL(lastViewClosed()), this, SIGNAL(lastViewClosed()));
198 connect(aViewer, SIGNAL(tryCloseView(AppElements_ViewWindow*)),
199 this, SLOT(onTryCloseView(AppElements_ViewWindow*)));
201 connect(aViewer, SIGNAL(deleteView(AppElements_ViewWindow*)),
202 this, SLOT(onDeleteView(AppElements_ViewWindow*)));
204 connect(aViewer, SIGNAL(viewCreated(AppElements_ViewWindow*)),
205 this, SLOT(onViewCreated(AppElements_ViewWindow*)));
207 connect(aViewer, SIGNAL(activated(AppElements_ViewWindow*)),
208 this, SLOT(onActivated(AppElements_ViewWindow*)));
210 connect(aViewer, SIGNAL(mousePress(AppElements_ViewWindow*, QMouseEvent*)), this,
211 SLOT(onMousePress(AppElements_ViewWindow*, QMouseEvent*)));
213 connect(aViewer, SIGNAL(mouseRelease(AppElements_ViewWindow*, QMouseEvent*)), this,
214 SLOT(onMouseRelease(AppElements_ViewWindow*, QMouseEvent*)));
216 connect(aViewer, SIGNAL(mouseDoubleClick(AppElements_ViewWindow*, QMouseEvent*)), this,
217 SLOT(onMouseDoubleClick(AppElements_ViewWindow*, QMouseEvent*)));
219 connect(aViewer, SIGNAL(mouseMove(AppElements_ViewWindow*, QMouseEvent*)), this,
220 SLOT(onMouseMove(AppElements_ViewWindow*, QMouseEvent*)));
222 connect(aViewer, SIGNAL(keyPress(AppElements_ViewWindow*, QKeyEvent*)), this,
223 SLOT(onKeyPress(AppElements_ViewWindow*, QKeyEvent*)));
225 connect(aViewer, SIGNAL(keyRelease(AppElements_ViewWindow*, QKeyEvent*)), this,
226 SLOT(onKeyRelease(AppElements_ViewWindow*, QKeyEvent*)));
228 connect(aViewer, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged()));
229 connect(aViewer, SIGNAL(contextMenuRequested(QContextMenuEvent*)), this,
230 SIGNAL(contextMenuRequested(QContextMenuEvent*)));
234 bool XGUI_ViewerProxy::eventFilter(QObject *theObject, QEvent *theEvent)
236 if (theEvent->type() == QEvent::Enter) {
237 emit enterViewPort();
239 else if (theEvent->type() == QEvent::Leave) {
240 emit leaveViewPort();
242 return ModuleBase_IViewer::eventFilter(theObject, theEvent);
245 void XGUI_ViewerProxy::onViewCreated(ModuleBase_IViewWindow* theWnd)
247 theWnd->viewPort()->installEventFilter(this);
248 myWindowScale.insert (theWnd->v3dView(), theWnd->v3dView()->Camera()->Scale());
249 emit viewCreated(theWnd);
253 void XGUI_ViewerProxy::onTryCloseView(AppElements_ViewWindow* theWnd)
255 emit tryCloseView(theWnd);
258 void XGUI_ViewerProxy::onDeleteView(AppElements_ViewWindow* theWnd)
260 if (myWindowScale.contains(theWnd->v3dView()))
261 myWindowScale.remove (theWnd->v3dView());
262 emit deleteView(theWnd);
265 void XGUI_ViewerProxy::onViewCreated(AppElements_ViewWindow* theWnd)
267 theWnd->viewPort()->installEventFilter(this);
269 connect(theWnd, SIGNAL(vpTransformationFinished(AppElements_ViewWindow::OperationType)),
270 this, SLOT(onViewTransformed(AppElements_ViewWindow::OperationType)));
272 myWindowScale.insert (theWnd->v3dView(), theWnd->v3dView()->Camera()->Scale());
274 emit viewCreated(theWnd);
277 void XGUI_ViewerProxy::onActivated(AppElements_ViewWindow* theWnd)
279 emit activated(theWnd);
282 void XGUI_ViewerProxy::onMousePress(AppElements_ViewWindow* theWnd, QMouseEvent* theEvent)
284 emit mousePress(theWnd, theEvent);
287 void XGUI_ViewerProxy::onMouseRelease(AppElements_ViewWindow* theWnd, QMouseEvent* theEvent)
289 emit mouseRelease(theWnd, theEvent);
292 void XGUI_ViewerProxy::onMouseDoubleClick(AppElements_ViewWindow* theWnd, QMouseEvent* theEvent)
294 emit mouseDoubleClick(theWnd, theEvent);
297 void XGUI_ViewerProxy::onMouseMove(AppElements_ViewWindow* theWnd, QMouseEvent* theEvent)
301 ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "highlighting-2d", true);
317 ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "highlighting-3d", false);
331 emit mouseMove(theWnd, theEvent);
334 void XGUI_ViewerProxy::onKeyPress(AppElements_ViewWindow* theWnd, QKeyEvent* theEvent)
336 myShowHighlight = theEvent->key() == Qt::Key_H;
337 emit keyPress(theWnd, theEvent);
340 void XGUI_ViewerProxy::onKeyRelease(AppElements_ViewWindow* theWnd, QKeyEvent* theEvent)
342 if (theEvent->key() == Qt::Key_H) {
343 myShowHighlight = false;
345 emit keyRelease(theWnd, theEvent);
348 void XGUI_ViewerProxy::onViewTransformed(AppElements_ViewWindow::OperationType theType)
350 emit viewTransformed((int) theType);
356 //***************************************
357 void XGUI_ViewerProxy::enableSelection(bool isEnabled)
360 myWorkshop->salomeConnector()->viewer()->enableSelection(isEnabled);
362 myWorkshop->mainWindow()->viewer()->setSelectionEnabled(isEnabled);
366 //***************************************
367 bool XGUI_ViewerProxy::isSelectionEnabled() const
370 return myWorkshop->salomeConnector()->viewer()->isSelectionEnabled();
372 return myWorkshop->mainWindow()->viewer()->isSelectionEnabled();
376 //***************************************
377 void XGUI_ViewerProxy::enableMultiselection(bool isEnable)
380 myWorkshop->salomeConnector()->viewer()->enableMultiselection(isEnable);
382 myWorkshop->mainWindow()->viewer()->setMultiSelectionEnabled(isEnable);
386 //***************************************
387 bool XGUI_ViewerProxy::isMultiSelectionEnabled() const
390 return myWorkshop->salomeConnector()->viewer()->isMultiSelectionEnabled();
392 return myWorkshop->mainWindow()->viewer()->isMultiSelectionEnabled();
396 //***************************************
397 bool XGUI_ViewerProxy::enableDrawMode(bool isEnabled)
400 return myWorkshop->salomeConnector()->viewer()->enableDrawMode(isEnabled);
402 return myWorkshop->mainWindow()->viewer()->enableDrawMode(isEnabled);
406 //***************************************
407 void XGUI_ViewerProxy::addSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
409 myWorkshop->displayer()->addSelectionFilter(theFilter);
412 //***************************************
413 void XGUI_ViewerProxy::removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
415 myWorkshop->displayer()->removeSelectionFilter(theFilter);
418 //***************************************
419 bool XGUI_ViewerProxy::hasSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
421 return myWorkshop->displayer()->hasSelectionFilter(theFilter);
424 //***************************************
425 void XGUI_ViewerProxy::clearSelectionFilters()
427 myWorkshop->displayer()->removeFilters();
430 //***************************************
431 void XGUI_ViewerProxy::update()
433 myWorkshop->displayer()->updateViewer();
436 //***************************************
437 bool XGUI_ViewerProxy::canDragByMouse() const
439 if (myWorkshop->isSalomeMode()) {
440 ModuleBase_IViewer* aViewer = myWorkshop->salomeConnector()->viewer();
441 return aViewer->canDragByMouse();
447 //***************************************
448 void XGUI_ViewerProxy::displayHighlight(FeaturePtr theFeature, const TopoDS_Shape& theIgnoreShape)
450 Handle(AIS_InteractiveContext) aContext = AISContext();
453 if (myResult->groupName() == ModelAPI_ResultConstruction::group()) {
454 //FeaturePtr aFeature = ModelAPI_Feature::feature(myResult);
455 if (theFeature.get()) {
456 std::list<ResultPtr> aResults = theFeature->results();
457 std::list<ResultPtr>::const_iterator aIt;
459 Handle(AIS_Shape) aAis;
460 for (aIt = aResults.cbegin(); aIt != aResults.cend(); aIt++) {
462 TopoDS_Shape aTShape = aRes->shape()->impl<TopoDS_Shape>();
463 if (!aTShape.IsSame(theIgnoreShape)) {
464 aAis = new AIS_Shape(aTShape);
465 aAis->SetColor(HIGHLIGHT_COLOR);
466 aAis->SetZLayer(Graphic3d_ZLayerId_Top); //Graphic3d_ZLayerId_Topmost
467 aDeflection = Config_PropManager::real("Visualization", "construction_deflection");
468 aAis->Attributes()->SetDeviationCoefficient(aDeflection);
469 myHighlights.Append(aAis);
470 aContext->Display(aAis, false);
471 aContext->Deactivate(aAis);
477 TopoDS_Shape aTShape = myResult->shape()->impl<TopoDS_Shape>();
478 Handle(AIS_Shape) aAis = new AIS_Shape(aTShape);
479 aAis->SetColor(HIGHLIGHT_COLOR);
480 aAis->SetZLayer(Graphic3d_ZLayerId_Top); //Graphic3d_ZLayerId_Topmost
481 aDeflection = Config_PropManager::real("Visualization", "body_deflection");
482 aAis->Attributes()->SetDeviationCoefficient(aDeflection);
483 myHighlights.Append(aAis);
484 aContext->Display(aAis, false);
485 aContext->Deactivate(aAis);
489 void XGUI_ViewerProxy::eraseHighlight()
491 Handle(AIS_InteractiveContext) aContext = AISContext();
492 Handle(AIS_InteractiveObject) anAISIO;
493 AIS_ListIteratorOfListOfInteractive aLIt;
494 for (aLIt.Initialize(myHighlights); aLIt.More(); aLIt.Next()) {
495 anAISIO = aLIt.Value();
496 aContext->Remove(anAISIO, false);
498 myHighlights.Clear();
501 void XGUI_ViewerProxy::updateHighlight()
503 Handle(AIS_InteractiveContext) aContext = AISContext();
504 if (!aContext.IsNull()) {
505 Handle(StdSelect_BRepOwner) aOwner;
506 Handle(AIS_InteractiveObject) anIO;
507 bool isDisplayed = false;
508 TopoDS_Shape aShape, aShp;
510 XGUI_Displayer* aDisplayer = myWorkshop->displayer();
511 for (aContext->InitDetected(); aContext->MoreDetected(); aContext->NextDetected()) {
512 aOwner = Handle(StdSelect_BRepOwner)::DownCast(aContext->DetectedOwner());
513 if ((!aOwner.IsNull()) && aOwner->HasShape()) {
514 aShape = aOwner->Shape();
515 anIO = Handle(AIS_InteractiveObject)::DownCast(aOwner->Selectable());
516 aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aDisplayer->getObject(anIO));
517 if (aRes.get() && (aRes != myResult)) {
519 FeaturePtr aFeature = ModelAPI_Feature::feature(aRes);
520 aShp = aRes->shape()->impl<TopoDS_Shape>();
521 if ((aFeature->results().size() > 1) || (!aShp.IsSame(aShape))) {
523 displayHighlight(aFeature, aShape);
526 myResult = ResultPtr();
528 aContext->UpdateCurrentViewer();
530 isDisplayed = aRes.get();
535 aContext->UpdateCurrentViewer();
536 myResult = ResultPtr();
542 void XGUI_ViewerProxy::onMouseMove(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
546 ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "highlighting-2d", true);
562 ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "highlighting-3d", false);
576 emit mouseMove(theWnd, theEvent);
579 void XGUI_ViewerProxy::onKeyPress(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent)
581 myShowHighlight = theEvent->key() == Qt::Key_H;
582 emit keyPress(theWnd, theEvent);
585 void XGUI_ViewerProxy::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent)
587 if (theEvent->key() == Qt::Key_H) {
588 myShowHighlight = false;
590 emit keyRelease(theWnd, theEvent);
595 bool XGUI_ViewerProxy::isColorScaleVisible() const
598 return myWorkshop->salomeConnector()->viewer()->isColorScaleVisible();
600 return myWorkshop->mainWindow()->viewer()->isColorScaleVisible();
604 void XGUI_ViewerProxy::setColorScaleShown(bool on)
607 myWorkshop->salomeConnector()->viewer()->setColorScaleShown(on);
609 myWorkshop->mainWindow()->viewer()->setColorScaleShown(on);
613 void XGUI_ViewerProxy::setColorScalePosition(double theX, double theY)
616 myWorkshop->salomeConnector()->viewer()->setColorScalePosition(theX, theY);
618 QWidget* aWindow = activeViewPort();
619 Handle(AIS_ColorScale) aColorScale = myWorkshop->mainWindow()->viewer()->colorScale();
620 aColorScale->SetPosition(aWindow->width() * theX, aWindow->height() * theY);
624 void XGUI_ViewerProxy::setColorScaleSize(double theW, double theH)
627 myWorkshop->salomeConnector()->viewer()->setColorScaleSize(theW, theH);
629 QWidget* aWindow = activeViewPort();
630 Handle(AIS_ColorScale) aColorScale = myWorkshop->mainWindow()->viewer()->colorScale();
631 aColorScale->SetSize(aWindow->width() * theW, aWindow->height() * theH);
635 void XGUI_ViewerProxy::setColorScaleRange(double theMin, double theMax)
638 myWorkshop->salomeConnector()->viewer()->setColorScaleRange(theMin, theMax);
640 Handle(AIS_ColorScale) aColorScale = myWorkshop->mainWindow()->viewer()->colorScale();
641 aColorScale->SetRange(theMin, theMax);
645 void XGUI_ViewerProxy::setColorScaleIntervals(int theNb)
648 myWorkshop->salomeConnector()->viewer()->setColorScaleIntervals(theNb);
650 Handle(AIS_ColorScale) aColorScale = myWorkshop->mainWindow()->viewer()->colorScale();
651 aColorScale->SetNumberOfIntervals(theNb);
655 void XGUI_ViewerProxy::setColorScaleTextColor(const QColor& theColor)
658 myWorkshop->salomeConnector()->viewer()->setColorScaleTextColor(theColor);
660 Handle(AIS_ColorScale) aColorScale = myWorkshop->mainWindow()->viewer()->colorScale();
661 Quantity_Color aColor(theColor.redF(), theColor.greenF(), theColor.blueF(), Quantity_TOC_RGB);
662 aColorScale->SetColor(aColor);
667 void XGUI_ViewerProxy::setColorScaleTextHeigth(int theH)
670 myWorkshop->salomeConnector()->viewer()->setColorScaleTextHeigth(theH);
672 Handle(AIS_ColorScale) aColorScale = myWorkshop->mainWindow()->viewer()->colorScale();
673 aColorScale->SetTextHeight(theH);
677 void XGUI_ViewerProxy::setColorScaleTitle(const QString& theText)
680 myWorkshop->salomeConnector()->viewer()->setColorScaleTitle(theText);
682 Handle(AIS_ColorScale) aColorScale = myWorkshop->mainWindow()->viewer()->colorScale();
683 aColorScale->SetTitle(theText.toStdString().c_str());
688 //******************************************************
689 void XGUI_ViewerProxy::setupColorScale()
691 SUIT_ResourceMgr* aResMgr = ModuleBase_Preferences::resourceMgr();
692 double aX = aResMgr->doubleValue("Viewer", "scalar_bar_x_position", 0.03);
693 double aY = aResMgr->doubleValue("Viewer", "scalar_bar_y_position", 0.35);
694 setColorScalePosition(aX, aY);
696 double aW = aResMgr->doubleValue("Viewer", "scalar_bar_width", 0.2);
697 double aH = aResMgr->doubleValue("Viewer", "scalar_bar_height", 0.5);
698 setColorScaleSize(aW, aH);
700 QColor aColor = aResMgr->colorValue("Viewer", "scalar_bar_text_color", Qt::black);
701 setColorScaleTextColor(aColor);
703 int aT = aResMgr->integerValue("Viewer", "scalar_bar_text_height", 14);
704 setColorScaleTextHeigth(aT);
706 int aN = aResMgr->integerValue("Viewer", "scalar_bar_nb_intervals", 20);
707 setColorScaleIntervals(aN);
711 //***************************************
712 //void XGUI_ViewerProxy::Zfitall()
715 // myWorkshop->salomeConnector()->viewer()->Zfitall();
717 // AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
718 // AppElements_ViewWindow* aView = aViewer->activeViewWindow();
720 // Handle(V3d_View) aView3d = aView->v3dView();
721 // aView3d->ZFitAll();
722 // if (aView3d->Depth() < 0.1)
723 // aView3d->DepthFitAll();
730 void XGUI_ViewerProxy::setFitter(OCCViewer_Fitter* theFitter)
732 myWorkshop->salomeConnector()->viewer()->setFitter(theFitter);
735 OCCViewer_Fitter* XGUI_ViewerProxy::fitter() const
737 return myWorkshop->salomeConnector()->viewer()->fitter();
740 void XGUI_ViewerProxy::setFitter(AppElements_Fitter* theFitter)
742 myWorkshop->mainWindow()->viewer()->setFitter(theFitter);
745 AppElements_Fitter* XGUI_ViewerProxy::fitter() const
747 return myWorkshop->mainWindow()->viewer()->fitter();