Salome HOME
114692336bc5e3fe379d4bd20bbb7a0c1832e3ac
[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 SketchConstraintTangent SketchConstraintFillet SketchConstraintCoincidence SketchConstraintMirror"
9         when_nested="accept abort"
10         title="Sketch"
11         tooltip="Create a new sketch"
12         icon=":icons/sketch.png">
13         <sketch-start-label id="External" title="Select a plane on which to create a sketch" tooltip="Select a plane on which to create a sketch">
14           <validator id="GeomValidators_Face" parameters="plane"/>
15         </sketch-start-label>
16       <!--icon=":pictures/x_point.png"-->
17       </feature>
18       <feature id="SketchPoint" title="Point" tooltip="Create a new point" icon=":icons/point.png">
19         <sketch-2dpoint_selector id="PointCoordindates" title="Point" tooltip="Point coordinates"/>
20         <boolvalue id="Auxiliary" label="Auxiliary" default="false" tooltip="Construction element" obligatory="0"/>
21       </feature>
22       <feature id="SketchLine" title="Line" tooltip="Create a new line" icon=":icons/line.png">
23         <sketch-2dpoint_selector id="StartPoint" title="Start point" tooltip="Start point coordinates" previous_feature_param="EndPoint"/>
24         <sketch-2dpoint_selector id="EndPoint" title="End point" tooltip="End point coordinates"/>
25         <boolvalue id="Auxiliary" label="Auxiliary" default="false" tooltip="Construction element" obligatory="0"/>
26       </feature>
27       <feature id="SketchCircle" title="Circle" tooltip="Create a new circle" icon=":icons/circle.png">
28         <sketch-2dpoint_selector id="CircleCenter" title="Center" tooltip="Center coordinates"/>
29         <point2ddistance id="CircleRadius" first_point="CircleCenter" label="Radius:" min="0" step="1.0" default="0" icon=":icons/radius.png" tooltip="Set radius">
30           <validator id="GeomValidators_Positive"/>
31         </point2ddistance>
32         <boolvalue id="Auxiliary" label="Auxiliary" default="false" tooltip="Construction element" obligatory="0"/>
33       </feature>
34       <feature id="SketchArc" title="Arc" tooltip="Create a new arc" icon=":icons/arc.png">
35         <sketch-2dpoint_selector id="ArcCenter" title="Center" tooltip="Center of a circle"/>
36         <sketch-2dpoint_selector id="ArcStartPoint" title="Start point" tooltip="Start point"/>
37         <sketch-2dpoint_selector id="ArcEndPoint" title="End point" tooltip="End point"/>
38         <boolvalue id="Auxiliary" label="Auxiliary" default="false" tooltip="Construction element" obligatory="0"/>
39       </feature>
40     </group>
41       
42     <group id="Constraints">
43     <!--  SketchConstraintDistance  -->
44       <feature
45         id="SketchConstraintDistance"
46         title="Distance"
47         tooltip="Set fixed distance from a point to an object"
48         icon=":icons/distance.png">
49         <label title="Select objects for distance definition. Following objects can be accepted: point, line or arc end point, center of circle or arc."/>
50         <sketch_shape_selector
51               id="ConstraintEntityA"
52               label="First object"
53               tooltip="Select point, line end point, line, center of circle or arc."
54               shape_types="edge vertex">
55           <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityB"/>
56           <validator id="GeomValidators_EdgeOrVertex"/>
57         </sketch_shape_selector>/>
58         <sketch_shape_selector 
59           id="ConstraintEntityB" 
60           label="Last object" 
61           tooltip="Select point, line end point, line, center of circle or arc." 
62           shape_types="edge vertex">
63           <validator id="PartSet_DifferentObjects"/>
64           <validator id="SketchPlugin_DistanceAttr" parameters="ConstraintEntityA"/>
65           <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityA"/>
66           <validator id="GeomValidators_EdgeOrVertex"/>
67         </sketch_shape_selector>
68  <!--
69  TODO(nds): v1.0.2, master  
70                             shape_types="edge vertex">
71                         <validator id="PartSet_DifferentObjects"/>
72       <validator id="SketchPlugin_DistanceAttr" parameters="ConstraintEntityA"/>
73       <selection_filter id="MultiFilter" parameters="line,vertex"/>
74     </sketch_shape_selector>
75                 
76         <sketch-2dpoint_selector id="ConstraintFlyoutValuePnt" internal="1" obligatory="0"/>
77  -->
78         
79         <sketch-2dpoint_selector id="ConstraintFlyoutValuePnt"  default="computed" internal="1" obligatory="0"/>
80         
81         <doublevalue_editor label="Value" tooltip="Distance" id="ConstraintValue" default="computed" min="0">
82           <validator id="GeomValidators_Positive"/>
83         </doublevalue_editor>
84         
85         <validator id="PartSet_DistanceValidator"/>
86       </feature>
87       
88     <!--  SketchConstraintLength  -->      
89       <feature id="SketchConstraintLength" title="Length" tooltip="Set fixed length of a line segment" icon=":icons/length.png">
90         <label title="Select a line on which to calculate length" tooltip="Select a line on which to calculate length"/>
91         <shape_selector id="ConstraintEntityA" label="Line" tooltip="Select an line" 
92             shape_types="edge" >
93         <validator id="GeomValidators_Edge" parameters="line"/>
94     </shape_selector>
95         <sketch-2dpoint_selector id="ConstraintFlyoutValuePnt" default="computed" internal="1" obligatory="0"/>
96         <doublevalue_editor label="Value" tooltip="Length" id="ConstraintValue" default="computed">
97           <validator id="GeomValidators_Positive"/>
98         </doublevalue_editor>
99         <validator id="PartSet_LengthValidator"/>
100       </feature>
101       
102     <!--  SketchConstraintRadius  -->
103       <feature id="SketchConstraintRadius" title="Radius" tooltip="Set fixed radius of a circle or an arc" icon=":icons/radius_constr.png">
104         <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"/>
105         <shape_selector id="ConstraintEntityA" label="Circle or Arc" tooltip="Select a circle or an arc" 
106             shape_types="edge">
107             <validator id="GeomValidators_Edge" parameters="circle"/>
108         </shape_selector>
109         <sketch-2dpoint_selector id="ConstraintFlyoutValuePnt"  default="computed" internal="1" obligatory="0"/>
110         <doublevalue_editor label="Value" tooltip="Radius" id="ConstraintValue" default="computed"/>
111         <validator id="PartSet_RadiusValidator"/>
112       </feature>
113       
114     <!--  SketchConstraintParallel  -->
115       <feature id="SketchConstraintParallel" title="Parallel" tooltip="Create constraint defining two parallel lines" icon=":icons/parallel.png">
116         <sketch_constraint_shape_selector id="ConstraintEntityA" 
117             label="First line" tooltip="Select a line" shape_types="edge">
118             <validator id="GeomValidators_Edge" parameters="line"/>
119             <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityB"/>
120         </sketch_constraint_shape_selector>
121         
122         <sketch_constraint_shape_selector id="ConstraintEntityB" label="Last line" tooltip="Select a line" 
123             shape_types="edge">
124             <validator id="GeomValidators_Edge" parameters="line"/>
125             <validator id="PartSet_DifferentObjects"/>
126             <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityA"/>
127         </sketch_constraint_shape_selector>
128         
129 <!--  
130   TODO(nds): v1.0.2, master  
131                 <sketch_constraint_shape_selector id="ConstraintEntityA" 
132                         label="First line" tooltip="Select a line" shape_types="edge">
133                         <selection_filter id="EdgeFilter" parameters="line"/>
134                 </sketch_constraint_shape_selector>
135                 
136                 <sketch_constraint_shape_selector id="ConstraintEntityB" label="Last line" tooltip="Select a line" 
137                         shape_types="edge">
138                         <selection_filter id="EdgeFilter" parameters="line"/>
139                         <validator id="PartSet_DifferentObjects"/>
140                 </sketch_constraint_shape_selector>
141                 
142         <sketch-2dpoint_selector id="ConstraintFlyoutValuePnt" internal="1" obligatory="0"/>
143 -->
144         <validator id="PartSet_ParallelValidator"/>
145       </feature>
146       
147     <!--  SketchConstraintPerpendicular  -->
148       <feature id="SketchConstraintPerpendicular" title="Perpendicular" 
149         tooltip="Create constraint defining two perpendicular lines" 
150         icon=":icons/perpendicular.png">
151         <sketch_constraint_shape_selector id="ConstraintEntityA" 
152             label="First line" tooltip="Select an line" 
153             shape_types="edge">
154           <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityB"/>
155             <validator id="GeomValidators_Edge" parameters="line"/>
156         </sketch_constraint_shape_selector>
157         
158         <sketch_constraint_shape_selector id="ConstraintEntityB" 
159             label="Last line" tooltip="Select an line" 
160             shape_types="edge">
161             <validator id="PartSet_DifferentObjects"/>
162           <validator id="SketchPlugin_ExternalValidator" parameters="ConstraintEntityA"/>
163             <validator id="GeomValidators_Edge" parameters="line"/>
164         </sketch_constraint_shape_selector>
165 <!--  
166   TODO(nds): v1.0.2, master
167                 <sketch_constraint_shape_selector id="ConstraintEntityA" 
168                         label="First line" tooltip="Select an line" 
169                         shape_types="edge">
170       <selection_filter id="EdgeFilter" parameters="line"/>
171     </sketch_constraint_shape_selector>
172                 
173                 <sketch_constraint_shape_selector id="ConstraintEntityB" 
174                         label="Last line" tooltip="Select an line" 
175                         shape_types="edge">
176                         <validator id="PartSet_DifferentObjects"/>
177       <selection_filter id="EdgeFilter" parameters="line"/>
178     </sketch_constraint_shape_selector>
179 -->
180         <validator id="PartSet_PerpendicularValidator"/>
181       </feature>
182
183       <!--  SketchConstraintCoincedence  -->
184       <feature id="SketchConstraintCoincidence" title="Coincident" tooltip="Create constraint for the coincidence of two points" icon=":icons/coincedence.png">
185         <sketch_shape_selector id="ConstraintEntityA" label="First point" tooltip="Select a first point" shape_types="vertex"/>
186         <sketch_shape_selector id="ConstraintEntityB" label="Second point" tooltip="Select a second point" shape_types="vertex">
187           <validator id="PartSet_DifferentObjects"/>
188         </sketch_shape_selector>
189       </feature>
190
191       <!--  SketchConstraintRigid  -->
192       <feature id="SketchConstraintRigid" title="Fixed" tooltip="Fix an object" icon=":icons/fixed.png">
193         <shape_selector id="ConstraintEntityA" label="Object" tooltip="Select an object" 
194             shape_types="edge vertex">
195           <validator id="PartSet_SketchEntityValidator" parameters="SketchPoint,SketchLine,SketchCircle,SketchArc"/>
196         </shape_selector>
197         <validator id="PartSet_RigidValidator"/>
198       </feature>
199       
200     <!--  SketchConstraintHorizontal  -->
201       <feature id="SketchConstraintHorizontal" title="Horizontal" tooltip="Create constraint defining horizontal line" icon=":icons/horisontal.png">
202         <sketch_constraint_shape_selector id="ConstraintEntityA" 
203             label="Line" tooltip="Select a line" shape_types="edge">
204             <validator id="GeomValidators_Edge" parameters="line"/>
205         </sketch_constraint_shape_selector>
206       </feature>
207       
208     <!--  SketchConstraintVertical  -->
209       <feature id="SketchConstraintVertical" title="Vertical" tooltip="Create constraint defining vertical line" icon=":icons/vertical.png">
210         <sketch_constraint_shape_selector id="ConstraintEntityA" 
211             label="Line" tooltip="Select a line" shape_types="edge">
212             <validator id="GeomValidators_Edge" parameters="line"/>
213         </sketch_constraint_shape_selector>
214       </feature>
215       
216     <!--  SketchConstraintEqual  -->
217       <feature id="SketchConstraintEqual" title="Equal" tooltip="Create constraint defining equality of two objects" icon=":icons/equal.png">
218         <sketch_constraint_shape_selector id="ConstraintEntityA" 
219             label="First object" tooltip="Select line, circle or arc" shape_types="edge">
220         </sketch_constraint_shape_selector>
221         
222         <sketch_constraint_shape_selector id="ConstraintEntityB"
223             label="Last object" tooltip="Select line, circle or arc" shape_types="edge">
224           <validator id="PartSet_SameTypeAttr" parameters="ConstraintEntityA"/>
225           <validator id="PartSet_DifferentObjects"/>
226         </sketch_constraint_shape_selector>
227       </feature>
228       
229     <!--  SketchConstraintTangent  -->
230       <feature id="SketchConstraintTangent" title="Tangent" tooltip="Create constraint defining tangency of two objects" icon=":icons/tangent.png">
231         <sketch_constraint_shape_selector id="ConstraintEntityA" 
232             label="First object" tooltip="Select line or arc" shape_types="edge">
233         </sketch_constraint_shape_selector>
234         
235         <sketch_constraint_shape_selector id="ConstraintEntityB"
236             label="Last object" tooltip="Select line or arc" shape_types="edge">
237         <validator id="SketchPlugin_TangentAttr" parameters="ConstraintEntityA"/>
238         </sketch_constraint_shape_selector>
239       </feature>
240       
241     <!--  SketchConstraintMirror  -->
242       <feature
243         id="SketchConstraintMirror"
244         title="Mirror"
245         tooltip="Create constraint, mirroring group of objects">
246         <sketch_constraint_shape_selector id="ConstraintEntityA" 
247             label="Mirror line" tooltip="Select mirror line" shape_types="edge">
248             <validator id="GeomValidators_Edge" parameters="line"/>
249         </sketch_constraint_shape_selector>
250         <multi_selector id="ConstraintMirrorList" 
251             label="List of objects"
252             tooltip="Select list of mirroring objects"
253             type_choice="Edges">
254         </multi_selector>
255       </feature>
256     </group>
257     
258     <group id="Edit">
259       <!--  SketchConstraintFillet  -->
260       <feature id="SketchConstraintFillet" title="Fillet" tooltip="Create constraint defining fillet between two objects" icon=":icons/fillet.png">
261         <sketch_constraint_shape_selector id="ConstraintEntityA" 
262             label="First object" tooltip="Select line or arc" shape_types="edge">
263         </sketch_constraint_shape_selector>
264
265         <sketch_constraint_shape_selector id="ConstraintEntityB"
266             label="Last object" tooltip="Select line or arc" shape_types="edge">
267         </sketch_constraint_shape_selector>
268
269         <doublevalue_editor label="Value" tooltip="Fillet radius" id="ConstraintValue" default="0" min="0">
270           <validator id="GeomValidators_Positive"/>
271         </doublevalue_editor>
272       </feature>
273     </group>
274   </workbench>
275 </plugin>