Salome HOME
Horisontal and vertical constraints added
[modules/shaper.git] / src / SketchPlugin / plugin-Sketch.xml
1 <!-- Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 <plugin>
4   <workbench id="Sketch">
5     <group id="Basic">
6       <feature
7         id="Sketch"
8         nested="SketchPoint SketchLine SketchCircle SketchArc SketchConstraintLength SketchConstraintRadius SketchConstraintDistance SketchConstraintParallel SketchConstraintPerpendicular SketchConstraintRigid SketchConstraintHorizontal SketchConstraintVertical SketchConstraintEqual"
9         when_nested="accept abort"
10         title="Sketch"
11         tooltip="Create a new sketch"
12         icon=":icons/sketch.png">
13         <sketch-start-label title="Select a plane on which to create a sketch" tooltip="Select a plane on which to create a sketch"/> 
14       <!--icon=":pictures/x_point.png"-->
15       </feature>
16       <feature id="SketchPoint" title="Point" tooltip="Create a new point" icon=":icons/point.png">
17         <sketch-2dpoint_selector id="PointCoordindates" title="Point" tooltip="Point coordinates"/>
18         <boolvalue id="Auxiliary" label="Auxiliary" default="false" tooltip="Construction element" obligatory="0"/>
19       </feature>
20       <feature id="SketchLine" title="Line" tooltip="Create a new line" icon=":icons/line.png">
21         <sketch-2dpoint_selector id="StartPoint" title="Start point" tooltip="Start point coordinates" previous_feature_param="EndPoint"/>
22         <sketch-2dpoint_selector id="EndPoint" title="End point" tooltip="End point coordinates"/>
23         <boolvalue id="Auxiliary" label="Auxiliary" default="false" tooltip="Construction element" obligatory="0"/>
24       </feature>
25       <feature id="SketchCircle" title="Circle" tooltip="Create a new circle" icon=":icons/circle.png">
26         <sketch-2dpoint_selector id="CircleCenter" title="Center" tooltip="Center coordinates"/>
27         <point2ddistance id="CircleRadius" first_point="CircleCenter" label="Radius:" min="0" step="1.0" default="0" icon=":icons/radius.png" tooltip="Set radius">
28           <validator id="GeomValidators_Positive"/>
29         </point2ddistance>
30         <boolvalue id="Auxiliary" label="Auxiliary" default="false" tooltip="Construction element" obligatory="0"/>
31       </feature>
32       <feature id="SketchArc" title="Arc" tooltip="Create a new arc" icon=":icons/arc.png">
33         <sketch-2dpoint_selector id="ArcCenter" title="Center" tooltip="Center of a circle"/>
34         <sketch-2dpoint_selector id="ArcStartPoint" title="Start point" tooltip="Start point"/>
35         <sketch-2dpoint_selector id="ArcEndPoint" title="End point" tooltip="End point"/>
36         <boolvalue id="Auxiliary" label="Auxiliary" default="false" tooltip="Construction element" obligatory="0"/>
37       </feature>
38     </group>
39       
40     <group id="Constraints">
41       <feature
42         id="SketchConstraintCoincidence"
43         title="Coincident"
44         tooltip="Create constraint for the coincidence of two points"
45         internal="1" />
46     <!--  SketchConstraintDistance  -->
47       <feature
48         id="SketchConstraintDistance"
49         title="Distance"
50         tooltip="Set fixed distance from a point to an object"
51         icon=":icons/distance.png">
52         <label title="Select objects for distance definition. Following objects can be accepted: point, line or arc end point, center of circle or arc."/>
53         <sketch_shape_selector
54               id="ConstraintEntityA"
55               label="First object"
56               tooltip="Select point, line end point, line, center of circle or arc."
57               shape_types="edge vertex">
58           <validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityB"/>
59           <selection_filter id="MultiFilter" parameters="line,vertex"/>
60         </sketch_shape_selector>/>
61         <sketch_shape_selector 
62           id="ConstraintEntityB" 
63           label="Last object" 
64           tooltip="Select point, line end point, line, center of circle or arc." 
65                 shape_types="edge vertex">
66           <validator id="PartSet_DifferentObjects"/>
67           <validator id="SketchPlugin_DistanceAttr" parameters="ConstraintEntityA"/>
68           <validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityB"/>
69           <selection_filter id="MultiFilter" parameters="line,vertex"/>
70     </sketch_shape_selector>
71         
72         <sketch-2dpoint_selector id="ConstraintFlyoutValuePnt"  default="computed" internal="1" obligatory="0"/>
73         
74         <doublevalue_editor label="Value" tooltip="Distance" id="ConstraintValue" default="computed" min="0">
75           <validator id="GeomValidators_Positive"/>
76         </doublevalue_editor>
77         
78         <validator id="PartSet_DistanceValidator"/>
79       </feature>
80     <!--  SketchConstraintLength  -->      
81       <feature id="SketchConstraintLength" title="Length" tooltip="Set fixed length of a line segment" icon=":icons/length.png">
82         <label title="Select a line on which to calculate length" tooltip="Select a line on which to calculate length"/>
83         <shape_selector id="ConstraintEntityA" label="Line" tooltip="Select an line" 
84             shape_types="edge" >
85             <validator id="SketchPlugin_ResultLine"/>
86       <selection_filter id="EdgeFilter" parameters="line"/>
87       <validator id="SketchPlugin_ResultLine"/>
88     </shape_selector>
89         <sketch-2dpoint_selector id="ConstraintFlyoutValuePnt" default="computed" internal="1" obligatory="0"/>
90         <doublevalue_editor label="Value" tooltip="Length" id="ConstraintValue" default="computed">
91           <validator id="GeomValidators_Positive"/>
92         </doublevalue_editor>
93         <validator id="PartSet_LengthValidator"/>
94       </feature>
95     <!--  SketchConstraintRadius  -->
96       <feature id="SketchConstraintRadius" title="Radius" tooltip="Set fixed radius of a circle or an arc" icon=":icons/radius_constr.png">
97         <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"/>
98         <shape_selector id="ConstraintEntityA" label="Circle or Arc" tooltip="Select a circle or an arc" 
99             shape_types="edge">
100             <validator id="SketchPlugin_ResultArc"/>
101             <selection_filter id="EdgeFilter" parameters="circle"/>
102         </shape_selector>
103         <sketch-2dpoint_selector id="ConstraintFlyoutValuePnt"  default="computed" internal="1" obligatory="0"/>
104         <doublevalue_editor label="Value" tooltip="Radius" id="ConstraintValue" default="computed"/>
105         <validator id="PartSet_RadiusValidator"/>
106       </feature>
107     <!--  SketchConstraintParallel  -->
108       <feature id="SketchConstraintParallel" title="Parallel" tooltip="Create constraint defining two parallel lines" icon=":icons/parallel.png">
109         <sketch_constraint_shape_selector id="ConstraintEntityA" 
110             label="First line" tooltip="Select a line" shape_types="edge">
111             <selection_filter id="EdgeFilter" parameters="line"/>
112           <validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityB"/>
113         </sketch_constraint_shape_selector>
114         
115         <sketch_constraint_shape_selector id="ConstraintEntityB" label="Last line" tooltip="Select a line" 
116             shape_types="edge">
117             <selection_filter id="EdgeFilter" parameters="line"/>
118             <validator id="PartSet_DifferentObjects"/>
119             <validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityA"/>
120         </sketch_constraint_shape_selector>
121         
122         <validator id="PartSet_ParallelValidator"/>
123       </feature>
124     <!--  SketchConstraintPerpendicular  -->
125       <feature id="SketchConstraintPerpendicular" title="Perpendicular" tooltip="Create constraint defining two perpendicular lines" icon=":icons/perpendicular.png">
126         <sketch_constraint_shape_selector id="ConstraintEntityA" 
127             label="First line" tooltip="Select an line" 
128             shape_types="edge">
129           <validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityB"/>
130           <selection_filter id="EdgeFilter" parameters="line"/>
131     </sketch_constraint_shape_selector>
132         
133         <sketch_constraint_shape_selector id="ConstraintEntityB" 
134             label="Last line" tooltip="Select an line" 
135             shape_types="edge">
136             <validator id="PartSet_DifferentObjects"/>
137           <validator id="SketchPlugin_ShapeValidator" parameters="ConstraintEntityA"/>
138           <selection_filter id="EdgeFilter" parameters="line"/>
139     </sketch_constraint_shape_selector>
140         <validator id="PartSet_PerpendicularValidator"/>
141       </feature>
142     <!--  SketchConstraintRigid  -->
143       <feature id="SketchConstraintRigid" title="Fixed" tooltip="Fix an object" icon=":icons/fixed.png">
144         <shape_selector id="ConstraintEntityA" label="Object" tooltip="Select an object" 
145             shape_types="edge vertex">
146             <validator id="SketchPlugin_ResultPoint"/>
147             <validator id="SketchPlugin_ResultLine"/>
148             <validator id="SketchPlugin_ResultArc"/>
149         </shape_selector>
150         <validator id="PartSet_RigidValidator"/>
151       </feature>
152     <!--  SketchConstraintHorizontal  -->
153       <feature id="SketchConstraintHorizontal" title="Horizontal" tooltip="Create constraint defining horizontal line" icon=":icons/horisontal.png">
154         <sketch_constraint_shape_selector id="ConstraintEntityA" 
155             label="Line" tooltip="Select a line" shape_types="edge">
156             <selection_filter id="EdgeFilter" parameters="line"/>
157         </sketch_constraint_shape_selector>
158       </feature>
159     <!--  SketchConstraintVertical  -->
160       <feature id="SketchConstraintVertical" title="Vertical" tooltip="Create constraint defining vertical line" icon=":icons/vertical.png">
161         <sketch_constraint_shape_selector id="ConstraintEntityA" 
162             label="Line" tooltip="Select a line" shape_types="edge">
163             <selection_filter id="EdgeFilter" parameters="line"/>
164         </sketch_constraint_shape_selector>
165       </feature>
166     <!--  SketchConstraintEqual  -->
167       <feature id="SketchConstraintEqual" title="Equal" tooltip="Create constraint defining equality of two objects">
168         <sketch_constraint_shape_selector id="ConstraintEntityA" 
169             label="First object" tooltip="Select line, circle or arc" shape_types="edge">
170         </sketch_constraint_shape_selector>
171         
172         <sketch_constraint_shape_selector id="ConstraintEntityB"
173             label="Last object" tooltip="Select line, circle or arc" shape_types="edge">
174         </sketch_constraint_shape_selector>
175       </feature>
176     </group>
177   </workbench>
178 </plugin>