/// by mouse drugging. If this is impossible thet it has to return False.
virtual bool canDragByMouse() const { return true; }
+ // Fit all along Z (perpendicular to display)
+ virtual void Zfitall() = 0;
+
signals:
/// Signal emited when last view window is closed
void lastViewClosed();
this, SLOT(onViewTransformed(OCCViewer_ViewWindow::OperationType)));
}
}
+}
+
+void NewGeom_SalomeViewer::Zfitall()
+{
+ if (!mySelector || !mySelector->viewer())
+ return;
+ SUIT_ViewManager* aMgr = mySelector->viewer()->getViewManager();
+ OCCViewer_ViewFrame* aView = dynamic_cast<OCCViewer_ViewFrame*>(aMgr->getActiveView());
+ if (aView) {
+ OCCViewer_ViewWindow* aWnd = aView->getView(OCCViewer_ViewFrame::MAIN_VIEW);
+ aWnd->getViewPort()->getView()->ZFitAll();
+ }
}
\ No newline at end of file
/// \param toActivate - activation flag
void activateViewer(bool toActivate);
+ // Fit all along Z (perpendicular to display)
+ virtual void Zfitall();
+
private slots:
void onMousePress(SUIT_ViewWindow*, QMouseEvent*);
void onMouseRelease(SUIT_ViewWindow*, QMouseEvent*);
void XGUI_Displayer::updateViewer() const
{
Handle(AIS_InteractiveContext) aContext = AISContext();
- if (!aContext.IsNull() && myEnableUpdateViewer)
+ if (!aContext.IsNull() && myEnableUpdateViewer) {
+ myWorkshop->viewer()->Zfitall();
aContext->UpdateCurrentViewer();
+ }
}
void XGUI_Displayer::activateAIS(const Handle(AIS_InteractiveObject)& theIO,
emit viewTransformed((int) theType);
}
+
+//***************************************
+void XGUI_ViewerProxy::Zfitall()
+{
+ if (myWorkshop->isSalomeMode()) {
+ myWorkshop->salomeConnector()->viewer()->Zfitall();
+ } else {
+ AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer();
+ AppElements_ViewWindow* aView = aViewer->activeViewWindow();
+ if (aView)
+ aView->v3dView()->ZFitAll();
+ }
+}
\ No newline at end of file
/// by mouse drugging. If this is impossible thet it has to return False.
virtual bool canDragByMouse() const;
+ // Fit all along Z (perpendicular to display)
+ virtual void Zfitall();
+
signals:
/// Emits by mouse entering the view port
void enterViewPort();