data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId());
}
+void SketchPlugin_ConstraintDistance::colorConfigInfo(std::string& theSection, std::string& theName,
+ std::string& theDefault)
+{
+ theSection = "Visualization";
+ theName = "sketch_dimension_color";
+ theDefault = SKETCH_DIMENSION_COLOR;
+}
+
//*************************************************************************************
void SketchPlugin_ConstraintDistance::execute()
{
if (!sketch())
return thePrevious;
- AISObjectPtr anAIS = thePrevious;
- if (!anAIS) {
- anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, sketch()->coordinatePlane());
- }
- std::vector<int> aRGB = Config_PropManager::color("Visualization", "sketch_dimension_color",
- SKETCH_DIMENSION_COLOR);
- anAIS->setColor(aRGB[0], aRGB[1], aRGB[2]);
+ AISObjectPtr anAIS = SketcherPrs_Factory::lengthDimensionConstraint(this, sketch()->coordinatePlane(),
+ thePrevious);
return anAIS;
}
} else
return;
+ if (aEndPnt->distance(aStartPnt) < tolerance)
+ return;
+
std::shared_ptr<GeomAPI_Dir2d> aLineDir(new GeomAPI_Dir2d(aEndPnt->decreased(aStartPnt)));
std::shared_ptr<GeomAPI_XY> aFlyoutDir = aFlyoutPnt->xy()->decreased(aStartPnt);