Salome HOME
updated copyright message
[modules/gui.git] / src / SOCC / SOCC_ViewModel.cxx
index 0824b455806bb0078eac94222eb3c192870921c6..55aec6ca1226619a7becdda363e441b25c5a7766 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -412,14 +412,17 @@ void SOCC_Viewer::EraseAll( SALOME_Displayer* d, const bool forced )
   Handle(AIS_InteractiveContext) ic = getAISContext();
 
   // check if trihedron is displayed
-  Standard_Boolean isTrihedronDisplayed = ic->IsDisplayed( getTrihedron() );
+  Standard_Boolean isTrihedronDisplayed = isTrihedronVisible();
+  Standard_Boolean isViewCubeDisplayed  = isViewCubeVisible();
 
   // get objects to be erased (all currently displayed objects)
   AIS_ListOfInteractive aList;
   ic->DisplayedObjects( aList );
   AIS_ListIteratorOfListOfInteractive anIter( aList );
   for ( ; anIter.More(); anIter.Next() ) {
-    if ( (isTrihedronDisplayed && anIter.Value()->DynamicType() == STANDARD_TYPE( AIS_Trihedron ) ) )
+    if ( isTrihedronDisplayed && anIter.Value()->DynamicType() == STANDARD_TYPE( AIS_Trihedron ) )
+      continue;
+    if ( isViewCubeDisplayed && anIter.Value()->DynamicType() == STANDARD_TYPE( AIS_ViewCube ) )
       continue;
 
     // erase an object
@@ -515,6 +518,10 @@ void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const std::list<i
         for( it = sel_modes.begin(); it != sel_modes.end(); ++it )
           ic->Activate( anAIS, AIS_Shape::SelectionMode( (TopAbs_ShapeEnum)*it ) );
       }
+      else if ( anAIS->DynamicType() == STANDARD_TYPE(AIS_ViewCube) )
+      {
+        ic->Activate( anAIS, 0 );
+      }
       else if ( anAIS->DynamicType() != STANDARD_TYPE(AIS_Trihedron) )
       {
         ic->Load( anAIS, -1 );