Salome HOME
c03c31ca50c200dddc3c7608b7c428b89b3d9d27
[plugins/blsurfplugin.git] / idl / BLSURFPlugin_Algorithm.idl
1 // Copyright (C) 2007-2013  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     /*!
127      * Sets a way to define size of mesh elements to generate
128      * 0 - size is defined automatically
129      * 1 - size is set by SetPhySize() method
130      * 2 - size is set by SetPhySize() method. A sizemap is defined.
131      */
132     void SetPhysicalMesh(in long isCustom);
133     long GetPhysicalMesh();
134
135     /*!
136      * Sets a way to define maximum angular deflection of mesh from CAD model
137      * 0 - deflection is defined automatically
138      * 1 - deflection is set by SetAngleMesh() method
139      * 2 - deflection is set by SetAngleMesh() method. A sizemap is defined (TODO).
140      */
141     void SetGeometricMesh(in long isCustom);
142     long GetGeometricMesh();
143
144     /*!
145      * Sets size of mesh elements to generate
146      */
147     void SetPhySize(in double size);
148     void SetPhySizeRel(in double size);
149     double GetPhySize();
150     boolean IsPhySizeRel();
151
152     /*!
153      * Sets lower boundary of mesh element size
154      */
155     void SetMinSize(in double theMinSize);
156     void SetMinSizeRel(in double theMinSize);
157     double GetMinSize();
158     boolean IsMinSizeRel();
159
160     /*!
161      * Sets upper boundary of mesh element size
162      */
163     void SetMaxSize(in double theMaxSize);
164     void SetMaxSizeRel(in double theMaxSize);
165     double GetMaxSize();
166     boolean IsMaxSizeRel();
167
168     /*!
169      * Sets maximal allowed ratio between the lengths of two adjacent edges
170      */
171     void SetGradation(in double ratio);
172     double GetGradation();
173
174     /*!
175      * Sets to create quadrilateral elements or not
176      */
177     void SetQuadAllowed(in boolean allowed);
178     boolean GetQuadAllowed();
179
180     /*!
181      * Sets angular deflection (in degrees) of a mesh face and edge from CAD surface
182      */
183     void SetAngleMesh(in double angle);
184     double GetAngleMesh();
185
186     /*!
187      * Sets the maximum desired distance between a triangle and its supporting CAD surface
188      */
189     void SetChordalError(in double distance);
190     double GetChordalError();
191
192     /*!
193      * Determines whether the generated mesh will be isotropic or anisotropic
194      */
195     void SetAnisotropic(in boolean anisotropic);
196     boolean GetAnisotropic();
197
198     /*!
199      * Defines the maximum anisotropic ratio of the metric governing the anisotropic process.
200      * The default value of 0 means that the metric (and thus the generated elements) 
201      * can be arbitrarily stretched.
202      */
203     void SetAnisotropicRatio(in double ratio);
204     double GetAnisotropicRatio();
205
206     /*!
207      * This patch-independent correction option can be activated to remove the tiny
208      * (nano) edges from the generated mesh, without taking into account the tags 
209      * (attributes) specifications.
210      */
211     void SetRemoveTinyEdges(in boolean remove);
212     boolean GetRemoveTinyEdges();
213
214     /*!
215      * Defines the minimal length under which an edge is considered to be a tiny one
216      */
217     void SetTinyEdgeLength(in double length);
218     double GetTinyEdgeLength();
219
220     /*!
221      * This patch independent correction option can be activated to remove the bad 
222      * elements (often called slivers) from the generated mesh, without taking into account
223      * the tags (attributes) specification.
224      */
225     void SetBadElementRemoval(in boolean remove);
226     boolean GetBadElementRemoval();
227
228     /*!
229      * This parameter defines the aspect ratio triggering the "bad element"
230      * classification for the force bad surface element removal option. 
231      */
232     void SetBadElementAspectRatio(in double ratio);
233     double GetBadElementAspectRatio();
234
235     /*!
236      * If this option is activated, MeshGems-CADSurf will optimize the mesh in order to
237      * get better shaped elements, during a process which respects the patch independent options.
238      * This optimisation cannot be fully performed when correct_surface_intersections = 1.
239      */
240     void SetOptimizeMesh(in boolean optimize);
241     boolean GetOptimizeMesh();
242
243     /*!
244      * Determines the order of mesh elements to be generated (linear or quadratic)
245      */
246     void SetQuadraticMesh(in boolean quadratic);
247     boolean GetQuadraticMesh();
248
249     /*!
250      * Sets topology usage way defining how mesh conformity is assured
251      * value=0 - mesh conformity is assured by conformity of a shape
252      * value=1,2 - mesh conformity is assured by pre-processing a CAD model (OBSOLETE)
253      * value=3 - mesh conformity is assured by pre-processing a CAD model with Pre-CAD
254      */
255     void SetTopology(in long way);
256     long GetTopology();
257
258     /*!
259      * Sets verbosity level in the range 0 to 100.
260      */
261     void SetVerbosity(in short theVal) raises (SALOME::SALOME_Exception);
262     short GetVerbosity();
263
264     /*!
265      * To merges edges.
266      */
267     void SetPreCADMergeEdges(in boolean toMergeEdges);
268     boolean GetPreCADMergeEdges();
269
270     /*!
271      * To process 3D topology.
272      */
273     void SetPreCADProcess3DTopology(in boolean toProcess);
274     boolean GetPreCADProcess3DTopology();
275
276
277     /*!
278      * To compute topology from scratch
279      */
280     void SetPreCADDiscardInput(in boolean toDiscardInput);
281     boolean GetPreCADDiscardInput();
282
283     /*!
284      * Sets advanced option value
285      */
286     void SetOptionValue(in string optionName,
287                         in string optionValue) raises (SALOME::SALOME_Exception);
288     void SetPreCADOptionValue(in string optionName,
289                         in string optionValue) raises (SALOME::SALOME_Exception);
290     string GetOptionValue(in string optionName) raises (SALOME::SALOME_Exception);
291     string GetPreCADOptionValue(in string optionName) raises (SALOME::SALOME_Exception);
292     /*!
293      * Unsets advanced option
294      */
295     void UnsetOption(in string optionName);
296     void UnsetPreCADOption(in string optionName);
297
298     /*!
299      * Return array of strings each of which is option name concatenated
300      * with option value devided by semicolon - "option_name:option_value".
301      * Option value is empty if an option is not set.
302      * Note: the method is mostly for interaction with GUI.
303      */
304     string_array GetOptionValues();
305     string_array GetPreCADOptionValues();
306
307     /*!
308      * Set option values each in the form "option_name[:option_value]".
309      * Note: the method is mostly for interaction with GUI.
310      */
311     void SetOptionValues(in string_array options);
312     void SetPreCADOptionValues(in string_array options);
313
314     /*!
315      * SizeMap
316      */
317     void SetSizeMapEntries(in string_array sizeMaps);
318     void ClearSizeMaps();
319
320     void UnsetEntry(in string entry);
321
322     /*!
323      * Set/unset a SizeMap on geom object
324      */
325     void         SetSizeMap(in GEOM::GEOM_Object GeomObj, in string sizeMap);
326     void         SetConstantSizeMap(in GEOM::GEOM_Object GeomObj, in double sizeMap);
327     void         UnsetSizeMap(in GEOM::GEOM_Object GeomObj);
328     
329     /*!
330      * Set a SizeMap on geom object given by entry
331      */
332     void         SetSizeMapEntry(in string entry, in string sizeMap);
333     void         SetConstantSizeMapEntry(in string entry, in GEOM::shape_type shapeType, in double sizeMap);
334     string       GetSizeMapEntry(in string entry);
335     string_array GetSizeMapEntries();
336
337     /*!
338      * Set/unset an attractor on geom object
339      */
340     void         SetAttractor(in GEOM::GEOM_Object GeomObj, in string attractor);
341     void         UnsetAttractor(in GEOM::GEOM_Object GeomObj);
342     
343     /*!
344      * Set an attractor on geom object given by entry
345      */
346     void         SetAttractorEntry(in string entry, in string attractor);
347     string       GetAttractorEntry(in string entry);
348     string_array GetAttractorEntries();
349
350     /*!
351      * Set/unset an attractor given as geom object on another geom object
352      */
353     void         SetAttractorGeom(in GEOM::GEOM_Object GeomObj, in GEOM::GEOM_Object AttractorShape, in double StartSize, in double EndSize, in double ActionRadius, in double ConstantRadius);
354     void         UnsetAttractorGeom(in GEOM::GEOM_Object GeomObj);
355
356     /*!
357      * Set an attractor given by entry on a geom object given by entry
358      */
359     void         SetClassAttractorEntry(in string entry, in string att_entry, in double StartSize, in double EndSize, in double ActionRadius, in double ConstantRadius );
360     BLSURFPlugin::TAttParamsMap GetAttractorParams();
361
362 /*
363     void         SetCustomSizeMapEntry(in string entry, in string sizeMap);
364     string       GetCustomSizeMapEntry(in string entry);
365     void         SetCustomSizeMap(in GEOM::GEOM_Object GeomObj, in string sizeMap);
366     void         UnsetCustomSizeMap(in GEOM::GEOM_Object GeomObj);
367     string_array GetCustomSizeMapEntries();
368 */
369     ///////////////////////
370     // ENFORCED VERTEXES //
371     ///////////////////////
372     
373     TFaceEntryEnfVertexListMap      GetAllEnforcedVerticesByFace();
374     TEnfVertexList                  GetAllEnforcedVertices();
375     
376     TFaceEntryCoordsListMap         GetAllCoordsByFace();
377     TCoordsEnfVertexMap             GetAllEnforcedVerticesByCoords();
378     
379     TFaceEntryEnfVertexEntryListMap GetAllEnfVertexEntriesByFace();
380     TEnfVertexEntryEnfVertexMap     GetAllEnforcedVerticesByEnfVertexEntry();
381     
382     void                            ClearAllEnforcedVertices();
383     
384    /*!
385     * Set/get/unset an enforced vertex on geom face
386     */
387     boolean SetEnforcedVertex(in GEOM::GEOM_Object theFace, in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
388     boolean SetEnforcedVertexNamed(in GEOM::GEOM_Object theFace, in double x, in double y, in double z, in TEnfName theVertexName) raises (SALOME::SALOME_Exception);
389     boolean SetEnforcedVertexGeom(in GEOM::GEOM_Object theFace, in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
390     boolean SetEnforcedVertexWithGroup(in GEOM::GEOM_Object theFace, in double x, in double y, in double z, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
391     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);
392     boolean SetEnforcedVertexGeomWithGroup(in GEOM::GEOM_Object theFace, in GEOM::GEOM_Object theVertex, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
393
394     
395     TEnfVertexList GetEnforcedVertices(in GEOM::GEOM_Object theFace) raises (SALOME::SALOME_Exception);
396     
397     boolean UnsetEnforcedVertex(in GEOM::GEOM_Object theFace, in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
398     boolean UnsetEnforcedVertexGeom(in GEOM::GEOM_Object theFace, in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
399     boolean UnsetEnforcedVertices(in GEOM::GEOM_Object theFace) raises (SALOME::SALOME_Exception);
400     
401    /*!
402     * Set/get/unset an enforced vertex on geom face given by entry
403     */
404     boolean SetEnforcedVertexEntry(in TEntry theFaceEntry, in double x, in double y, in double z, 
405                                    in TEnfName theVertexName, in TEntry theVertexEntry, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
406
407     TEnfVertexList GetEnforcedVerticesEntry(in TEntry theFaceEntry) raises (SALOME::SALOME_Exception);
408     boolean UnsetEnforcedVertexEntry(in TEntry theFaceEntry, in double x, in double y, in double z, in TEntry theVertexEntry) raises (SALOME::SALOME_Exception);
409 //    boolean UnsetEnforcedVertexEntryGeom(in TEntry theFaceEntry, in TEntry theVertexEntry) raises (SALOME::SALOME_Exception);
410     boolean UnsetEnforcedVerticesEntry(in TEntry theFaceEntry) raises (SALOME::SALOME_Exception);
411
412     /*!
413      * To get/set internal vertices as enforced vertices
414      */
415     void          SetInternalEnforcedVertexAllFaces(in boolean toEnforceInternalVertices);
416     boolean       GetInternalEnforcedVertexAllFaces();
417     void          SetInternalEnforcedVertexAllFacesGroup(in TEnfGroupName groupName);
418     TEnfGroupName GetInternalEnforcedVertexAllFacesGroup();
419
420 //  Enable internal enforced vertices on specific face if requested by user
421 //    void          SetInternalEnforcedVertex(in GEOM::GEOM_Object theFace,in boolean toEnforceInternalVertices) raises (SALOME::SALOME_Exception);
422 //    void          SetInternalEnforcedVertexWithGroup(in GEOM::GEOM_Object theFace, in boolean toEnforceInternalVertices, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
423 //    void          SetInternalEnforcedVertexEntry(in TEntry theFaceEntry, in boolean toEnforceInternalVertices, in TEnfGroupName groupName) raises (SALOME::SALOME_Exception);
424 //    boolean       GetInternalEnforcedVertex(in GEOM::GEOM_Object theFace) raises (SALOME::SALOME_Exception);
425 //    boolean       GetInternalEnforcedVertexEntry(in TEntry theFaceEntry) raises (SALOME::SALOME_Exception);
426 //    TFaceEntryInternalVerticesList GetAllInternalEnforcedVerticesFaces();
427     ///////////////////////
428     
429     /*!
430      * Sets the file for export resulting mesh in GMF format
431      */
432 //     void SetGMFFile(in string theFileName, in boolean isBinary);
433     void SetGMFFile(in string theFileName);
434     string GetGMFFile();
435 //     boolean GetGMFFileMode();
436
437     //
438     // Obsolete methods - To be removed in V7
439     //
440     void SetPhyMin(in double theMinSize);
441     double GetPhyMin();
442     void SetPhyMax(in double theMaxSize);
443     double GetPhyMax();
444     void SetGeoMin(in double theMinSize);
445     double GetGeoMin();
446     void SetGeoMax(in double theMaxSize);
447     double GetGeoMax();
448     void SetAngleMeshS(in double angle);
449     double GetAngleMeshS();
450     void SetAngleMeshC(in double angle);
451     double GetAngleMeshC();
452     void SetDecimesh(in boolean toIgnoreEdges);
453     boolean GetDecimesh();
454     void SetPreCADRemoveNanoEdges(in boolean toRemoveNanoEdges);
455     boolean GetPreCADRemoveNanoEdges();
456     void SetPreCADEpsNano(in double epsNano);
457     double GetPreCADEpsNano();
458   };
459 };
460
461 #endif