From: vsr Date: Thu, 17 Mar 2005 13:53:29 +0000 (+0000) Subject: PAL8376 X-Git-Tag: V2_2_2~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6e6e07edd69b269001a49872896281f0aa8942f7;p=modules%2Fgeom.git PAL8376 --- diff --git a/src/OBJECT/GEOM_AISShape.cxx b/src/OBJECT/GEOM_AISShape.cxx index e847b2175..c442b4c6c 100644 --- a/src/OBJECT/GEOM_AISShape.cxx +++ b/src/OBJECT/GEOM_AISShape.cxx @@ -116,7 +116,6 @@ static void indicesToOwners( const TColStd_IndexedMapOfInteger& aIndexMap, GEOM_AISShape::GEOM_AISShape(const TopoDS_Shape& shape, const Standard_CString aName): SALOME_AISShape(shape) { - myIO = NULL; myName = new char [strlen(aName)+1]; strcpy( myName, aName); @@ -124,15 +123,18 @@ GEOM_AISShape::GEOM_AISShape(const TopoDS_Shape& shape, } void GEOM_AISShape::setIO(const Handle(SALOME_InteractiveObject)& io){ - myIO = io; + SetOwner( io ); } Handle(SALOME_InteractiveObject) GEOM_AISShape::getIO(){ - return myIO; + Handle(SALOME_InteractiveObject) IO; + if ( !GetOwner().IsNull() ) + IO = Handle(SALOME_InteractiveObject)::DownCast( GetOwner() ); + return IO; } Standard_Boolean GEOM_AISShape::hasIO(){ - return !myIO.IsNull(); + return !getIO().IsNull(); } void GEOM_AISShape::setName(const Standard_CString aName) @@ -140,8 +142,9 @@ void GEOM_AISShape::setName(const Standard_CString aName) myName = new char [strlen(aName)+1]; strcpy( myName, aName); - if ( hasIO() ) - myIO->setName(aName); + Handle(SALOME_InteractiveObject) IO = getIO(); + if ( !IO.IsNull() ) + IO->setName(aName); } Standard_CString GEOM_AISShape::getName(){ diff --git a/src/OBJECT/GEOM_AISShape.hxx b/src/OBJECT/GEOM_AISShape.hxx index 617c6f9be..8db765048 100644 --- a/src/OBJECT/GEOM_AISShape.hxx +++ b/src/OBJECT/GEOM_AISShape.hxx @@ -121,7 +121,6 @@ private: // Fields PRIVATE // - Handle_SALOME_InteractiveObject myIO; Standard_CString myName; Quantity_Color myShadingColor; };