Salome HOME
Updated copyright comment
[modules/geom.git] / src / GEOMToolsGUI / GEOMToolsGUI.cxx
index 647a1dbd8a6f5ea46a6f67fd576ac2a60f5f0b84..639c370caad6adc53a4fc9702e52ede4b60dea6a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -77,7 +77,7 @@ static QString getParentComponent( _PTR( SObject ) obj )
 
 //=====================================================================================
 // function : inUse
-// purpose  : check if the object(s) passed as the the second arguments are used
+// purpose  : check if the object(s) passed as the second arguments are used
 //            by the other objects in the study
 //=====================================================================================
 static bool inUse( const QString& component, const QMap<QString,QString>& objects )
@@ -93,8 +93,8 @@ static bool inUse( const QString& component, const QMap<QString,QString>& object
   std::list<_PTR(SObject)> aSelectedSO;
   for ( oit = objects.begin(); oit != objects.end(); ++oit )
   {
-    _PTR(SObject) so = study->FindObjectID( oit.key().toLatin1().data() );
-    if ( !so )
+    _PTR(SObject) so = study->FindObjectID( oit.key().toUtf8().data() );
+    if ( !GeometryGUI::IsInGeomComponent( so ))
       continue;
     aSelectedSO.push_back(so);
     CORBA::Object_var        corbaObj_rem = GeometryGUI::ClientSObjectToObject( so );
@@ -206,7 +206,7 @@ GEOMToolsGUI::~GEOMToolsGUI()
 // function : OnGUIEvent()
 // purpose  :
 //=======================================================================
-bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
+bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* /*parent*/)
 {
   getGeometryGUI()->EmitSignalDeactivateDialog();
 
@@ -335,7 +335,7 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
 // function : OnGUIEvent()
 // purpose  :
 //=======================================================================
-bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent, const QVariant& theParam )
+bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* /*parent*/, const QVariant& theParam )
 {
   getGeometryGUI()->EmitSignalDeactivateDialog();
 
@@ -398,7 +398,7 @@ void GEOMToolsGUI::OnEditDelete()
       continue; // invalid object
     // ...
     QString entry = anIObject->getEntry();
-    _PTR(SObject) obj = aStudy->FindObjectID( entry.toLatin1().data() );
+    _PTR(SObject) obj = aStudy->FindObjectID( entry.toUtf8().data() );
     // check parent component
     QString parentComp = getParentComponent( obj );
     if ( parentComp != geomComp )  {
@@ -467,11 +467,11 @@ void GEOMToolsGUI::OnEditDelete()
 
   _PTR(StudyBuilder) aStudyBuilder (aStudy->NewBuilder());
   GEOM_Displayer disp;
-  disp.SetUpdateColorScale( false ); // IPAL54049
+  bool toUpdateColorScale = disp.SetUpdateColorScale( false ); // IPAL54049
 
   if ( isComponentSelected ) {
     // GEOM component is selected: delete all objects recursively
-    _PTR(SObject) comp = aStudy->FindObjectID( geomComp.toLatin1().data() );
+    _PTR(SObject) comp = aStudy->FindObjectID( geomComp.toUtf8().data() );
     if ( !comp )
       return;
     _PTR(ChildIterator) it ( aStudy->NewChildIterator( comp ) );
@@ -499,7 +499,7 @@ void GEOMToolsGUI::OnEditDelete()
     // ... and then delete all objects
     QMap<QString, QString>::Iterator it;
     for ( it = toBeDeleted.begin(); it != toBeDeleted.end(); ++it ) {
-      _PTR(SObject) obj ( aStudy->FindObjectID( it.key().toLatin1().data() ) );
+      _PTR(SObject) obj ( aStudy->FindObjectID( it.key().toUtf8().data() ) );
       // remove object from GEOM engine
       removeObjectWithChildren( obj, views, &disp );
       // remove objects from study
@@ -509,7 +509,7 @@ void GEOMToolsGUI::OnEditDelete()
     }
     // ... and then delete all folders
     for ( it = toBeDelFolders.begin(); it != toBeDelFolders.end(); ++it ) {
-      _PTR(SObject) obj ( aStudy->FindObjectID( it.key().toLatin1().data() ) );
+      _PTR(SObject) obj ( aStudy->FindObjectID( it.key().toUtf8().data() ) );
       // remove object from GEOM engine
       removeObjectWithChildren( obj, views, &disp );
       // remove objects from study
@@ -519,6 +519,7 @@ void GEOMToolsGUI::OnEditDelete()
     }
   }
 
+  disp.SetUpdateColorScale( toUpdateColorScale ); // IPAL54049
   selected.Clear();
   aSelMgr->setSelectedObjects( selected );
   getGeometryGUI()->updateObjBrowser();