]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To implement automatic restoring of Holder device on first call
authorapo <apo@opencascade.com>
Fri, 22 Dec 2006 08:04:57 +0000 (08:04 +0000)
committerapo <apo@opencascade.com>
Fri, 22 Dec 2006 08:04:57 +0000 (08:04 +0000)
src/VISU_I/VISU_ColoredPrs3dCache_i.cc
src/VISU_I/VISU_ColoredPrs3dCache_i.hh

index 79e780fe7a76ed8f4c356058a7c5c1be3694fcdc..3671bd2836c2c4254f95d1c89918497ec921d140 100644 (file)
@@ -431,9 +431,9 @@ VISU::ColoredPrs3dCache_i
                   const std::string& theHolderEntry)
 {
   TPrs3dPtr aPrs3d( thePrs3d );
-  aPrs3d->Destroy();
+  thePrs3d->Destroy();
 
-  aPrs3d->SetHolderEntry( theHolderEntry );
+  thePrs3d->SetHolderEntry( theHolderEntry );
   myHolderMap[theHolderEntry].push_front(aPrs3d);  
   return thePrs3d;
 }
index 7c3271fe1d30e7c65828367be5fb6723f14c5f6a..41fc4b3fb18745d5dc360dc74d8022145a0c9ed1 100644 (file)
@@ -40,24 +40,33 @@ namespace VISU
   struct TPrs3dPtr: SALOME::GenericObjPtr<ColoredPrs3d_i>
   {
     typedef SALOME::GenericObjPtr<ColoredPrs3d_i> TSuperClass;
-    // Description:
-    // Initialize smart pointer to given object.
+    //! Initialize smart pointer to given object.
     TPrs3dPtr(ColoredPrs3d_i* r): TSuperClass(r) {}
 
-    // Description:
-    // Initialize smart pointer with a new reference to the same object
+    //! Initialize smart pointer with a new reference to the same object
     // referenced by given smart pointer.
     TPrs3dPtr(const SALOME::GenericObjPtrBase& r): TSuperClass(r) {}
 
-    // Description:
-    // Provides normal pointer target member access using operator ->.
-    ColoredPrs3d_i* operator->() const
+    //! Get the contained pointer.
+    ColoredPrs3d_i* GetPointer() const
     {
-      ColoredPrs3d_i* aColoredPrs3d = TSuperClass::operator ->();
+      ColoredPrs3d_i* aColoredPrs3d = TSuperClass::GetPointer();
       // To implement postponed restoring of the presentation
       aColoredPrs3d->InitFromRestoringState();
       return aColoredPrs3d;
     }
+
+    //! Get the contained pointer.
+    operator ColoredPrs3d_i* () const
+    {
+      return this->GetPointer();
+    }
+
+    //! Provides normal pointer target member access using operator ->.
+    ColoredPrs3d_i* operator->() const
+    {
+      return this->GetPointer();
+    }
   };
 
   typedef std::deque<TPrs3dPtr> TLastVisitedPrsList;