I currently encounter the following problem:
For all selected shapes in my AIS_InteractiveContext I want to set e.g. the color, material, transparancy, shade mode... . Before using XCAF everything was just fine by using e.g.:
for (theContext->InitCurrent(); theContext->MoreCurrent(); theContext->NextCurrent() )
theContext->SetDisplayMode(theContext->Current(), 1, Standard_False);
After I introduced XCAF this procedure still works for the display mode but not for the transparency/material/color setting. So I thought I have to use the TPrsStd_AISPresentation functions to assign these attributes to the displayed shapes. The problem is that I can\'t get the TPrsStd_AISPresentation from any selected AIS_InteractiveObject
Handle(AIS_InteractiveContext) theContext = ...
for( theContext->InitCurrent(); theContext->MoreCurrent(); theContext->NextSelected() )
Handle(TPrsStd_AISPresentation) curPres = Handle(TPrsStd_AISPresentation::DownCast(theContext->Current()));
Did I oversee some important details? How can I assign the user selected attributes to the selected displayed shapes? In the following I assign the shapes in the TDocStd_Document to AISViewer.
for(Standard_Integer cnt=1; cnt
TDF_Label theLab = myLabelSequence.Value(cnt);
TPrsPresentation = TPrsStd_AISPresentation::Set(theLab, XCAFPrs_Driver::GetID());
Thanks for any hint and/or help.