*/
GLViewer_Object::~GLViewer_Object()
{
- if( myRect )
+ if ( myRect )
delete myRect;
- if( myUpdateRect )
+ if ( myUpdateRect )
delete myUpdateRect;
- if( myGLText )
+ if ( myGLText )
delete myGLText;
- if( myAspectLine )
+ if ( myAspectLine )
delete myAspectLine;
+
+ if ( myOwner )
+ delete myOwner;
}
/*!
return myDrawer ? myDrawer->getPriority() : 0;
}
+void GLViewer_Object::setOwner( SUIT_DataOwner* owner )
+{
+ if ( myOwner == owner )
+ return;
+
+ if ( myOwner )
+ delete myOwner;
+ myOwner = owner;
+}
+
/*!
\return true if object is inside rectangle
\param theRect - rectangle
//!\warning It is for ouv
SUIT_DataOwner* owner() const { return myOwner; }
//!\warning It is for ouv
- void setOwner( SUIT_DataOwner* owner ) { myOwner = owner; }
+ void setOwner( SUIT_DataOwner* owner );
//! Adds object to group theGroup
void setGroup( GLViewer_Group* theGroup );
{
const LightApp_DataObject* obj = dynamic_cast<const LightApp_DataObject*>( theDataObj );
if ( obj )
- return mySelMgr->isOk( new LightApp_DataOwner( obj->entry() ) );
+ return mySelMgr->isOk( SUIT_DataOwnerPtr( new LightApp_DataOwner( obj->entry() ) ) );
return true;
}