From 0c493630542ba94bdb40104634b40325616ab3bb Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 20 Jan 2017 17:07:53 +0300 Subject: [PATCH] Issue #1964 Splitting an auxiliary line gives a non auxiliary line Style of sketch constraint split preview presentation should be the same as the base sketch entity has. --- .../SketchPlugin_ConstraintSplit.cpp | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp b/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp index d2f64ddea..32199abce 100755 --- a/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintSplit.cpp @@ -369,11 +369,27 @@ AISObjectPtr SketchPlugin_ConstraintSplit::getAISObject(AISObjectPtr thePrevious if (!anAIS) anAIS = AISObjectPtr(new GeomAPI_AISObject); anAIS->createShape(aShape); - anAIS->setWidth(5); + std::shared_ptr anAuxiliaryAttr = + aBaseFeature->data()->boolean(SketchPlugin_SketchEntity::AUXILIARY_ID()); + + bool isConstruction = anAuxiliaryAttr.get() != NULL && anAuxiliaryAttr->value(); + std::vector aColor; - aColor = Config_PropManager::color("Visualization", "sketch_entity_color", - SKETCH_ENTITY_COLOR); - anAIS->setColor(aColor[0], aColor[1], aColor[2]); + double aWidth = SketchPlugin_SketchEntity::SKETCH_LINE_WIDTH(); + int aLineStyle = SketchPlugin_SketchEntity::SKETCH_LINE_STYLE(); + if (isConstruction) { + aColor = Config_PropManager::color("Visualization", "sketch_auxiliary_color", + SKETCH_AUXILIARY_COLOR); + aWidth = SketchPlugin_SketchEntity::SKETCH_LINE_WIDTH_AUXILIARY(); + aLineStyle = SketchPlugin_SketchEntity::SKETCH_LINE_STYLE_AUXILIARY(); + } + else { + aColor = Config_PropManager::color("Visualization", "sketch_entity_color", + SKETCH_ENTITY_COLOR); + } + anAIS->setColor(aColor[0], aColor[1], aColor[2]); + anAIS->setWidth(aWidth + 1); + anAIS->setLineStyle(aLineStyle); } return anAIS; } -- 2.39.2