Salome HOME
Implementation of the Feature Validator
[modules/shaper.git] / src / SketchPlugin / plugin-Sketch.xml
index 20c8e80d547ec5dcd2b0bc6b7ca1fca87b1d0c6a..b343b57cadbe90f35a4dc40274b037579d317ee7 100644 (file)
@@ -2,7 +2,7 @@
   <workbench id="Sketch">
     <group id="Basic">
       <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"/> 
+        <sketch-start-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>
       <feature id="SketchPoint" title="Point" tooltip="Create a new point" icon=":icons/point.png">
@@ -11,6 +11,7 @@
       <feature id="SketchLine" title="Line" tooltip="Create a new line" icon=":icons/line.png">
         <point_selector id="StartPoint" title="Start point" tooltip="Start point of the line" previous_feature_param="EndPoint"/>
         <point_selector id="EndPoint" title="End point" tooltip="End point of the line"/>
+        <validator id="Model_FeatureValidator" />
       </feature>
       <feature id="SketchCircle" title="Circle" tooltip="Create a new circle" icon=":icons/circle.png">
         <point_selector id="CircleCenter" title="Center" tooltip="Center of the circle"/>
         <point_selector id="ArcStartPoint" title="Start point" tooltip="Start point of the arc"/>
         <point_selector id="ArcEndPoint" title="End point" tooltip="End point of the arc"/>
       </feature>
+    </group>
+         
+    <group id="Constraints">
       <feature id="SketchConstraintCoincidence" title="Coincident" tooltip="Create constraint for the coincidence of two points" internal="1"/>
+
       <feature id="SketchConstraintDistance" title="Distance" tooltip="Create constraint for the distance from a point to an object">
         <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" label="First point" tooltip="Select an point in the viewer" keysequence="SketchPoint"/>
-        <feature_selector id="ConstraintEntityB" label="Last point" tooltip="Select an point in the viewer" keysequence="SketchPoint"/>
+        <feature_or_attribute_selector id="ConstraintEntityA" label="First object" tooltip="Select an point in the viewer">
+          <validator id="Model_ResultPointValidator"/>
+          <validator id="Model_ResultLineValidator"/>
+        </feature_or_attribute_selector>
+        <feature_or_attribute_selector id="ConstraintEntityB" label="Last object" tooltip="Select an point in the viewer">
+          <validator id="Model_ResultPointValidator"/>
+          <validator id="Model_ResultLineValidator"/>
+          <validator id="SketchPlugin_DistanceAttrValidator" parameters="ConstraintEntityA"/>
+        </feature_or_attribute_selector>
         <point_selector id="ConstraintFlyoutValuePnt" internal="1"/>
         <doublevalue_editor label="Value" tooltip="Constraint value" id="ConstraintValue"/>
+        <validator id="PartSet_DistanceValidator"/>
       </feature>
+      
       <feature id="SketchConstraintLength" title="Length" tooltip="Create constraint for the given length of a line segment">
         <label title="Select a line on which to calculate lenght" tooltip="Select a line on which to calculate lenght"/>
-        <feature_selector id="ConstraintEntityA" label="Line" tooltip="Select an line in the viewer" keysequence="SketchLine"/>
+        <feature_selector id="ConstraintEntityA" label="Line" tooltip="Select an line in the viewer">
+          <validator id="Model_ResultLineValidator"/>
+        </feature_selector>
         <point_selector id="ConstraintFlyoutValuePnt" internal="1"/>
         <doublevalue_editor label="Value" tooltip="Constraint value" id="ConstraintValue"/>
+        <validator id="PartSet_LengthValidator"/> 
       </feature>
+      
       <feature id="SketchConstraintRadius" title="Radius" tooltip="Create constraint for the given radius of a circle or an arc">
         <label title="Select a circle or an arc on which to calculate radius" tooltip="Select a circle or an arc on which to calculate radius"/>
-        <feature_selector id="ConstraintEntityA" label="Circle or Arc" tooltip="Select a circle or an arc in the viewer" keysequence="SketchCircle SketchArc"/>
+        <feature_selector id="ConstraintEntityA" label="Circle or Arc" tooltip="Select a circle or an arc in the viewer">
+          <validator id="Model_ResultArcValidator"/>
+        </feature_selector>
         <point_selector id="ConstraintFlyoutValuePnt" internal="1"/>
         <doublevalue_editor label="Value" tooltip="Constraint value" id="ConstraintValue"/>
+        <validator id="PartSet_RadiusValidator"/>
       </feature>
+      
       <feature id="SketchConstraintParallel" title="Parallel" tooltip="Create constraint defining two parallel lines">
-        <feature_selector id="ConstraintEntityA" label="First line" tooltip="Select an line in the viewer" keysequence="SketchLine"/>
-        <feature_selector id="ConstraintEntityB" label="Last line" tooltip="Select an line in the viewer" keysequence="SketchLine"/>
+        <feature_selector id="ConstraintEntityA" label="First line" tooltip="Select an line in the viewer">
+          <validator id="Model_ResultLineValidator"/>
+        </feature_selector>
+        <feature_selector id="ConstraintEntityB" label="Last line" tooltip="Select an line in the viewer">
+          <validator id="Model_ResultLineValidator"/>
+        </feature_selector>
         <point_selector id="ConstraintFlyoutValuePnt" internal="1"/>
+        <validator id="PartSet_ParallelValidator"/>
       </feature>
+      
       <feature id="SketchConstraintPerpendicular" title="Perpendicular" tooltip="Create constraint defining two perpendicular lines">
-        <feature_selector id="ConstraintEntityA" label="First line" tooltip="Select an line in the viewer" keysequence="SketchLine"/>
-        <feature_selector id="ConstraintEntityB" label="Last line" tooltip="Select an line in the viewer" keysequence="SketchLine"/>
+        <feature_selector id="ConstraintEntityA" label="First line" tooltip="Select an line in the viewer">
+          <validator id="Model_ResultLineValidator"/>
+        </feature_selector>
+        <feature_selector id="ConstraintEntityB" label="Last line" tooltip="Select an line in the viewer">
+          <validator id="Model_ResultLineValidator"/>
+        </feature_selector>
         <point_selector id="ConstraintFlyoutValuePnt" internal="1"/>
+        <validator id="PartSet_PerpendicularValidator"/>
       </feature>
     </group>
   </workbench>