]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Refs #279 - Behavior of polyline object is strange after changing the name
authornds <nds@opencascade.com>
Tue, 24 Dec 2013 13:06:31 +0000 (13:06 +0000)
committernds <nds@opencascade.com>
Tue, 24 Dec 2013 13:06:31 +0000 (13:06 +0000)
src/HYDROGUI/HYDROGUI_Module.cxx
src/HYDROGUI/HYDROGUI_Module.h

index 572fc6505bd9fbc342078197ef5ec63946e1c539..ff2d3a0f5e2b5963e3cc7925221ba6f4e8f22913 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "HYDROGUI.h"
 #include "HYDROGUI_DataModel.h"
+#include "HYDROGUI_DataObject.h"
 #include "HYDROGUI_Displayer.h"
 #include "HYDROGUI_GVSelector.h"
 #include "HYDROGUI_InputPanel.h"
@@ -834,12 +835,14 @@ bool HYDROGUI_Module::isObjectVisible( const int theViewId,
   if( theObject.IsNull() )
     return false;
 
-  ViewId2Name2ObjectStateMap::const_iterator anIter1 = myObjectStateMap.find( theViewId );
+  ViewId2Entry2ObjectStateMap::const_iterator anIter1 = myObjectStateMap.find( theViewId );
   if( anIter1 != myObjectStateMap.end() )
   {
-    const Name2ObjectStateMap& aName2ObjectStateMap = anIter1.value();
-    Name2ObjectStateMap::const_iterator anIter2 = aName2ObjectStateMap.find( theObject->GetName());
-    if( anIter2 != aName2ObjectStateMap.end() )
+    const Entry2ObjectStateMap& aEntry2ObjectStateMap = anIter1.value();
+    QString anEntry = HYDROGUI_DataObject::dataObjectEntry( theObject );
+
+    Entry2ObjectStateMap::const_iterator anIter2 = aEntry2ObjectStateMap.find( anEntry );
+    if( anIter2 != aEntry2ObjectStateMap.end() )
     {
       const ObjectState& anObjectState = anIter2.value();
       return anObjectState.Visibility;
@@ -854,8 +857,10 @@ void HYDROGUI_Module::setObjectVisible( const int theViewId,
 {
   if( !theObject.IsNull() )
   {
-    Name2ObjectStateMap& aName2ObjectStateMap = myObjectStateMap[ theViewId ];
-    ObjectState& anObjectState = aName2ObjectStateMap[ theObject->GetName() ];
+    Entry2ObjectStateMap& aEntry2ObjectStateMap = myObjectStateMap[ theViewId ];
+    QString anEntry = HYDROGUI_DataObject::dataObjectEntry( theObject );
+
+    ObjectState& anObjectState = aEntry2ObjectStateMap[ anEntry ];
     anObjectState.Visibility = theState;
   }
 }
index f7957e9c8c2b01c1695ef000afdecdf94c0bc135..a0b91265aba40cb824a65370374b232f316412a9 100644 (file)
@@ -79,8 +79,8 @@ public:
     double ZValue;
     ObjectState() : Visibility( false ), Transparency( 1.0 ), ZValue( 0.0 ) {}
   };
-  typedef QMap< QString, ObjectState > Name2ObjectStateMap;
-  typedef QMap< int, Name2ObjectStateMap > ViewId2Name2ObjectStateMap;
+  typedef QMap< QString, ObjectState > Entry2ObjectStateMap;
+  typedef QMap< int, Entry2ObjectStateMap > ViewId2Entry2ObjectStateMap;
 
   typedef QList<HYDROGUI_Shape*> ListOfShapes;
   typedef QMap<int,ListOfShapes> ViewId2ListOfShapes;
@@ -233,7 +233,7 @@ private:
   HYDROGUI_VTKPrsDisplayer*       myVTKDisplayer;
 
   ViewManagerMap                  myViewManagerMap;
-  ViewId2Name2ObjectStateMap      myObjectStateMap;
+  ViewId2Entry2ObjectStateMap      myObjectStateMap;
 
   ViewId2ListOfShapes             myShapesMap;
   ViewId2ListOfVTKPrs             myVTKPrsMap;