{
bool isCustomized = false;
int aShapeType = thePrs->getShapeType();
- if (aShapeType != 6/*an edge*/ && aShapeType != 7/*a vertex*/)
+ // a compound is processed like the edge because the arc feature uses the compound for presentable AIS
+ if (aShapeType != 6/*an edge*/ && aShapeType != 7/*a vertex*/ && aShapeType != 0/*compound*/)
return false;
std::vector<int> aColor;
std::shared_ptr<ModelAPI_AttributeBoolean> aConstructionAttr =
data()->boolean(SketchPlugin_SketchEntity::CONSTRUCTION_ID());
bool isConstruction = aConstructionAttr.get() != NULL && aConstructionAttr->value();
- if (aShapeType == 6) { // if this is an edge
+ if (aShapeType == 6 || aShapeType == 0) { // if this is an edge or a compound
if (isConstruction) {
isCustomized = thePrs->setWidth(1) || isCustomized;
isCustomized = thePrs->setLineStyle(3) || isCustomized;
bool XGUI_Displayer::customizeObject(ObjectPtr theObject)
{
- // we need not customize presentable objects
- GeomPresentablePtr aPrs = std::dynamic_pointer_cast<GeomAPI_IPresentable>(theObject);
- if (aPrs.get() != NULL)
- return false;
-
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 = myCustomPrs;
+ 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) {
+ // we ignore presentable not customized objects
+ GeomPresentablePtr aPrs = std::dynamic_pointer_cast<GeomAPI_IPresentable>(theObject);
+ if (aPrs.get() != NULL)
+ return false;
+ aCustomPrs = myCustomPrs;
+ }
return aCustomPrs->customisePresentation(aResult, anAISObj, myCustomPrs);
}