Salome HOME
PAL13460 (PAL EDF 301 force the mesh to go through a point)
[modules/smesh.git] / idl / SMESH_Mesh.idl
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 //
4 //  This library is free software; you can redistribute it and/or
5 //  modify it under the terms of the GNU Lesser General Public
6 //  License as published by the Free Software Foundation; either
7 //  version 2.1 of the License.
8 //
9 //  This library is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 //  Lesser General Public License for more details.
13 //
14 //  You should have received a copy of the GNU Lesser General Public
15 //  License along with this library; if not, write to the Free Software
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //
21 //
22 //  File   : SMESH_Mesh.idl
23 //  Author : Paul RASCLE, EDF
24 //  $Header$
25
26 #ifndef _SMESH_MESH_IDL_
27 #define _SMESH_MESH_IDL_
28
29 #include "SALOME_Exception.idl"
30 #include "SALOME_GenericObj.idl"
31 #include "GEOM_Gen.idl"
32 #include "MED.idl"
33
34 module SMESH
35 {
36   interface SMESH_Hypothesis;
37   typedef sequence<SMESH_Hypothesis> ListOfHypothesis;
38   interface SMESH_GroupBase;
39   typedef sequence<SMESH_GroupBase> ListOfGroups;
40
41   typedef sequence<double    > double_array ;
42   typedef sequence<long      > long_array ;
43   typedef sequence<string    > string_array ;
44   typedef sequence<long_array> array_of_long_array ;
45
46   enum log_command
47     {
48       ADD_NODE,
49       ADD_EDGE,
50       ADD_TRIANGLE,
51       ADD_QUADRANGLE,
52       ADD_POLYGON,
53       ADD_TETRAHEDRON,
54       ADD_PYRAMID,
55       ADD_PRISM,
56       ADD_HEXAHEDRON,
57       ADD_POLYHEDRON,
58       REMOVE_NODE,
59       REMOVE_ELEMENT,
60       MOVE_NODE,
61       CHANGE_ELEMENT_NODES,
62       CHANGE_POLYHEDRON_NODES,
63       RENUMBER,
64       ADD_QUADEDGE,
65       ADD_QUADTRIANGLE,
66       ADD_QUADQUADRANGLE,
67       ADD_QUADTETRAHEDRON,
68       ADD_QUADPYRAMID,
69       ADD_QUADPENTAHEDRON,
70       ADD_QUADHEXAHEDRON
71     };
72
73   struct log_block
74   {
75     long commandType;
76     long number;
77     double_array coords;
78     long_array indexes;
79   };
80
81   struct PointStruct { double x;
82                        double y;
83                        double z; } ;
84
85   typedef sequence<PointStruct> nodes_array;
86
87   struct DirStruct   { PointStruct PS ; } ;          // analog to Occ Direction
88
89   struct AxisStruct  { double x;
90                        double y;
91                        double z;
92                        double vx;
93                        double vy;
94                        double vz; } ;
95
96
97   /*!
98    * Enumeration for element type, like in SMDS
99    */
100   enum ElementType
101   {
102     ALL,
103     NODE,
104     EDGE,
105     FACE,
106     VOLUME
107   };
108   
109   /*!
110    * Structure used in mesh edit preview data
111    */
112   struct ElementSubType { ElementType SMDS_ElementType;
113                           boolean     isPoly;
114                           long        nbNodesInElement; };
115
116   typedef sequence<ElementSubType> types_array;
117
118   /*!
119    * Structure containing mesh edit preview data
120    */
121   struct MeshPreviewStruct { nodes_array nodesXYZ;
122                              long_array  elementConnectivities;
123                              types_array elementTypes; };
124
125   /*!
126    * ElementOrder points out entities of what order are requested
127    */
128   enum ElementOrder {
129     ORDER_ANY,          /*! entities of any order */
130     ORDER_LINEAR,       /*! entities of 1st order */
131     ORDER_QUADRATIC     /*! entities of 2nd order */
132   };
133
134   /*!
135    * Enumeration for hypothesis status (used by AddHypothesis() and RemoveHypothesis() methods)
136    */
137   enum Hypothesis_Status // in the order of severity
138   {
139     HYP_OK,
140     HYP_MISSING,      // algo misses a hypothesis
141     HYP_CONCURENT,    // several applicable hypotheses
142     HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
143     HYP_HIDDEN_ALGO,  // an algo is hidden by an upper dim algo generating all-dim elements
144     HYP_HIDING_ALGO,  // an algo hides lower dim algos by generating all-dim elements
145     HYP_UNKNOWN_FATAL,//  --- all statuses below should be considered as fatal
146                       //      for Add/RemoveHypothesis operations
147     HYP_INCOMPATIBLE, // hypothesis does not fit algo
148     HYP_NOTCONFORM,   // not conform mesh is produced appling a hypothesis
149     HYP_ALREADY_EXIST,// such hypothesis already exist
150     HYP_BAD_DIM,      // bad dimension
151     HYP_BAD_SUBSHAPE, // shape is neither the main one, nor its subshape, nor a group
152     HYP_BAD_GEOMETRY  // geometry mismatches algorithm's expectation
153   };
154
155   /*!
156    * Enumeration for DriverMED read status (used by ImportMEDFile() method)
157    */
158   enum DriverMED_ReadStatus // in the order of severity
159   {
160     DRS_OK,
161     DRS_EMPTY,          // a MED file contains no mesh with the given name
162     DRS_WARN_RENUMBER,  // a MED file has overlapped ranges of element numbers,
163                         // so the numbers from the file are ignored
164     DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
165     DRS_FAIL            // general failure (exception etc.)
166   };
167
168   /*!
169    * Enumeration for DriverMED (used by Perform() method)
170    */
171   enum MED_VERSION // in the order of severity
172   {
173     MED_V2_1,
174     MED_V2_2
175   };
176
177   typedef sequence<log_block> log_array;
178
179
180   /*!
181    * Auxilary flags for advanced extrusion.
182    * BOUNDARY: create or not boundary for result of extrusion
183    * SEW:      try to use existing nodes or create new nodes in any case
184    */
185   const long EXTRUSION_FLAG_BOUNDARY = 1;
186   const long EXTRUSION_FLAG_SEW = 2;
187   
188   interface SMESH_IDSource
189   {
190     /*!
191      * Returns a sequence of all element IDs
192      */
193     long_array GetIDs();
194   };
195
196   interface SMESH_Group;
197   interface SMESH_GroupOnGeom;
198   interface SMESH_subMesh;
199   interface SMESH_MeshEditor;
200   interface SMESH_Mesh : SALOME::GenericObj, SMESH_IDSource
201   {
202     /*!
203      * Return true if there is a geometry to be meshed
204      */
205     boolean HasShapeToMesh()
206       raises (SALOME::SALOME_Exception);
207
208     /*!
209      * Get geom shape to mesh. A result sould not be nil. Use HasShapeToMesh()
210      * to know if a returned shape 
211      */
212     GEOM::GEOM_Object GetShapeToMesh()
213       raises (SALOME::SALOME_Exception);
214
215
216     /*!
217      * Get the subMesh object associated to a subShape. The subMesh object
218      * gives access to nodes and elements IDs.
219      * SubMesh will be used instead of SubShape in a next idl version to
220      * adress a specific subMesh...
221      */
222     SMESH_subMesh GetSubMesh(in GEOM::GEOM_Object aSubObject, in string name)
223       raises (SALOME::SALOME_Exception);
224
225     /*!
226      * Remove a submesh
227      */
228     void RemoveSubMesh(in SMESH_subMesh aSubMesh)
229       raises (SALOME::SALOME_Exception);
230
231
232     /*!
233      * Create a group
234      */
235     SMESH_Group CreateGroup( in ElementType elem_type,
236                              in string name )
237       raises (SALOME::SALOME_Exception);
238
239     /*!
240      * Create a group from geometry group
241      */
242     SMESH_GroupOnGeom CreateGroupFromGEOM( in ElementType elem_type,
243                                           in string name,
244                                           in GEOM::GEOM_Object theGeomObject )
245       raises (SALOME::SALOME_Exception);
246
247     /*!
248      * Remove a group
249      */
250     void RemoveGroup(in SMESH_GroupBase aGroup)
251       raises (SALOME::SALOME_Exception);
252
253     /*!
254      *  Remove group with its contents
255      */
256     void RemoveGroupWithContents( in SMESH_GroupBase aGroup )
257       raises (SALOME::SALOME_Exception);
258
259     /*!
260      *  Get the list of groups existing in the mesh
261      */
262     ListOfGroups GetGroups()
263       raises (SALOME::SALOME_Exception);
264
265     /*!
266      * Union of two groups
267      *    New group is created. All mesh elements that are
268      *    present in initial groups are added to the new one
269      */
270     SMESH_Group UnionGroups (in SMESH_GroupBase aGroup1,
271                              in SMESH_GroupBase aGroup2,
272                              in string          name )
273       raises (SALOME::SALOME_Exception);
274
275     /*!
276      *  Intersection of two groups
277      *  New group is created. All mesh elements that are
278      *  present in both initial groups are added to the new one.
279      */
280     SMESH_Group IntersectGroups (in SMESH_GroupBase aGroup1,
281                                  in SMESH_GroupBase aGroup2,
282                                  in string          name )
283       raises (SALOME::SALOME_Exception);
284
285     /*!
286      *  Cut of two groups
287      *  New group is created. All mesh elements that are present in
288      *  main group but do not present in tool group are added to the new one
289      */
290     SMESH_Group CutGroups (in SMESH_GroupBase aMainGroup,
291                            in SMESH_GroupBase aToolGroup,
292                            in string          name )
293       raises (SALOME::SALOME_Exception);
294
295     /*!
296      * Add hypothesis to the mesh, under a particular subShape
297      * (or the main shape itself)
298      * The Add method is only used to prepare the build of the mesh and store
299      * the algorithms and associated parameters.
300      * Actual job of mesh the shape is done by MESH_Gen.
301      * @params
302      * - aSubShape : subShape obtained by a shape explode in GEOM
303      *   (or main shape)
304      * - anHyp : hypothesis object
305      * @return
306      * - OK if the hypothesis is compatible with the subShape
307      *   (and all previous hypothesis on the subShape)
308      * - NOK if the hypothesis is not compatible with the subShape
309      *   (or one previous hypothesis on the subShape)
310      * raises exception if hypothesis has not been created
311      */
312     Hypothesis_Status AddHypothesis(in GEOM::GEOM_Object aSubObject,
313                                     in SMESH_Hypothesis anHyp)
314       raises (SALOME::SALOME_Exception);
315 //     boolean AddHypothesis(in SMESH_subMesh aSubMesh, in SMESH_Hypothesis anHyp)
316 //       raises (SALOME::SALOME_Exception);
317
318     /*!
319      * Remove an hypothesis previouly added with AddHypothesis.
320      */
321     Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
322                                        in SMESH_Hypothesis anHyp)
323       raises (SALOME::SALOME_Exception);
324 //     boolean RemoveHypothesis(in SMESH_subMesh aSubMesh,
325 //                           in SMESH_Hypothesis anHyp)
326 //       raises (SALOME::SALOME_Exception);
327
328     /*!
329      * Get the list of hypothesis added on a subShape
330      */
331     ListOfHypothesis GetHypothesisList(in GEOM::GEOM_Object aSubObject)
332       raises (SALOME::SALOME_Exception);
333 //     ListOfHypothesis GetHypothesisList(in SMESH_subMesh aSubMesh)
334 //       raises (SALOME::SALOME_Exception);
335
336     /*!
337      * Get the log of nodes and elements added or removed since previous
338      * clear of the log.
339      * @params
340      * - clearAfterGet : log is emptied after Get (safe if concurrents access)
341      */
342     //    string_array GetLog(in boolean clearAfterGet)
343     //      raises (SALOME::SALOME_Exception);
344     log_array GetLog(in boolean clearAfterGet)
345       raises (SALOME::SALOME_Exception);
346
347     /*!
348      * Clear the log of nodes and elements added or removed since previous
349      * clear. Must be used immediately after GetLog if clearAfterGet is false.
350      */
351     void ClearLog()
352       raises (SALOME::SALOME_Exception);
353
354     /*!
355      * Get the internal Id
356      */
357     long GetId();
358
359     /*!
360      * Get the study Id
361      */
362     long GetStudyId();
363
364     /*!
365      * Obtain instance of SMESH_MeshEditor
366      */
367     SMESH_MeshEditor GetMeshEditor()
368       raises (SALOME::SALOME_Exception);
369
370     /*!
371      * Return SMESH_MeshEditor that would not modify the mesh but
372      * fill MeshPreviewStruct
373      */
374     SMESH_MeshEditor GetMeshEditPreviewer()
375       raises (SALOME::SALOME_Exception);
376
377     /*! Check group names for duplications.
378      *  Consider maximum group name length stored in MED file.
379      */
380     boolean HasDuplicatedGroupNamesMED();
381
382     /*!
383      * Export Mesh to different MED Formats
384      * @params
385      * - auto_groups : boolean parameter for creating/not creating
386      *   the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
387      *   the typical use is auto_groups=false.
388      * - theVersion : define the version of format of MED file, that will be created
389      */
390     void ExportToMED( in string file, in boolean auto_groups, in MED_VERSION theVersion )
391       raises (SALOME::SALOME_Exception);
392
393     /*!
394      * Export Mesh to MED_V2_1 MED format
395      * Works, just the same as ExportToMED, with MED_VERSION parameter equal to MED_V2_1.
396      * The method is kept in order to support old functionality
397      */
398     void ExportMED( in string file, in boolean auto_groups )
399       raises (SALOME::SALOME_Exception);
400
401     /*!
402      * Export Mesh to DAT, UNV and STL Formats
403      * (UNV supported version is I-DEAS 10)
404      */
405     void ExportDAT( in string file )
406       raises (SALOME::SALOME_Exception);
407     void ExportUNV( in string file )
408       raises (SALOME::SALOME_Exception);
409     void ExportSTL( in string file, in boolean isascii )
410       raises (SALOME::SALOME_Exception);
411
412     /*!
413      * Get MED Mesh
414      */
415     SALOME_MED::MESH GetMEDMesh()
416       raises (SALOME::SALOME_Exception);
417
418     /*!
419      * Get informations about mesh contents
420      */
421     long NbNodes()
422       raises (SALOME::SALOME_Exception);
423
424     long NbElements()
425       raises (SALOME::SALOME_Exception);
426
427     long NbEdges()
428       raises (SALOME::SALOME_Exception);
429
430     long NbEdgesOfOrder(in ElementOrder order)
431       raises (SALOME::SALOME_Exception);
432
433     long NbFaces()
434       raises (SALOME::SALOME_Exception);
435
436     long NbFacesOfOrder(in ElementOrder order)
437       raises (SALOME::SALOME_Exception);
438
439     long NbTriangles()
440       raises (SALOME::SALOME_Exception);
441
442     long NbTrianglesOfOrder(in ElementOrder order)
443       raises (SALOME::SALOME_Exception);
444
445     long NbQuadrangles()
446       raises (SALOME::SALOME_Exception);
447
448     long NbQuadranglesOfOrder(in ElementOrder order)
449       raises (SALOME::SALOME_Exception);
450
451     long NbPolygons()
452       raises (SALOME::SALOME_Exception);
453
454     long NbVolumes()
455       raises (SALOME::SALOME_Exception);
456
457     long NbVolumesOfOrder(in ElementOrder order)
458       raises (SALOME::SALOME_Exception);
459
460     long NbTetras()
461       raises (SALOME::SALOME_Exception);
462
463     long NbTetrasOfOrder(in ElementOrder order)
464       raises (SALOME::SALOME_Exception);
465
466     long NbHexas()
467       raises (SALOME::SALOME_Exception);
468
469     long NbHexasOfOrder(in ElementOrder order)
470       raises (SALOME::SALOME_Exception);
471
472     long NbPyramids()
473       raises (SALOME::SALOME_Exception);
474
475     long NbPyramidsOfOrder(in ElementOrder order)
476       raises (SALOME::SALOME_Exception);
477
478     long NbPrisms()
479       raises (SALOME::SALOME_Exception);
480
481     long NbPrismsOfOrder(in ElementOrder order)
482       raises (SALOME::SALOME_Exception);
483
484     long NbPolyhedrons()
485       raises (SALOME::SALOME_Exception);
486
487     long NbSubMesh()
488       raises (SALOME::SALOME_Exception);
489
490     long_array GetElementsId()
491       raises (SALOME::SALOME_Exception);
492
493     long_array GetElementsByType( in ElementType theType )
494       raises (SALOME::SALOME_Exception);
495
496     long_array GetNodesId()
497       raises (SALOME::SALOME_Exception);
498     
499     /*!
500      * Returns type of mesh element
501      */    
502     ElementType GetElementType( in long id, in boolean iselem )
503       raises (SALOME::SALOME_Exception);
504
505     long_array GetSubMeshElementsId(in long ShapeID)
506       raises (SALOME::SALOME_Exception);
507
508     long_array GetSubMeshNodesId(in long ShapeID, in boolean all )
509       raises (SALOME::SALOME_Exception);
510     
511     ElementType GetSubMeshElementType(in long ShapeID)
512       raises (SALOME::SALOME_Exception);
513
514     /*!
515      * Get mesh description
516      */
517     string Dump();
518
519     /*!
520      * Get mesh pointer
521      */
522     long GetMeshPtr();
523
524     /*!
525      * Get XYZ coordinates of node as list of double
526      * If there is not node for given ID - returns empty list
527      */
528     double_array GetNodeXYZ(in long id);
529
530     /*!
531      * For given node returns list of IDs of inverse elements
532      * If there is not node for given ID - returns empty list
533      */
534     long_array GetNodeInverseElements(in long id);
535
536     /*!
537      * If given element is node returns IDs of shape from position
538      * If there is not node for given ID - returns -1
539      */
540     long GetShapeID(in long id);
541
542     /*!
543      * For given element returns ID of result shape after 
544      * ::FindShape() from SMESH_MeshEditor
545      * If there is not element for given ID - returns -1
546      */
547     long GetShapeIDForElem(in long id);
548
549     /*!
550      * Returns number of nodes for given element
551      * If there is not element for given ID - returns -1
552      */
553     long GetElemNbNodes(in long id);
554
555     /*!
556      * Returns IDs of nodes of given element
557      */
558     long_array GetElemNodes(in long id);
559
560     /*!
561      * Returns ID of node by given index for given element
562      * If there is not element for given ID - returns -1
563      * If there is not node for given index - returns -2
564      */
565     long GetElemNode(in long id, in long index);
566
567     /*!
568      * Returns true if given node is medium node
569      * in given quadratic element
570      */
571     boolean IsMediumNode(in long ide, in long idn);
572
573     /*!
574      * Returns true if given node is medium node
575      * in one of quadratic elements
576      */
577     boolean IsMediumNodeOfAnyElem(in long idn, in ElementType elem_type);
578
579     /*!
580      * Returns number of edges for given element
581      */
582     long ElemNbEdges(in long id);
583
584     /*!
585      * Returns number of faces for given element
586      */
587     long ElemNbFaces(in long id);
588
589     /*!
590      * Returns true if given element is polygon
591      */
592     boolean IsPoly(in long id);
593
594     /*!
595      * Returns true if given element is quadratic
596      */
597     boolean IsQuadratic(in long id);
598
599     /*!
600      * Returns XYZ coordinates of bary center for given element
601      * as list of double
602      * If there is not element for given ID - returns empty list
603      */
604     double_array BaryCenter(in long id);
605
606   };
607
608   interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource
609   {
610     /*!
611      *
612      */
613     long GetNumberOfElements()
614       raises (SALOME::SALOME_Exception);
615
616     /*!
617      *
618      */
619     long GetNumberOfNodes( in boolean all )
620       raises (SALOME::SALOME_Exception);
621
622     /*!
623      *
624      */
625     long_array GetElementsId()
626       raises (SALOME::SALOME_Exception);
627
628     /*!
629      *
630      */
631     long_array GetElementsByType( in ElementType theType )
632       raises (SALOME::SALOME_Exception);
633     
634     /*!
635      * Return type of submesh element
636      */
637     ElementType GetElementType( in long id, in boolean iselem )
638       raises (SALOME::SALOME_Exception);
639
640     /*!
641      *
642      */
643     long_array GetNodesId()
644       raises (SALOME::SALOME_Exception);
645
646     /*!
647      * Get geom shape the submesh is dedicated to
648      */
649     GEOM::GEOM_Object GetSubShape()
650       raises (SALOME::SALOME_Exception);
651
652     /*!
653      * Get SMESH_Mesh which stores nodes coordinates & elements definition
654      */
655     SMESH_Mesh GetFather()
656       raises (SALOME::SALOME_Exception);
657
658     /*!
659      * Get the internal Id
660      */
661     long GetId();
662
663     /*!
664      * Get MED subMesh
665      */
666     SALOME_MED::FAMILY GetFamily()
667       raises (SALOME::SALOME_Exception);
668   };
669
670   /*!
671    * This interface makes modifications on the Mesh - removing elements and nodes etc.
672    */
673   interface NumericalFunctor;
674   interface SMESH_MeshEditor
675   {
676     boolean RemoveElements(in long_array IDsOfElements);
677
678     boolean RemoveNodes(in long_array IDsOfNodes);
679
680     long AddNode(in double x, in double y, in double z);
681
682     /*!
683      *  Create edge, either linear and quadratic (this is determed
684      *  by number of given nodes).
685      *  \param IdsOfNodes List of node IDs for creation of element.
686      *  Needed order of nodes in this list corresponds to description
687      *  of MED. This description is located by the following link:
688      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
689      */
690     long AddEdge(in long_array IDsOfNodes);
691
692     /*!
693      *  Create face, either linear and quadratic (this is determed
694      *  by number of given nodes).
695      *  \param IdsOfNodes List of node IDs for creation of element.
696      *  Needed order of nodes in this list corresponds to description
697      *  of MED. This description is located by the following link:
698      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
699      */
700     long AddFace(in long_array IDsOfNodes);
701
702     long AddPolygonalFace(in long_array IdsOfNodes);
703
704     /*!
705      *  Create volume, either linear and quadratic (this is determed
706      *  by number of given nodes).
707      *  \param IdsOfNodes List of node IDs for creation of element.
708      *  Needed order of nodes in this list corresponds to description
709      *  of MED. This description is located by the following link:
710      *   http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3.
711      */
712     long AddVolume(in long_array IDsOfNodes);
713
714     /*!
715      *  Create volume of many faces, giving nodes for each face.
716      *  \param IdsOfNodes List of node IDs for volume creation face by face.
717      *  \param Quantities List of integer values, Quantities[i]
718      *         gives quantity of nodes in face number i.
719      */
720     long AddPolyhedralVolume (in long_array IdsOfNodes,
721                               in long_array Quantities);
722
723     /*!
724      *  Create volume of many faces, giving IDs of existing faces.
725      *  \param IdsOfFaces List of face IDs for volume creation.
726      *  \note The created volume will refer only to nodes
727      *        of the given faces, not to the faces itself.
728      */
729     long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces);
730
731     boolean MoveNode(in long NodeID, in double x, in double y, in double z);
732
733     boolean InverseDiag(in long NodeID1, in long NodeID2);
734
735     boolean DeleteDiag(in long NodeID1, in long NodeID2);
736
737     boolean Reorient(in long_array IDsOfElements);
738
739     boolean ReorientObject(in SMESH_IDSource theObject);
740
741     /*!
742      * \brief Fuse neighbour triangles into quadrangles.
743      * \param theElems     The triangles to be fused.
744      * \param theCriterion Is used to choose a neighbour to fuse with.
745      * \param theMaxAngle  Is a max angle between element normals at which fusion
746      *                     is still performed; theMaxAngle is mesured in radians.
747      * \return TRUE in case of success, FALSE otherwise.
748      */
749     boolean TriToQuad (in long_array       IDsOfElements,
750                        in NumericalFunctor Criterion,
751                        in double           MaxAngle);
752
753     /*!
754      * \brief Fuse neighbour triangles into quadrangles.
755      *
756      * Behaves like the above method, taking list of elements from \a theObject
757      */
758     boolean TriToQuadObject (in SMESH_IDSource   theObject,
759                              in NumericalFunctor Criterion,
760                              in double           MaxAngle);
761
762     /*!
763      * \brief Split quadrangles into triangles.
764      * \param theElems     The faces to be splitted.
765      * \param theCriterion Is used to choose a diagonal for splitting.
766      * \return TRUE in case of success, FALSE otherwise.
767      */
768     boolean QuadToTri (in long_array       IDsOfElements,
769                        in NumericalFunctor Criterion);
770
771     /*!
772      * \brief Split quadrangles into triangles.
773      *
774      * Behaves like the above method, taking list of elements from \a theObject
775      */
776     boolean QuadToTriObject (in SMESH_IDSource   theObject,
777                              in NumericalFunctor Criterion);
778
779     /*!
780      * \brief Split quadrangles into triangles.
781      * \param theElems  The faces to be splitted.
782      * \param the13Diag Is used to choose a diagonal for splitting.
783      * \return TRUE in case of success, FALSE otherwise.
784      */
785     boolean SplitQuad (in long_array IDsOfElements,
786                        in boolean    Diag13);
787
788     /*!
789      * \brief Split quadrangles into triangles.
790      *
791      * Behaves like the above method, taking list of elements from \a theObject
792      */
793     boolean SplitQuadObject (in SMESH_IDSource theObject,
794                              in boolean        Diag13);
795
796     /*!
797      *  Find better splitting of the given quadrangle.
798      *  \param IDOfQuad  ID of the quadrangle to be splitted.
799      *  \param Criterion A criterion to choose a diagonal for splitting.
800      *  \return 1 if 1-3 diagonal is better, 2 if 2-4
801      *          diagonal is better, 0 if error occurs.
802      */
803     long BestSplit (in long             IDOfQuad,
804                     in NumericalFunctor Criterion);
805
806     enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH };
807
808     boolean Smooth(in long_array    IDsOfElements,
809                    in long_array    IDsOfFixedNodes,
810                    in long          MaxNbOfIterations,
811                    in double        MaxAspectRatio,
812                    in Smooth_Method Method);
813
814     boolean SmoothObject(in SMESH_IDSource  theObject,
815                          in long_array      IDsOfFixedNodes,
816                          in long            MaxNbOfIterations,
817                          in double          MaxAspectRatio,
818                          in Smooth_Method   Method);
819
820     boolean SmoothParametric(in long_array    IDsOfElements,
821                              in long_array    IDsOfFixedNodes,
822                              in long          MaxNbOfIterations,
823                              in double        MaxAspectRatio,
824                              in Smooth_Method Method);
825
826     boolean SmoothParametricObject(in SMESH_IDSource  theObject,
827                                    in long_array      IDsOfFixedNodes,
828                                    in long            MaxNbOfIterations,
829                                    in double          MaxAspectRatio,
830                                    in Smooth_Method   Method);
831
832     void ConvertToQuadratic(in boolean theForce3d);
833
834     boolean ConvertFromQuadratic();
835
836     void RenumberNodes();
837
838     void RenumberElements();
839
840     void RotationSweep(in long_array       IDsOfElements,
841                        in AxisStruct       Axix,
842                        in double           AngleInRadians,
843                        in long             NbOfSteps,
844                        in double           Tolerance);
845
846     void RotationSweepObject(in SMESH_IDSource  theObject,
847                              in AxisStruct      Axix,
848                              in double          AngleInRadians,
849                              in long            NbOfSteps,
850                              in double          Tolerance);
851
852     void ExtrusionSweep(in long_array      IDsOfElements,
853                         in DirStruct       StepVector,
854                         in long            NbOfSteps);
855
856    /*!
857     * Generate new elements by extrusion of theElements 
858     * by StepVector by NbOfSteps
859     * param ExtrFlags set flags for performing extrusion
860     * param SewTolerance - uses for comparing locations of nodes if flag
861     *   EXTRUSION_FLAG_SEW is set
862     */
863     void AdvancedExtrusion(in long_array      IDsOfElements,
864                            in DirStruct       StepVector,
865                            in long            NbOfSteps,
866                            in long            ExtrFlags,
867                            in double          SewTolerance);
868
869     void ExtrusionSweepObject(in SMESH_IDSource  theObject,
870                               in DirStruct       StepVector,
871                               in long            NbOfSteps);
872
873     void ExtrusionSweepObject1D(in SMESH_IDSource theObject,
874                                 in DirStruct      StepVector,
875                                 in long           NbOfSteps);
876
877     void ExtrusionSweepObject2D(in SMESH_IDSource theObject,
878                                 in DirStruct      StepVector,
879                                 in long           NbOfSteps);
880
881     enum Extrusion_Error {
882       EXTR_OK,
883       EXTR_NO_ELEMENTS,
884       EXTR_PATH_NOT_EDGE,
885       EXTR_BAD_PATH_SHAPE,
886       EXTR_BAD_STARTING_NODE,
887       EXTR_BAD_ANGLES_NUMBER,
888       EXTR_CANT_GET_TANGENT
889       };
890
891     Extrusion_Error ExtrusionAlongPath(in long_array        IDsOfElements,
892                                        in SMESH_Mesh        PathMesh,
893                                        in GEOM::GEOM_Object PathShape,
894                                        in long              NodeStart,
895                                        in boolean           HasAngles,
896                                        in double_array      Angles,
897                                        in boolean           HasRefPoint,
898                                        in PointStruct       RefPoint);
899
900     Extrusion_Error ExtrusionAlongPathObject(in SMESH_IDSource    theObject,
901                                              in SMESH_Mesh        PathMesh,
902                                              in GEOM::GEOM_Object PathShape,
903                                              in long              NodeStart,
904                                              in boolean           HasAngles,
905                                              in double_array      Angles,
906                                              in boolean           HasRefPoint,
907                                              in PointStruct       RefPoint);
908
909    /*!
910     * Compute rotation angles for ExtrusionAlongPath as linear variation
911     * of given angles along path steps
912     * param PathMesh mesh containing a 1D sub-mesh on the edge, along 
913     *                which proceeds the extrusion
914     * param PathShape is shape(edge); as the mesh can be complex, the edge 
915     *                 is used to define the sub-mesh for the path
916     */
917     double_array LinearAnglesVariation(in SMESH_Mesh        PathMesh,
918                                        in GEOM::GEOM_Object PathShape,
919                                        in double_array      Angles);
920
921     enum MirrorType { POINT, AXIS, PLANE };
922
923     void Mirror (in long_array       IDsOfElements,
924                  in AxisStruct       Mirror,
925                  in MirrorType       theMirrorType,
926                  in boolean          Copy);
927
928     void MirrorObject (in SMESH_IDSource  theObject,
929                        in AxisStruct      Mirror,
930                        in MirrorType      theMirrorType,
931                        in boolean         Copy);
932
933     void Translate (in long_array      IDsOfElements,
934                     in DirStruct       Vector,
935                     in boolean         Copy);
936
937     void TranslateObject (in SMESH_IDSource  theObject,
938                           in DirStruct       Vector,
939                           in boolean         Copy);
940
941     void Rotate (in long_array       IDsOfElements,
942                  in AxisStruct       Axis,
943                  in double           AngleInRadians,
944                  in boolean          Copy);
945
946     void RotateObject (in SMESH_IDSource  theObject,
947                        in AxisStruct      Axis,
948                        in double          AngleInRadians,
949                        in boolean         Copy);
950
951     void FindCoincidentNodes (in  double              Tolerance,
952                               out array_of_long_array GroupsOfNodes);
953
954     void MergeNodes (in array_of_long_array GroupsOfNodes);
955
956     void MergeEqualElements();
957
958     enum Sew_Error {
959       SEW_OK,
960       SEW_BORDER1_NOT_FOUND,
961       SEW_BORDER2_NOT_FOUND,
962       SEW_BOTH_BORDERS_NOT_FOUND,
963       SEW_BAD_SIDE_NODES,
964       SEW_VOLUMES_TO_SPLIT,
965       // for SewSideElements() only:
966       SEW_DIFF_NB_OF_ELEMENTS,
967       SEW_TOPO_DIFF_SETS_OF_ELEMENTS,
968       SEW_BAD_SIDE1_NODES,
969       SEW_BAD_SIDE2_NODES
970       };
971
972     Sew_Error SewFreeBorders (in long FirstNodeID1,
973                               in long SecondNodeID1,
974                               in long LastNodeID1,
975                               in long FirstNodeID2,
976                               in long SecondNodeID2,
977                               in long LastNodeID2,
978                               in boolean CreatePolygons,
979                               in boolean CreatePolyedrs);
980
981     Sew_Error SewConformFreeBorders (in long FirstNodeID1,
982                                      in long SecondNodeID1,
983                                      in long LastNodeID1,
984                                      in long FirstNodeID2,
985                                      in long SecondNodeID2);
986
987     Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder,
988                                in long SecondNodeIDOnFreeBorder,
989                                in long LastNodeIDOnFreeBorder,
990                                in long FirstNodeIDOnSide,
991                                in long LastNodeIDOnSide,
992                                in boolean CreatePolygons,
993                                in boolean CreatePolyedrs);
994
995     Sew_Error SewSideElements (in long_array IDsOfSide1Elements,
996                                in long_array IDsOfSide2Elements,
997                                in long       NodeID1OfSide1ToMerge,
998                                in long       NodeID1OfSide2ToMerge,
999                                in long       NodeID2OfSide1ToMerge,
1000                                in long       NodeID2OfSide2ToMerge);
1001
1002    /*!
1003     * Set new nodes for given element.
1004     * If number of nodes is not corresponded to type of
1005     * element - returns false
1006     */
1007     boolean ChangeElemNodes(in long ide, in long_array newIDs);
1008
1009    /*!
1010     * Return data of mesh edition preview which is computed provided 
1011     * that the editor was obtained trough SMESH_Mesh::GetMeshEditPreviewer()
1012     */
1013     MeshPreviewStruct GetPreviewData();
1014
1015    /*!
1016     * If during last operation of MeshEditor some nodes were
1017     * created this method returns list of it's IDs, if new nodes
1018     * not creared - returns empty list
1019     */
1020     long_array GetLastCreatedNodes();
1021
1022    /*!
1023     * If during last operation of MeshEditor some elements were
1024     * created this method returns list of it's IDs, if new elements
1025     * not creared - returns empty list
1026     */
1027     long_array GetLastCreatedElems();
1028
1029   };
1030 };
1031
1032 #endif