X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Plugin.cpp;h=b0f84cc79008fbce693501597d0945640def36fb;hb=4ab46ebbcaca8341a41859a16b57d0ac80ea986c;hp=06a3d570257e14ff0a9163602e8e8331d2219db5;hpb=cc44f965f1cf88739b70bf73f33e877e72e11628;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Plugin.cpp b/src/SketchPlugin/SketchPlugin_Plugin.cpp index 06a3d5702..b0f84cc79 100644 --- a/src/SketchPlugin/SketchPlugin_Plugin.cpp +++ b/src/SketchPlugin/SketchPlugin_Plugin.cpp @@ -4,15 +4,18 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -72,6 +75,12 @@ SketchPlugin_Plugin::SketchPlugin_Plugin() new SketchPlugin_SolverErrorValidator); aFactory->registerValidator("SketchPlugin_FilletVertexValidator", new SketchPlugin_FilletVertexValidator); + aFactory->registerValidator("SketchPlugin_MiddlePointAttr", + new SketchPlugin_MiddlePointAttrValidator); + aFactory->registerValidator("SketchPlugin_ArcTangentPoint", + new SketchPlugin_ArcTangentPointValidator); + aFactory->registerValidator("SketchPlugin_IntersectionValidator", + new SketchPlugin_IntersectionValidator); // register this plugin ModelAPI_Session::get()->registerPlugin(this); @@ -88,6 +97,10 @@ SketchPlugin_Plugin::SketchPlugin_Plugin() Config_PropManager::registerProp("Visualization", "sketch_dimension_color", "Sketch dimension color", Config_Prop::Color, SKETCH_DIMENSION_COLOR); + Config_PropManager::registerProp("Visualization", "sketch_overconstraint_color", + "Sketch overconstraint color", + Config_Prop::Color, SKETCH_OVERCONSTRAINT_COLOR); + // register sketcher properties #ifdef SET_PLANES_COLOR_IN_PREFERENCES Config_PropManager::registerProp("Visualization", "yz_plane_color", "YZ plane color", @@ -105,6 +118,8 @@ FeaturePtr SketchPlugin_Plugin::createFeature(string theFeatureID) return FeaturePtr(new SketchPlugin_Sketch); } else if (theFeatureID == SketchPlugin_Point::ID()) { return FeaturePtr(new SketchPlugin_Point); + } else if (theFeatureID == SketchPlugin_IntersectionPoint::ID()) { + return FeaturePtr(new SketchPlugin_IntersectionPoint); } else if (theFeatureID == SketchPlugin_Line::ID()) { return FeaturePtr(new SketchPlugin_Line); } else if (theFeatureID == SketchPlugin_Circle::ID()) { @@ -113,6 +128,8 @@ FeaturePtr SketchPlugin_Plugin::createFeature(string theFeatureID) return FeaturePtr(new SketchPlugin_Arc); } else if (theFeatureID == SketchPlugin_ConstraintCoincidence::ID()) { return FeaturePtr(new SketchPlugin_ConstraintCoincidence); + } else if (theFeatureID == SketchPlugin_ConstraintCollinear::ID()) { + return FeaturePtr(new SketchPlugin_ConstraintCollinear); } else if (theFeatureID == SketchPlugin_ConstraintDistance::ID()) { return FeaturePtr(new SketchPlugin_ConstraintDistance); } else if (theFeatureID == SketchPlugin_ConstraintLength::ID()) { @@ -133,6 +150,8 @@ FeaturePtr SketchPlugin_Plugin::createFeature(string theFeatureID) return FeaturePtr(new SketchPlugin_ConstraintEqual); } else if (theFeatureID == SketchPlugin_ConstraintTangent::ID()) { return FeaturePtr(new SketchPlugin_ConstraintTangent); + } else if (theFeatureID == SketchPlugin_ConstraintMiddle::ID()) { + return FeaturePtr(new SketchPlugin_ConstraintMiddle); } else if (theFeatureID == SketchPlugin_ConstraintMirror::ID()) { return FeaturePtr(new SketchPlugin_ConstraintMirror); } else if (theFeatureID == SketchPlugin_ConstraintFillet::ID()) { @@ -180,10 +199,12 @@ std::shared_ptr SketchPlugin_Plugin !(aNormal->x() == 0 && aNormal->y() == 0 && aNormal->z() == 0); aMsg->setState(SketchPlugin_Point::ID(), aHasSketchPlane); + aMsg->setState(SketchPlugin_IntersectionPoint::ID(), aHasSketchPlane); aMsg->setState(SketchPlugin_Line::ID(), aHasSketchPlane); aMsg->setState(SketchPlugin_Circle::ID(), aHasSketchPlane); aMsg->setState(SketchPlugin_Arc::ID(), aHasSketchPlane); aMsg->setState(SketchPlugin_ConstraintCoincidence::ID(), aHasSketchPlane); + aMsg->setState(SketchPlugin_ConstraintCollinear::ID(), aHasSketchPlane); aMsg->setState(SketchPlugin_ConstraintDistance::ID(), aHasSketchPlane); aMsg->setState(SketchPlugin_ConstraintLength::ID(), aHasSketchPlane); aMsg->setState(SketchPlugin_ConstraintParallel::ID(), aHasSketchPlane); @@ -194,11 +215,14 @@ std::shared_ptr SketchPlugin_Plugin aMsg->setState(SketchPlugin_ConstraintVertical::ID(), aHasSketchPlane); aMsg->setState(SketchPlugin_ConstraintEqual::ID(), aHasSketchPlane); aMsg->setState(SketchPlugin_ConstraintTangent::ID(), aHasSketchPlane); + aMsg->setState(SketchPlugin_ConstraintMiddle::ID(), aHasSketchPlane); aMsg->setState(SketchPlugin_ConstraintMirror::ID(), aHasSketchPlane); aMsg->setState(SketchPlugin_ConstraintFillet::ID(), aHasSketchPlane); aMsg->setState(SketchPlugin_ConstraintAngle::ID(), aHasSketchPlane); aMsg->setState(SketchPlugin_MultiRotation::ID(), aHasSketchPlane); aMsg->setState(SketchPlugin_MultiTranslation::ID(), aHasSketchPlane); + // SketchRectangle is a python feature, so its ID is passed just as a string + aMsg->setState("SketchRectangle", aHasSketchPlane); } } return aMsg;