]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Feature 0016551: EDF PAL 501: To add a second trihedron always visible and with const...
authorouv <ouv@opencascade.com>
Thu, 24 Jul 2008 13:52:57 +0000 (13:52 +0000)
committerouv <ouv@opencascade.com>
Thu, 24 Jul 2008 13:52:57 +0000 (13:52 +0000)
src/OCCViewer/OCCViewer_ViewModel.cxx
src/OCCViewer/OCCViewer_ViewModel.h

index 0beafa3c2741b1bf72807bb3de9ca4b793300f04..b65c14d0a301298e6498d7f26eb29a27e713b3bf 100755 (executable)
@@ -55,7 +55,7 @@
   Constructor
   \param DisplayTrihedron - is trihedron displayed
 */
-OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron )
+OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron, bool DisplayStaticTrihedron )
 : SUIT_ViewModel(),
 myBgColor( Qt::black )
 {
@@ -111,6 +111,33 @@ myBgColor( Qt::black )
     myAISContext->Deactivate(myTrihedron);
   }
 
+  /* create static trihedron (16551: EDF PAL 501) */
+  if( DisplayStaticTrihedron )
+  {
+    Handle(Geom_Axis2Placement) anAxis = new Geom_Axis2Placement(gp::XOY());
+    Handle(AIS_Trihedron) aStaticTrihedron = new AIS_Trihedron(anAxis);
+    aStaticTrihedron->SetInfiniteState( Standard_True );
+
+    Quantity_Color Col(193/255., 205/255., 193/255., Quantity_TOC_RGB);
+    aStaticTrihedron->SetArrowColor( Col.Name() );
+    aStaticTrihedron->SetSize(100);
+    Handle(AIS_Drawer) drawer = aStaticTrihedron->Attributes();
+    if (drawer->HasDatumAspect()) {
+      Handle(Prs3d_DatumAspect) daspect = drawer->DatumAspect();
+      daspect->FirstAxisAspect()->SetColor(Quantity_Color(1.0, 0.0, 0.0, Quantity_TOC_RGB));
+      daspect->FirstAxisAspect()->SetWidth(2);
+      daspect->SecondAxisAspect()->SetColor(Quantity_Color(0.0, 1.0, 0.0, Quantity_TOC_RGB));
+      daspect->SecondAxisAspect()->SetWidth(2);
+      daspect->ThirdAxisAspect()->SetColor(Quantity_Color(0.0, 0.0, 1.0, Quantity_TOC_RGB));
+      daspect->ThirdAxisAspect()->SetWidth(2);
+    }
+    myAISContext->Display(aStaticTrihedron);
+    myAISContext->Deactivate(aStaticTrihedron);
+
+    aStaticTrihedron->SetTransformPersistence(Graphic3d_TMF_TriedronPers, gp_Pnt( -1, -1, 200 ));
+  }
+
   // selection
   mySelectionEnabled = true;
   myMultiSelectionEnabled = true;
index 323979697696df9997d1a9baf960b6aac2e5e742..586cb80a705f412e0dc081e31b87b4f80ecc928e 100755 (executable)
@@ -73,7 +73,7 @@ class OCCVIEWER_EXPORT OCCViewer_Viewer: public SUIT_ViewModel
 public:
   static QString Type() { return "OCCViewer"; }
 
-  OCCViewer_Viewer( bool DisplayTrihedron = true );
+  OCCViewer_Viewer( bool DisplayTrihedron = true, bool DisplayStaticTrihedron = true );
   virtual ~OCCViewer_Viewer();
 
   void update();