#include <SketchPlugin_Circle.h>
#include <SketchPlugin_Arc.h>
#include <SketchPlugin_ConstraintDistance.h>
+#include <SketchPlugin_ConstraintLength.h>
+#include <SketchPlugin_ConstraintRadius.h>
+#include <SketchPlugin_ConstraintParallel.h>
+#include <SketchPlugin_ConstraintPerpendicular.h>
#include <GeomAPI_Pnt2d.h>
bool PartSet_OperationFeatureCreate::canProcessKind(const std::string& theId)
{
return theId == SKETCH_LINE_KIND || theId == SKETCH_POINT_KIND ||
- theId == SKETCH_CONSTRAINT_DISTANCE_KIND || theId == SKETCH_CIRCLE_KIND /*||
- theId == SKETCH_ARC_KIND*/;
+ theId == SKETCH_CIRCLE_KIND /*||
+ theId == SKETCH_ARC_KIND*/ ||
+ theId == SKETCH_CONSTRAINT_DISTANCE_KIND ||
+ theId == SKETCH_CONSTRAINT_LENGTH_KIND ||
+ theId == SKETCH_CONSTRAINT_RADIUS_KIND ||
+ theId == SKETCH_CONSTRAINT_PARALLEL_KIND ||
+ theId == SKETCH_CONSTRAINT_PERPENDICULAR_KIND;
}
bool PartSet_OperationFeatureCreate::canBeCommitted() const
#include "SketchPlugin_ConstraintLength.h"
+#include <GeomDataAPI_Point2D.h>
+
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_Data.h>
{
data()->addAttribute(CONSTRAINT_ATTR_VALUE, ModelAPI_AttributeDouble::type());
data()->addAttribute(CONSTRAINT_ATTR_FLYOUT_VALUE, ModelAPI_AttributeDouble::type());
+ data()->addAttribute(CONSTRAINT_ATTR_FLYOUT_VALUE_PNT, GeomDataAPI_Point2D::type());
data()->addAttribute(CONSTRAINT_ATTR_ENTITY_A, ModelAPI_AttributeRefAttr::type());
}
<plugin>
<workbench id="Sketch">
<group id="Basic">
- <feature id="Sketch" nested="SketchPoint SketchLine SketchCircle SketchArc SketchConstraintLength SketchConstraintRadius SketchConstraintDistance" title="Sketch" tooltip="Create a new sketch or edit an existing sketch" icon=":icons/sketch.png">
+ <feature id="Sketch" nested="SketchPoint SketchLine SketchCircle SketchArc SketchConstraintLength SketchConstraintRadius SketchConstraintDistance SketchConstraintParallel SketchConstraintPerpendicular" title="Sketch" tooltip="Create a new sketch or edit an existing sketch" icon=":icons/sketch.png">
<label title="Select a plane on which to create a sketch" tooltip="Select a plane on which to create a sketch"/>
<!--icon=":pictures/x_point.png"-->
</feature>
<label title="Select point and another feature (point or point on line) between which to calculate distance" tooltip="Select point and another feature (point or point on line) between which to calculate distance"/>
<feature_selector id="ConstraintEntityA" keysequence="SketchPoint" internal="1"/>
<feature_selector id="ConstraintEntityB" keysequence="SketchPoint" internal="1"/>
- <point_selector id="ConstraintFlyoutValuePnt" title="Flyout point" tooltip="Flyout" internal="1"/>
- <doublevalue_editor id="ConstraintValue" min="0" step="1.0" tooltip="Constraint value"/>
+ <point_selector id="ConstraintFlyoutValuePnt" internal="1"/>
+ <doublevalue_editor id="ConstraintValue"/>
</feature>
<feature id="SketchConstraintLength" title="Length of a line" tooltip="Create constraint for the given length of a line segment">
<label title="Select a line entity on which to calculate lenght" tooltip="Select a line entity on which to calculate lenght"/>
+ <feature_selector id="ConstraintEntityA" keysequence="SketchLine" internal="1"/>
+ <point_selector id="ConstraintFlyoutValuePnt" internal="1"/>
+ <doublevalue_editor id="ConstraintValue"/>
</feature>
<feature id="SketchConstraintRadius" title="Radius of a circle or an arc" tooltip="Create constraint for the given radius of a circle or an arc">
<label title="Select two points on a circle or an arc of circle on which to calculate radius" tooltip="Select two points on a circle or an arc of circle on which to calculate radius"/>
+ <feature_selector id="ConstraintEntityA" keysequence="SketchPoint" internal="1"/>
+ <point_selector id="CirclePoint" internal="1"/>
+ <doublevalue_editor id="ConstraintValue"/>
+ </feature>
+ <feature id="SketchConstraintParallel" title="Parallelism of a lines" tooltip="Create constraint defining two parallel lines">
+ <feature_selector id="ConstraintEntityA" keysequence="SketchLine" internal="1"/>
+ <feature_selector id="ConstraintEntityB" keysequence="SketchLine" internal="1"/>
+ </feature>
+ <feature id="SketchConstraintPerpendicular" title="Orthgonality of a lines" tooltip="Create constraint defining two perpendicular lines">
+ <feature_selector id="ConstraintEntityA" keysequence="SketchLine" internal="1"/>
+ <feature_selector id="ConstraintEntityB" keysequence="SketchLine" internal="1"/>
</feature>
- <feature id="SketchConstraintParallel" title="Parallelism of a lines" tooltip="Create constraint defining two parallel lines" internal="1"/>
- <feature id="SketchConstraintPerpendicular" title="Orthgonality of a lines" tooltip="Create constraint defining two perpendicular lines" internal="1"/>
</group>
</workbench>
</plugin>