X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_ConstraintDistance.cpp;h=7eeee42670cd1c92051ff22e969147ea675eb403;hb=64fc7e4fdd63997ec7a502b233ef5f88186d5bbb;hp=a119433d36f7f09a5b0cd801cd8811ce1f56505b;hpb=705438fb7ab16ba1608b6b1aeddd546d6311cb77;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp index a119433d3..7eeee4267 100644 --- a/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp +++ b/src/SketchPlugin/SketchPlugin_ConstraintDistance.cpp @@ -134,6 +134,9 @@ AISObjectPtr SketchPlugin_ConstraintDistance::getAISObject(AISObjectPtr thePrevi if (!anAIS) { anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, sketch()->coordinatePlane()); } + std::vector aRGB = Config_PropManager::color("Visualization", "sketch_dimension_color", + SKETCH_DIMENSION_COLOR); + anAIS->setColor(aRGB[0], aRGB[1], aRGB[2]); return anAIS; } @@ -274,6 +277,9 @@ void SketchPlugin_ConstraintDistance::attributeChanged(const std::string& theID) } else return; + if (aEndPnt->distance(aStartPnt) < tolerance) + return; + std::shared_ptr aLineDir(new GeomAPI_Dir2d(aEndPnt->decreased(aStartPnt))); std::shared_ptr aFlyoutDir = aFlyoutPnt->xy()->decreased(aStartPnt); @@ -284,15 +290,3 @@ void SketchPlugin_ConstraintDistance::attributeChanged(const std::string& theID) } } -bool SketchPlugin_ConstraintDistance::customisePresentation(ResultPtr theResult, - AISObjectPtr thePrs, - std::shared_ptr theDefaultPrs) -{ - bool isCustomized = false; - std::vector aRGB = Config_PropManager::color("Visualization", "sketch_dimension_color", - SKETCH_DIMENSION_COLOR); - isCustomized = thePrs->setColor(aRGB[0], aRGB[1], aRGB[2]); - - return isCustomized; -} -