-//**************************************************************
-bool XGUI_Displayer::customizeObject(ObjectPtr theObject)
-{
- AISObjectPtr anAISObj = getAISObject(theObject);
- // correct the result's color it it has the attribute
- ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
-
- // Customization of presentation
- GeomCustomPrsPtr aCustomPrs;
- FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
- if (aFeature.get() != NULL) {
- GeomCustomPrsPtr aCustPrs = std::dynamic_pointer_cast<GeomAPI_ICustomPrs>(aFeature);
- if (aCustPrs.get() != NULL)
- aCustomPrs = aCustPrs;
- }
- if (aCustomPrs.get() == NULL) {
- GeomPresentablePtr aPrs = std::dynamic_pointer_cast<GeomAPI_IPresentable>(theObject);
- // we ignore presentable not customized objects
- if (aPrs.get() == NULL)
- aCustomPrs = myCustomPrs;
- }
- bool isCustomized = aCustomPrs.get() &&
- aCustomPrs->customisePresentation(aResult, anAISObj, myCustomPrs);
- isCustomized = myWorkshop->module()->afterCustomisePresentation(aResult, anAISObj, myCustomPrs)
- || isCustomized;
-
- // update presentation state if faces panel is active
- if (anAISObj.get() && myWorkshop->facesPanel())
- isCustomized = myWorkshop->facesPanel()->customizeObject(theObject, anAISObj) || isCustomized;
-
- return isCustomized;
-}
-