Salome HOME
refs #98 - Default color for constraints
[modules/shaper.git] / src / NewGeom / NewGeom_SalomeViewer.cpp
index 4d4a74ec9a2bc0a4bddedc99e68cb717a014370d..d9ce85febf901d738fa94427301ce74ddd4c10ca 100644 (file)
@@ -11,7 +11,7 @@
 #include <QContextMenuEvent>
 
 NewGeom_SalomeViewer::NewGeom_SalomeViewer(QObject* theParent)
-    : XGUI_SalomeViewer(theParent),
+    : ModuleBase_IViewer(theParent),
       mySelector(0)
 {
 }
@@ -51,6 +51,8 @@ void NewGeom_SalomeViewer::setSelector(NewGeom_OCCSelector* theSel)
     }
   }
   mySelector = theSel;
+  if (!mySelector)
+    return;
   OCCViewer_Viewer* aViewer = mySelector->viewer();
   SUIT_ViewManager* aMgr = aViewer->getViewManager();
 
@@ -150,3 +152,18 @@ void NewGeom_SalomeViewer::fitAll()
     aVFrame->onFitAll();
   }
 }
+
+//**********************************************
+void NewGeom_SalomeViewer::setViewProjection(double theX, double theY, double theZ)
+{
+  SUIT_ViewManager* aMgr = mySelector->viewer()->getViewManager();
+  OCCViewer_ViewFrame* aVFrame = dynamic_cast<OCCViewer_ViewFrame*>(aMgr->getActiveView());
+  if (aVFrame) {
+    Handle(V3d_View) aView3d = aVFrame->getViewPort()->getView();
+    if (!aView3d.IsNull()) {
+      aView3d->SetProj(theX, theY, theZ);
+      aView3d->FitAll(0.01, true, true);
+      aView3d->SetZSize(0.);
+    }
+  }
+}
\ No newline at end of file