From b4f8535ae96e9f6bde7d339578cbdb0ac28c97aa Mon Sep 17 00:00:00 2001 From: apo Date: Fri, 22 Dec 2006 08:04:57 +0000 Subject: [PATCH] To implement automatic restoring of Holder device on first call --- src/VISU_I/VISU_ColoredPrs3dCache_i.cc | 4 ++-- src/VISU_I/VISU_ColoredPrs3dCache_i.hh | 25 +++++++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/VISU_I/VISU_ColoredPrs3dCache_i.cc b/src/VISU_I/VISU_ColoredPrs3dCache_i.cc index 79e780fe..3671bd28 100644 --- a/src/VISU_I/VISU_ColoredPrs3dCache_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3dCache_i.cc @@ -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; } diff --git a/src/VISU_I/VISU_ColoredPrs3dCache_i.hh b/src/VISU_I/VISU_ColoredPrs3dCache_i.hh index 7c3271fe..41fc4b3f 100644 --- a/src/VISU_I/VISU_ColoredPrs3dCache_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3dCache_i.hh @@ -40,24 +40,33 @@ namespace VISU struct TPrs3dPtr: SALOME::GenericObjPtr { typedef SALOME::GenericObjPtr 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 TLastVisitedPrsList; -- 2.39.2