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