- 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
+ // set color from preferences
+ std::vector<int> aColor;
+ std::shared_ptr<ModelAPI_AttributeBoolean> anAuxiliaryAttr =
+ data()->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID());
+ bool isConstruction = anAuxiliaryAttr.get() != NULL && anAuxiliaryAttr->value();
+ if (isConstruction) {
+ aColor = Config_PropManager::color("Visualization", "sketch_auxiliary_color",
+ SKETCH_AUXILIARY_COLOR);
+ }
+ else if (isExternal()) {
+ aColor = Config_PropManager::color("Visualization", "sketch_external_color",
+ SKETCH_EXTERNAL_COLOR);
+ }
+ else {
+ aColor = Config_PropManager::color("Visualization", "sketch_entity_color",
+ SKETCH_ENTITY_COLOR);
+ }
+ if (!aColor.empty())
+ isCustomized = thePrs->setColor(aColor[0], aColor[1], aColor[2]) || isCustomized;
+
+ if (aShapeType == 6 || aShapeType == 0) { // if this is an edge or a compound