0031658: Inspector - using AIS_ViewController in View package
[occt.git] / tools / View / View_Displayer.cxx
index 72c1c28..8259227 100644 (file)
@@ -20,6 +20,7 @@
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 #include <AIS_Shape.hxx>
 #include <AIS_Trihedron.hxx>
+#include <AIS_ViewCube.hxx>
 #include <Geom_Axis2Placement.hxx>
 #include <Prs3d_PointAspect.hxx>
 #include <V3d_View.hxx>
@@ -230,6 +231,28 @@ void View_Displayer::DisplayDefaultTrihedron (const Standard_Boolean toDisplay,
     GetContext()->Erase (aTrihedron, theToUpdateViewer);
 }
 
+// =======================================================================
+// function : DisplayViewCube
+// purpose :
+// =======================================================================
+void View_Displayer::DisplayViewCube (const Standard_Boolean toDisplay, const bool theToUpdateViewer)
+{
+  if (myViewCube.IsNull() && toDisplay)
+  {
+    myViewCube = new AIS_ViewCube();
+    myViewCube->SetSize (35.0);
+    myViewCube->SetBoxColor (Quantity_NOC_GRAY50);
+  }
+
+  if (myViewCube.IsNull())
+    return;
+
+  if (toDisplay)
+    GetContext()->Display (myViewCube, theToUpdateViewer);
+  else
+    GetContext()->Erase (myViewCube, theToUpdateViewer);
+}
+
 // =======================================================================
 // function : SetVisible
 // purpose :