This commit is contained in:
vsr 2005-03-17 13:53:29 +00:00
parent aa5ce1d37f
commit 6e6e07edd6
2 changed files with 9 additions and 7 deletions

View File

@ -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(){

View File

@ -121,7 +121,6 @@ private:
// Fields PRIVATE
//
Handle_SALOME_InteractiveObject myIO;
Standard_CString myName;
Quantity_Color myShadingColor;
};