I want to display and select a composite object consisting of several subobjects with different Materials.
I am currently using a AIS_MultipleConnectedInteractive to Display my Object. This works fine, but I am unable to select these Object in my Viewer.
A search of the forums lead to this: http://www.opencascade.org/org/forum/thread_13633/
which indicates that selection of MultipleConnectedInteracitve was not implented by the time of that post (June 2008).
Is this still the case, or do is it my own fault?
//explore a compound Shape
TopExp_Explorer exp(mShp, TopAbs_SOLID);
//get current subshape
TopoDS_Solid mSolid = TopoDS::Solid(exp.Current());
InteractiveObj = new AIS_Shape(mSolid);
myAISContext->SetDisplayMode(InteractiveObj, 1, false);
//Get material and color from a shape-info struct wich contains one entry fro each subshape
Graphic3d_NameOfMaterial mat = pShp->material.at(i);
Quantity_Color col = pShp->color.at(i);
//set these values
myAISContext->SetColor(InteractiveObj, col, false);
myAISContext->SetMaterial(InteractiveObj, mat , false);
//add the new shape to the shapelist
//when construction is finished, Set selection mode and display Shapegroup
myAISContext->SetDisplayMode(InteractiveObjGroup, 1, false);
/*End of source*/
The above code Displays my objects with the correct colors and materials, but no Interactive Selection is possible.
I can, however select the composite object manually, using it's handle and the ais_InteractivecontexT::SetSelected()-function.
any insight is appreciated