/// Returns color lighter than sketch feature entity : pink
static const std::string OPERATION_REMOVE_FEATURE_COLOR() { return "255, 174, 201"; }
- /// Returns color equal to default color of construction plugin : gray
- static const std::string OPERATION_SKETCH_PLANE() { return "150,150,180"; }
+ /// Returns color equal to default color of construction plugin : green
+ static const std::string OPERATION_SKETCH_PLANE() { return "170,255,0"; }
public:
/// Constructor
/// \param theWorkshop a reference to workshop
if (!aPnt_A || !aPnt_B) // Objects not found
return false;
+ if (theConstraint->getKind() == SketchPlugin_ConstraintDistanceHorizontal::ID()) {
+ if (fabs(aPnt_A->x() - aPnt_B->x()) < Precision::Confusion())
+ return false;
+ }
+ else if (theConstraint->getKind() == SketchPlugin_ConstraintDistanceVertical::ID()) {
+ if (fabs(aPnt_A->y() - aPnt_B->y()) < Precision::Confusion())
+ return false;
+ }
+
// Get points from these object
std::shared_ptr<GeomAPI_Pnt> aPoint1 = thePlane->to3D(aPnt_A->x(), aPnt_A->y());
std::shared_ptr<GeomAPI_Pnt> aPoint2 = thePlane->to3D(aPnt_B->x(), aPnt_B->y());