Salome HOME
[bos #32517][EDF] Dynamic log messages switched on and off by SALOME_VERBOSE environm...
[modules/geom.git] / src / EntityGUI / EntityGUI.cxx
index 9a6ad4dabd136ac0daddc00136f30e58efc6982d..b47285b72a5f96d04fdc9ec6322fed5ae79cbe88 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2020  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  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
@@ -141,14 +141,16 @@ bool EntityGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
     GEOM::GEOM_FieldStep_var step;
 
     SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
-    if ( aList.Extent() > 0 && study ) {
+    if ( study )
       for ( ; anIter.More(); anIter.Next() )
       {
         Handle(SALOME_InteractiveObject) anIObj = anIter.Value();
         if ( !anIObj.IsNull() && anIObj->hasEntry() )
-          if ( _PTR(SObject) obj = study->studyDS()->FindObjectID( anIObj->getEntry() ))
+        {
+          _PTR(SObject) obj = study->studyDS()->FindObjectID( anIObj->getEntry() );
+          if ( GeometryGUI::IsInGeomComponent( obj ))
           {
-            CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject( obj );
+            CORBA::Object_var   corbaObj = GeometryGUI::ClientSObjectToObject( obj );
             GEOM::GEOM_BaseObject_var bo = GEOM::GEOM_BaseObject::_narrow( corbaObj );
             GEOM::GEOM_Field_var     f;
             GEOM::GEOM_FieldStep_var s;
@@ -173,9 +175,8 @@ bool EntityGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
               field = f;
             }
           }
+        }
       }
-    }
-
     if ( !field->_is_nil()) {
       int stepID;
       if ( !step->_is_nil() ) {
@@ -212,7 +213,7 @@ bool EntityGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
 // function : 0nMousePress()
 // purpose  : [static] manage mouse events
 //=================================================================================
-bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow )
+bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* /*parent*/, SUIT_ViewWindow* theViewWindow )
 {
   QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox();
 
@@ -294,7 +295,7 @@ bool EntityGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWi
 // function : 0nMouseRelease()
 // purpose  : [static] manage mouse events
 //=================================================================================
-bool EntityGUI::OnMouseRelease( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow )
+bool EntityGUI::OnMouseRelease( QMouseEvent* pe, SUIT_Desktop* /*parent*/, SUIT_ViewWindow* theViewWindow )
 {
   ((OCCViewer_ViewWindow*)theViewWindow)->setSketcherStyle(false);
 #ifdef WITH_OPENCV
@@ -323,7 +324,7 @@ bool EntityGUI::OnMouseRelease( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_View
 // function : 0nMouseMove()
 // purpose  : [static] manage mouse events
 //=================================================================================
-bool EntityGUI::OnMouseMove( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWindow* theViewWindow )
+bool EntityGUI::OnMouseMove( QMouseEvent* pe, SUIT_Desktop* /*parent*/, SUIT_ViewWindow* theViewWindow )
 {
   QDialog* aDlg = getGeometryGUI()->GetActiveDialogBox();
   
@@ -351,7 +352,7 @@ bool EntityGUI::OnMouseMove( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin
 //=====================================================================================
 void EntityGUI::DisplaySimulationShape( const TopoDS_Shape& S1, const TopoDS_Shape& S2 ) 
 {
-  MESSAGE("EntityGUI::DisplaySimulationShape")
+  MESSAGE("EntityGUI::DisplaySimulationShape");
   SalomeApp_Application* app = getGeometryGUI()->getApp();
   if ( !app ) return;
 
@@ -389,7 +390,7 @@ void EntityGUI::DisplaySimulationShape( const TopoDS_Shape& S1, const TopoDS_Sha
     }
     ic->UpdateCurrentViewer();
   }
-  catch( Standard_Failure ) {
+  catch( Standard_Failure& ) {
     MESSAGE( "Exception caught in EntityGUI::DisplaySimulationShape" );
   } 
 }
@@ -400,7 +401,7 @@ void EntityGUI::DisplaySimulationShape( const TopoDS_Shape& S1, const TopoDS_Sha
 //==================================================================================
 void EntityGUI::EraseSimulationShape()
 {
-  MESSAGE("EntityGUI::EraseSimulationShape")
+  MESSAGE("EntityGUI::EraseSimulationShape");
   SalomeApp_Application* app = getGeometryGUI()->getApp();
   if ( !app ) return;