DiscussionsIssue archiveOther usage issues

Archived discussion

Adding data to AIS object

Other usage issuesTue, 06/01/2004 - 11:563 replies

Browse this forum
QuestionAuthor

Hi, I manage a list of interactive object for vizualisation and I need to store some data (pointer) in the interactive object themselves to identify them from my application.
What is the best way to do it ?
Is there a free data member in AIS object to store this information ?
Regards
Jerome

Discussion

3 archived replies

Posts are displayed in their archived order.

01Commenter-1

We use the SetOwner and GetOwner method of AIS_InteractiveObject.

Commenter-1.

02Commenter-2

I agree but the SetOwner and GetOwner methods return/get a "const Handle(Standard_Transient)& " and my object don't inherits from Standard_Transient. I try to make casts but don't find any solution.
Is there another way ?
Commenter-2

03Commenter-1

I don't see any other way but to attach a derived class from Handle(Standard_Transient). You could create a wrapper derived from Handle(Standard_Transient) that will hold a pointer to your object.
Good Luck,
Commenter-1.