retrieving a shape's information...

I have an app that allows users to add "spheres" to an imported object. The spheres represent specfied locations along the object.
When a user has defined all such locations, these locations must be collected for a out of stream process. In order to quickly implement some of the basic needs, I stored the point location in a list in the UI. The point is returned from the OCCEngine portion each time a user "picks a location", and this populates the list.
I wish to allow the user to remove a point location(if added by mistake). I can remove it from the viewer. What I cannot figure out is how to deconstruct the TopoDS_Shape object and get the center point of the sphere. I need this point to pass back to the UI to find and remove the corresponding point in the list.

Eventually I believe that the UI will not house a point list, but the user would ask for the list of points (spheres), and the OCCEngie portion would traverse through all the objects, find the appropriate "sphere" point locations and return the list of point locations. For now, I need the ability to deconstruct the TopoDS_Shape (unless I'm looking in the wrong spot).

What I have is:

// Adds the "tap" object to the viewer (Tap is the point location)

void DrawTap(TopoDS_Shape shape, Graphic3d_NameOfMaterial material)
{
Handle(AIS_Shape) AISShape = new AIS_Shape(shape);
myAISContext->SetDisplayMode(AISShape,1,Standard_False);
myAISContext->Display(AISShape);
myAISContext->SetMaterial(AISShape,material);

myView->Redraw();
}

// selecting the user selected shape object
while(myAISContext->MoreSelected())
{
if (myAISContext->HasSelectedShape())
{
TopoDS_Shape shape = myAISContext->SelectedShape();
...
but what to do with "shape"?

appricaite any suggestions
~sinisa stokic

sinisa stokic's picture

I think that I figured it out.