Salome HOME
6082e526b538358cb5e501fabad6ac7dca7ab607
[plugins/blsurfplugin.git] / idl / BLSURFPlugin_Algorithm.idl
1 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 // ---
21 // File    : BLSURFPlugin_Algorithm.idl
22 // Authors : Francis KLOSS (OCC) & Patrick LAUG (INRIA) & Lioka RAZAFINDRAZAKA (CEA)
23 //           Size maps developement: Nicolas GEIMER (OCC) & Gilles DAVID (EURIWARE)
24 // ---
25 //
26 #ifndef _SMESH_BLSURFALGORITHM_IDL_
27 #define _SMESH_BLSURFALGORITHM_IDL_
28
29 #include "SMESH_Hypothesis.idl"
30 #include "GEOM_Gen.idl"
31 #include "SALOME_Exception.idl"
32
33 /*!
34  * BLSURFPlugin: interfaces to BLSURF related hypotheses and algorithms
35  */
36 module BLSURFPlugin
37 {
38   typedef sequence<string> string_array;
39
40   // Enforced vertex name
41   typedef string TEnfName;
42   // Entry
43   typedef string TEntry;
44   typedef sequence<TEntry> TEntryList;
45   // Group name
46   typedef string TEnfGroupName;
47   
48   // Coordinates of enforced vertex
49   typedef sequence<double,3> TEnfVertexCoords;
50   // List of coords
51   typedef sequence<TEnfVertexCoords> TEnfVertexCoordsList;
52   
53   // Enforced vertex
54   struct TEnfVertex {
55     TEnfName name;
56     TEntry geomEntry;
57     TEnfVertexCoords coords;
58     TEnfGroupName grpName;
59     TEntryList faceEntries;
60   };
61   // List of enforced vertices
62   typedef sequence<TEnfVertex> TEnfVertexList;
63
64   // Map Face Entry / List of enforced vertices
65   struct TFaceEntryEnfVertexListMapElement {
66     TEntry faceEntry;
67     TEnfVertexList enfVertexList;
68   };
69   typedef sequence<TFaceEntryEnfVertexListMapElement> TFaceEntryEnfVertexListMap;
70   
71   // Map Face Entry / List of coords
72   struct TFaceEntryCoordsListMapElement {
73     TEntry faceEntry;
74     TEnfVertexCoordsList coordsList;
75   };
76   typedef sequence<TFaceEntryCoordsListMapElement> TFaceEntryCoordsListMap;
77   
78   // Map Face Entry / List of enf vertex entries
79   struct TFaceEntryEnfVertexEntryListMapElement {
80     TEntry faceEntry;
81     TEntryList enfVertexEntryList;
82   };
83   typedef sequence<TFaceEntryEnfVertexEntryListMapElement> TFaceEntryEnfVertexEntryListMap;
84   
85   // Map Coords / Enforced vertex
86   struct TCoordsEnfVertexElement {
87     TEnfVertexCoords coords;
88     TEnfVertex enfVertex;
89   };
90   typedef sequence<TCoordsEnfVertexElement> TCoordsEnfVertexMap;
91   
92   // Map Enf Vertex Entry / Enforced vertex
93   struct TEnfVertexEntryEnfVertexElement {
94     TEntry enfVertexEntry;
95     TEnfVertex enfVertex;
96   };
97   typedef sequence<TEnfVertexEntryEnfVertexElement> TEnfVertexEntryEnfVertexMap;
98
99   // List of Face Entry with internal enforced vertices activated
100   typedef sequence<TEntry> TFaceEntryInternalVerticesList;
101
102   // Attractors
103   struct TAttractorParams {
104     string faceEntry;
105     string attEntry;
106     double startSize;
107     double endSize;
108     double infDist;
109     double constDist;
110   };
111   typedef sequence<TAttractorParams> TAttParamsMap;
112   
113   /*!
114    * BLSURFPlugin_BLSURF: interface of BLSURF algorithm
115    */
116   interface BLSURFPlugin_BLSURF : SMESH::SMESH_2D_Algo
117   {
118   };
119
120   /*!
121    * BLSURFPlugin_Hypothesis: interface of "BLSURF parameters" hypothesis
122    */
123   interface BLSURFPlugin_Hypothesis : SMESH::SMESH_Hypothesis
124   {
125     /*!
126      * Sets topology usage way defining how mesh conformity is assured
127      * value=0 - mesh conformity is assured by conformity of a shape
128      * value=1,2 - mesh conformity is assured by pre-processing a CAD model
129      * value=3 - mesh conformity is assured by pre-processing a CAD model with Pre-CAD
130      */
131     void SetTopology(in long way);
132     long GetTopology();
133
134     /*!
135      * Sets a way to define size of mesh elements to generate
136      * 0 - size is defined automatically
137      * 1 - size is set by SetPhySize() method
138      * 2 - size is set by SetPhySize() method. A sizemap is defined.
139      */
140     void SetPhysicalMesh(in long isCustom);
141     long GetPhysicalMesh();
142
143     /*!
144      * Sets size of mesh elements to generate
145      */
146     void SetPhySize(in double size);
147     double GetPhySize();
148
149     /*!
150      * Sets lower boundary of mesh element size (PhySize)
151      */
152     void SetPhyMin(in double theMinSize);
153     double GetPhyMin();
154
155     /*!
156      * Sets upper boundary of mesh element size (PhySize)
157      */
158     void SetPhyMax(in double theMaxSize);
159     double GetPhyMax();
160
161     /*!
162      * Sets a way to define maximum angular deflection of mesh from CAD model
163      * 0 - deflection is defined automatically
164      * 1 - deflection is set by SetAngleMeshS() and SetAngleMeshC() methods
165      */
166     void SetGeometricMesh(in long isCustom);
167     long GetGeometricMesh();
168
169     /*!
170      * Sets angular deflection (in degrees) of a mesh face from CAD surface
171      */
172     void SetAngleMeshS(in double angle);
173     double GetAngleMeshS();
174
175     /*!
176      * Sets angular deflection (in degrees) of a mesh edge from CAD curve
177      */
178     void SetAngleMeshC(in double angle);
179     double GetAngleMeshC();
180
181     /*!
182      * Sets lower boundary of mesh element size computed to respect angular deflection
183      */
184     void SetGeoMin(in double theMinSize);
185     double GetGeoMin();
186
187     /*!
188      * Sets upper boundary of mesh element size computed to respect angular deflection
189      */
190     void SetGeoMax(in double theMaxSize);
191     double GetGeoMax();
192
193     /*!
194      * Sets maximal allowed ratio between the lengths of two adjacent edges
195      */
196     void SetGradation(in double ratio);
197     double GetGradation();
198
199     /*!
200      * Sets to create quadrilateral elements or not
201      */
202     void SetQuadAllowed(in boolean allowed);
203     boolean GetQuadAllowed();
204
205     /*!
206      * To respect geometrical edges or not
207      */
208     void SetDecimesh(in boolean toIgnoreEdges);
209     boolean GetDecimesh();
210
211     /*!
212      * Sets verbosity level in the range 0 to 100.
213      */
214     void SetVerbosity(in short theVal) raises (SALOME::SALOME_Exception);
215     short GetVerbosity();
216
217     /*!
218      * To merges edges.
219      */
220     void SetPreCADMergeEdges(in boolean toMergeEdges);
221     boolean GetPreCADMergeEdges();
222
223     /*!
224      * To remove nano edges.
225      */
226     void SetPreCADRemoveNanoEdges(in boolean toRemoveNanoEdges);
227     boolean GetPreCADRemoveNanoEdges();
228
229     /*!
230      * To compute topology from scratch
231      */
232     void SetPreCADDiscardInput(in boolean toDiscardInput);
233     boolean GetPreCADDiscardInput();
234
235     /*!
236      * Sets the length below which an edge is considered as nano 
237      * for the topology processing.
238      */
239     void SetPreCADEpsNano(in double epsNano);
240     double GetPreCADEpsNano();
241
242     /*!
243      * Sets advanced option value
244      */
245     void SetOptionValue(in string optionName,
246                         in string optionValue) raises (SALOME::SALOME_Exception);
247     void SetPreCADOptionValue(in string optionName,
248                         in string optionValue) raises (SALOME::SALOME_Exception);
249     string GetOptionValue(in string optionName) raises (SALOME::SALOME_Exception);
250     string GetPreCADOptionValue(in string optionName) raises (SALOME::SALOME_Exception);
251     /*!
252      * Unsets advanced option
253      */
254     void UnsetOption(in string optionName);
255     void UnsetPreCADOption(in string optionName);
256
257     /*!
258      * Return array of strings each of which is option name concatenated
259      * with option value devided by semicolon - "option_name:option_value".
260      * Option value is empty if an option is not set.
261      * Note: the method is mostly for interaction with GUI.
262      */
263     string_array GetOptionValues();
264     string_array GetPreCADOptionValues();
265
266     /*!
267      * Set option values each in the form "option_name[:option_value]".
268      * Note: the method is mostly for interaction with GUI.
269      */
270     void SetOptionValues(in string_array options);
271     void SetPreCADOptionValues(in string_array options);
272
273     /*!
274      * SizeMap
275      */
276     void SetSizeMapEntries(in string_array sizeMaps);
277     void ClearSizeMaps();
278
279     void UnsetEntry(in string entry);
280
281     /*!
282      * Set/unset a SizeMap on geom object
283      */
284     void         SetSizeMap(in GEOM::GEOM_Object GeomObj, in string sizeMap);
285     void         UnsetSizeMap(in GEOM::GEOM_Object GeomObj);
286     
287     /*!
288      * Set a SizeMap on geom object given by entry
289      */
290     void         SetSizeMapEntry(in string entry, in string sizeMap);
291     string       GetSizeMapEntry(in string entry);
292     string_array GetSizeMapEntries();
293
294     /*!
295      * Set/unset an attractor on geom object
296      */
297     void         SetAttractor(in GEOM::GEOM_Object GeomObj, in string attractor);
298     void         UnsetAttractor(in GEOM::GEOM_Object GeomObj);
299     
300     /*!
301      * Set an attractor on geom object given by entry
302      */
303     void         SetAttractorEntry(in string entry, in string attractor);
304     string       GetAttractorEntry(in string entry);
305     string_array GetAttractorEntries();
306
307     /*!
308      * Set/unset an attractor given as geom object on another geom object
309      */
310     void         SetAttractorGeom(in GEOM::GEOM_Object GeomObj, in GEOM::GEOM_Object AttractorShape, in double StartSize, in double EndSize, in double ActionRadius, in double ConstantRadius);
311     void         UnsetAttractorGeom(in GEOM::GEOM_Object GeomObj);
312
313     /*!
314      * Set an attractor given by entry on a geom object given by entry
315      */
316     void         SetClassAttractorEntry(in string entry, in string att_entry, in double StartSize, in double EndSize, in double ActionRadius, in double ConstantRadius );
317     BLSURFPlugin::TAttParamsMap GetAttractorParams();
318
319 /*
320     void         SetCustomSizeMapEntry(in string entry, in string sizeMap);
321     string       GetCustomSizeMapEntry(in string entry);
322     void         SetCustomSizeMap(in GEOM::GEOM_Object GeomObj, in string sizeMap);
323     void         UnsetCustomSizeMap(in GEOM::GEOM_Object GeomObj);
324     string_array GetCustomSizeMapEntries();
325 */
326     ///////////////////////
327     // ENFORCED VERTEXES //
328     ///////////////////////
329     
330     TFaceEntryEnfVertexListMap      GetAllEnforcedVerticesByFace();
331     TEnfVertexList                  GetAllEnforcedVertices();
332     
333     TFaceEntryCoordsListMap         GetAllCoordsByFace();
334     TCoordsEnfVertexMap             GetAllEnforcedVerticesByCoords();
335     
336     TFaceEntryEnfVertexEntryListMap GetAllEnfVertexEntriesByFace();
337     TEnfVertexEntryEnfVertexMap     GetAllEnforcedVerticesByEnfVertexEntry();
338     
339     void                            ClearAllEnforcedVertices();
340     
341    /*!
342     * Set/get/unset an enforced vertex on geom face
343     */
344     boolean SetEnforcedVertex(in GEOM::GEOM_Object theFace, in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
345     boolean SetEnforcedVertexNamed(in GEOM::GEOM_Object theFace, in double x, in double y, in double z, in TEnfName theVertexName) raises (SALOME::SALOME_Exception);
346     boolean SetEnforcedVertexGeom(in GEOM::GEOM_Object theFace, in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
347     boolean SetEnforcedVertexWithGroup(in GEOM::GEOM_Object theFace, in double x, in double y, in double z, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
348     boolean SetEnforcedVertexNamedWithGroup(in GEOM::GEOM_Object theFace, in double x, in double y, in double z, in TEnfName theVertexName, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
349     boolean SetEnforcedVertexGeomWithGroup(in GEOM::GEOM_Object theFace, in GEOM::GEOM_Object theVertex, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
350
351     
352     TEnfVertexList GetEnforcedVertices(in GEOM::GEOM_Object theFace) raises (SALOME::SALOME_Exception);
353     
354     boolean UnsetEnforcedVertex(in GEOM::GEOM_Object theFace, in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
355     boolean UnsetEnforcedVertexGeom(in GEOM::GEOM_Object theFace, in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
356     boolean UnsetEnforcedVertices(in GEOM::GEOM_Object theFace) raises (SALOME::SALOME_Exception);
357     
358    /*!
359     * Set/get/unset an enforced vertex on geom face given by entry
360     */
361     boolean SetEnforcedVertexEntry(in TEntry theFaceEntry, in double x, in double y, in double z, 
362                                    in TEnfName theVertexName, in TEntry theVertexEntry, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
363
364     TEnfVertexList GetEnforcedVerticesEntry(in TEntry theFaceEntry) raises (SALOME::SALOME_Exception);
365     boolean UnsetEnforcedVertexEntry(in TEntry theFaceEntry, in double x, in double y, in double z, in TEntry theVertexEntry) raises (SALOME::SALOME_Exception);
366 //    boolean UnsetEnforcedVertexEntryGeom(in TEntry theFaceEntry, in TEntry theVertexEntry) raises (SALOME::SALOME_Exception);
367     boolean UnsetEnforcedVerticesEntry(in TEntry theFaceEntry) raises (SALOME::SALOME_Exception);
368
369     /*!
370      * To get/set internal vertices as enforced vertices
371      */
372     void          SetInternalEnforcedVertexAllFaces(in boolean toEnforceInternalVertices);
373     boolean       GetInternalEnforcedVertexAllFaces();
374     void          SetInternalEnforcedVertexAllFacesGroup(in TEnfGroupName groupName);
375     TEnfGroupName GetInternalEnforcedVertexAllFacesGroup();
376
377 //  Enable internal enforced vertices on specific face if requested by user
378 //    void          SetInternalEnforcedVertex(in GEOM::GEOM_Object theFace,in boolean toEnforceInternalVertices) raises (SALOME::SALOME_Exception);
379 //    void          SetInternalEnforcedVertexWithGroup(in GEOM::GEOM_Object theFace, in boolean toEnforceInternalVertices, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
380 //    void          SetInternalEnforcedVertexEntry(in TEntry theFaceEntry, in boolean toEnforceInternalVertices, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
381 //    boolean       GetInternalEnforcedVertex(in GEOM::GEOM_Object theFace) raises (SALOME::SALOME_Exception);
382 //    boolean       GetInternalEnforcedVertexEntry(in TEntry theFaceEntry) raises (SALOME::SALOME_Exception);
383 //    TFaceEntryInternalVerticesList GetAllInternalEnforcedVerticesFaces();
384     ///////////////////////
385     
386     /*!
387      * Sets the file for export resulting mesh in GMF format
388      */
389 //     void SetGMFFile(in string theFileName, in boolean isBinary);
390     void SetGMFFile(in string theFileName);
391     string GetGMFFile();
392 //     boolean GetGMFFileMode();
393   };
394 };
395
396 #endif