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