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);
}
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)
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(){