Fri, 10/29/2021 - 13:49
Forums:
Hello everyone,
I created some shapes in the view. Each shape has a number. I want to get the serial number of the shape when I put the mouse on it, but I don't know how to connect the number with the shape.
I tried to save AIS_InteractiveObject pointer when I created the shape, and use Context->SelectionManager()->Selector()->OnePicked()->Selectable() to get the pointer when mouse move. but the pointer not same.
Regards,
Mon, 11/01/2021 - 11:08
That doesn't look realistic - AIS_InteractiveContext doesn't create objects for you, the AIS_Shape displayed in Context preserves the same pointer in memory until it is destroyed.
Have you tried using AIS_InteractiveObject::SetOwner() interface? You may put your number as a string Handle(TCollection_HAsciiString), for instance.
Mon, 11/01/2021 - 14:14
My bad.The point is covered by other shapes.
thanks.