From: vsv Date: Wed, 9 Oct 2019 12:08:08 +0000 (+0300) Subject: 2.10. Show thicker edges in Projection feature "included into sketch results" X-Git-Tag: V9_5_0a1~167^2~92 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3db694902fde7e36a75b0cc7c5b904e0612533dc;p=modules%2Fshaper.git 2.10. Show thicker edges in Projection feature "included into sketch results" --- diff --git a/src/SketchPlugin/SketchPlugin_Plugin.cpp b/src/SketchPlugin/SketchPlugin_Plugin.cpp index d9e967e60..ac1b442c8 100644 --- a/src/SketchPlugin/SketchPlugin_Plugin.cpp +++ b/src/SketchPlugin/SketchPlugin_Plugin.cpp @@ -171,6 +171,10 @@ SketchPlugin_Plugin::SketchPlugin_Plugin() "Sketch fully constrained color", Config_Prop::Color, SKETCH_FULLY_CONSTRAINED_COLOR); + Config_PropManager::registerProp("Visualization", "sketch_line_width", + "Sketch line width", + Config_Prop::IntSpin, "3"); + // register sketcher properties #ifdef SET_PLANES_COLOR_IN_PREFERENCES Config_PropManager::registerProp("Visualization", "yz_plane_color", "YZ plane color", diff --git a/src/SketchPlugin/SketchPlugin_SketchEntity.h b/src/SketchPlugin/SketchPlugin_SketchEntity.h index eb50851fa..b915d8540 100644 --- a/src/SketchPlugin/SketchPlugin_SketchEntity.h +++ b/src/SketchPlugin/SketchPlugin_SketchEntity.h @@ -74,7 +74,7 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC /// Width of the line inline static const double SKETCH_LINE_WIDTH() { - return 3; + return Config_PropManager::integer("Visualization", "sketch_line_width"); } /// Style of the auxiliary line @@ -111,6 +111,24 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC return false; } + virtual bool isIncludeToResult() const + { + AttributeBooleanPtr anAttr; + std::set aRefsToMe = data()->refsToMe(); + std::set::const_iterator aIt; + for (aIt = aRefsToMe.cbegin(); aIt != aRefsToMe.cend(); ++aIt) { + if ((*aIt)->id() == "ProjectedFeature") { + FeaturePtr aFeature = std::dynamic_pointer_cast((*aIt)->owner()); + if (aFeature.get()) { + anAttr = aFeature->data()->boolean("IncludeToResult"); + if (anAttr.get()) + return anAttr->value(); + } + } + } + return true; + } + // LCOV_EXCL_START /// Customize presentation of the feature virtual bool customisePresentation(ResultPtr theResult, AISObjectPtr thePrs, @@ -181,7 +199,7 @@ class SketchPlugin_SketchEntity : public SketchPlugin_Feature, public GeomAPI_IC thePrs->setWidth(17); // thePrs->setPointMarker(1, 1.); // Set point as a '+' symbol } - if(isCopy()) { + if(isCopy() && !isIncludeToResult()) { double aWidth = thePrs->width(); isCustomized = thePrs->setWidth(aWidth / 2.5) || isCustomized; }