
Fri, 07/22/2022 - 11:59
Forums:
Hi All, I am using XCAFPrs_AISObject to store main shape (the box shape) and use TDocStd_Document to store shape labels; both main shape and sub shapes. Here I saved main shape label and add faces as child as sub shapes.
Now I want to hide face from the view which is a sub shape. But I could not find any possible solution for that. There was a forum thread discussing to hide shape using AISColored_shape. But that do not work for me. https://dev.opencascade.org/content/display-how-hide-face-within-aiscolored-shape
I have tried following code snippet.
Handle(XCAFPrs_AISObject) thePrs;
Handle(AIS_ColoredDrawer) aDrawer = thePrs->CustomAspects(theSubShape);
aDrawer->SetHidden(true);
Handle(AIS_InteractiveContext) context;
context->UpdateCurrentViewer();
It would be very helpful if anyone can help me on this.
Fri, 07/22/2022 - 12:00
See the image of code snippet here.
Fri, 07/22/2022 - 12:50
This theme is offtopic for this forum. You should ask such question in https://dev.opencascade.org/forums/visualization-and-3d-viewer.
Fri, 07/22/2022 - 13:16
Sorry for that. I'll post that to correct thread.
Fri, 07/22/2022 - 13:05
Although XCAFPrs_AISObject inherits from AIS_ColoredShape, it takes presentation parameters from XCAF document, so that sub-shape attributes manually overridden using AIS_ColoredShape::CustomAspects() will be withdrawn when XCAFPrs_AISObject will be recomputed.
Either, you need changing presentation attributes within XCAF document itself (e.g. if you want it to be preserved), or prevent overriding attributes via theToSyncStyles flag for XCAFPrs_AISObject::DispatchStyles().
Fri, 07/22/2022 - 13:44
Thank you for the reply. Your reply is highly appreciated. I have another question.
What kind of sub shape attributes in XCAF document can be used to hide or remove sub shapes from the view.