Back to index

salome-smesh  6.5.0
SMESH_MeshEditor_i.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
00024 //  File   : SMESH_MeshEditor_i.hxx
00025 //  Author : Nicolas REJNERI
00026 //  Module : SMESH
00027 //
00028 #ifndef _SMESH_MESHEDITOR_I_HXX_
00029 #define _SMESH_MESHEDIOTR_I_HXX_
00030 
00031 #include "SMESH.hxx"
00032 
00033 #include <SALOMEconfig.h>
00034 #include CORBA_SERVER_HEADER(SMESH_MeshEditor)
00035 
00036 #include "SMESH_Mesh.hxx"
00037 #include "SMESH_PythonDump.hxx"
00038 #include "SMESH_MeshEditor.hxx"
00039 #include <list>
00040 
00041 class SMESH_MeshEditor;
00042 class SMESH_Mesh_i;
00043 
00044 class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor
00045 {
00046 public:
00047   SMESH_MeshEditor_i(SMESH_Mesh_i * theMesh, bool isPreview);
00048 
00049   virtual ~ SMESH_MeshEditor_i();
00050 
00051   // --- CORBA
00052 
00056   SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::long_array& IDsOfElements,
00057                                          SMESH::ElementType       type);
00058   CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements);
00059   CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes);
00060   CORBA::Long    RemoveOrphanNodes();
00061 
00066   CORBA::Long AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z);
00067   CORBA::Long Add0DElement(CORBA::Long IDOfNode);
00068   CORBA::Long AddEdge(const SMESH::long_array & IDsOfNodes);
00069   CORBA::Long AddFace(const SMESH::long_array & IDsOfNodes);
00070   CORBA::Long AddPolygonalFace(const SMESH::long_array & IDsOfNodes);
00071   CORBA::Long AddVolume(const SMESH::long_array & IDsOfNodes);
00072   CORBA::Long AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes,
00073                                   const SMESH::long_array & Quantities);
00074   CORBA::Long AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces);
00075 
00081   void SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID)
00082     throw (SALOME::SALOME_Exception);
00089   void SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID,
00090                      CORBA::Double paramOnEdge)
00091     throw (SALOME::SALOME_Exception);
00099   void SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID,
00100                      CORBA::Double u, CORBA::Double v)
00101     throw (SALOME::SALOME_Exception);
00107   void SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID)
00108     throw (SALOME::SALOME_Exception);
00114   void SetMeshElementOnShape(CORBA::Long ElementID, CORBA::Long ShapeID)
00115     throw (SALOME::SALOME_Exception);
00116 
00117 
00118   CORBA::Boolean MoveNode(CORBA::Long NodeID,
00119                           CORBA::Double x, CORBA::Double y, CORBA::Double z);
00120 
00121   CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
00122   CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2);
00123   CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements);
00124   CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject);
00125 
00126   // Split/Join faces
00127   CORBA::Boolean TriToQuad       (const SMESH::long_array &   IDsOfElements,
00128                                   SMESH::NumericalFunctor_ptr Criterion,
00129                                   CORBA::Double               MaxAngle);
00130   CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr   theObject,
00131                                   SMESH::NumericalFunctor_ptr Criterion,
00132                                   CORBA::Double               MaxAngle);
00133   CORBA::Boolean QuadToTri       (const SMESH::long_array &   IDsOfElements,
00134                                   SMESH::NumericalFunctor_ptr Criterion);
00135   CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr   theObject,
00136                                   SMESH::NumericalFunctor_ptr Criterion);
00137   CORBA::Boolean SplitQuad       (const SMESH::long_array &   IDsOfElements,
00138                                   CORBA::Boolean              Diag13);
00139   CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr   theObject,
00140                                   CORBA::Boolean              Diag13);
00141   CORBA::Long    BestSplit       (CORBA::Long                 IDOfQuad,
00142                                   SMESH::NumericalFunctor_ptr Criterion);
00143   void SplitVolumesIntoTetra     (SMESH::SMESH_IDSource_ptr elems,
00144                                   CORBA::Short methodFlags) throw (SALOME::SALOME_Exception);
00145 
00146   CORBA::Boolean Smooth(const SMESH::long_array &              IDsOfElements,
00147                         const SMESH::long_array &              IDsOfFixedNodes,
00148                         CORBA::Long                            MaxNbOfIterations,
00149                         CORBA::Double                          MaxAspectRatio,
00150                         SMESH::SMESH_MeshEditor::Smooth_Method Method);
00151   CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr              theObject,
00152                               const SMESH::long_array &              IDsOfFixedNodes,
00153                               CORBA::Long                            MaxNbOfIterations,
00154                               CORBA::Double                          MaxAspectRatio,
00155                               SMESH::SMESH_MeshEditor::Smooth_Method Method);
00156   CORBA::Boolean SmoothParametric(const SMESH::long_array &              IDsOfElements,
00157                                   const SMESH::long_array &              IDsOfFixedNodes,
00158                                   CORBA::Long                            MaxNbOfIterations,
00159                                   CORBA::Double                          MaxAspectRatio,
00160                                   SMESH::SMESH_MeshEditor::Smooth_Method Method);
00161   CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr              theObject,
00162                                         const SMESH::long_array &              IDsOfFixedNodes,
00163                                         CORBA::Long                            MaxNbOfIterations,
00164                                         CORBA::Double                          MaxAspectRatio,
00165                                         SMESH::SMESH_MeshEditor::Smooth_Method Method);
00166   CORBA::Boolean smooth(const SMESH::long_array &              IDsOfElements,
00167                         const SMESH::long_array &              IDsOfFixedNodes,
00168                         CORBA::Long                            MaxNbOfIterations,
00169                         CORBA::Double                          MaxAspectRatio,
00170                         SMESH::SMESH_MeshEditor::Smooth_Method Method,
00171                         bool                                   IsParametric);
00172   CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr              theObject,
00173                               const SMESH::long_array &              IDsOfFixedNodes,
00174                               CORBA::Long                            MaxNbOfIterations,
00175                               CORBA::Double                          MaxAspectRatio,
00176                               SMESH::SMESH_MeshEditor::Smooth_Method Method,
00177                               bool                                   IsParametric);
00178 
00179 
00180   void ConvertToQuadratic(CORBA::Boolean Force3d);
00181   CORBA::Boolean ConvertFromQuadratic();
00182   void ConvertToQuadraticObject(CORBA::Boolean            theForce3d,
00183                                 SMESH::SMESH_IDSource_ptr theObject)
00184     throw (SALOME::SALOME_Exception);
00185   void ConvertFromQuadraticObject(SMESH::SMESH_IDSource_ptr theObject)
00186     throw (SALOME::SALOME_Exception);
00187 
00188   void RenumberNodes();
00189   void RenumberElements();
00190 
00191   void RotationSweep(const SMESH::long_array & IDsOfElements,
00192                      const SMESH::AxisStruct & Axis,
00193                      CORBA::Double             AngleInRadians,
00194                      CORBA::Long               NbOfSteps,
00195                      CORBA::Double             Tolerance);
00196   void RotationSweepObject(SMESH::SMESH_IDSource_ptr theObject,
00197                            const SMESH::AxisStruct & Axis,
00198                            CORBA::Double             AngleInRadians,
00199                            CORBA::Long               NbOfSteps,
00200                            CORBA::Double             Tolerance);
00201   void RotationSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
00202                              const SMESH::AxisStruct & Axis,
00203                              CORBA::Double             AngleInRadians,
00204                              CORBA::Long               NbOfSteps,
00205                              CORBA::Double             Tolerance);
00206   void RotationSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
00207                              const SMESH::AxisStruct & Axis,
00208                              CORBA::Double             AngleInRadians,
00209                              CORBA::Long               NbOfSteps,
00210                              CORBA::Double             Tolerance);
00211 
00212   void ExtrusionSweep(const SMESH::long_array & IDsOfElements,
00213                       const SMESH::DirStruct &  StepVector,
00214                       CORBA::Long               NbOfSteps);
00215   void ExtrusionSweep0D(const SMESH::long_array & IDsOfElements,
00216                       const SMESH::DirStruct &  StepVector,
00217                       CORBA::Long               NbOfSteps);
00218 
00219   void ExtrusionSweepObject(SMESH::SMESH_IDSource_ptr theObject,
00220                             const SMESH::DirStruct &  StepVector,
00221                             CORBA::Long               NbOfSteps);
00222 
00223   void ExtrusionSweepObject0D(SMESH::SMESH_IDSource_ptr theObject,
00224                               const SMESH::DirStruct &  StepVector,
00225                               CORBA::Long               NbOfSteps);
00226   void ExtrusionSweepObject1D(SMESH::SMESH_IDSource_ptr theObject,
00227                               const SMESH::DirStruct &  StepVector,
00228                               CORBA::Long               NbOfSteps);
00229   void ExtrusionSweepObject2D(SMESH::SMESH_IDSource_ptr theObject,
00230                               const SMESH::DirStruct &  StepVector,
00231                               CORBA::Long               NbOfSteps);
00232   void AdvancedExtrusion(const SMESH::long_array & theIDsOfElements,
00233                          const SMESH::DirStruct &  theStepVector,
00234                          CORBA::Long               theNbOfSteps,
00235                          CORBA::Long               theExtrFlags,
00236                          CORBA::Double             theSewTolerance);
00237 
00238   SMESH::SMESH_MeshEditor::Extrusion_Error
00239   ExtrusionAlongPath(const SMESH::long_array &   IDsOfElements,
00240                      SMESH::SMESH_Mesh_ptr       PathMesh,
00241                      GEOM::GEOM_Object_ptr       PathShape,
00242                      CORBA::Long                 NodeStart,
00243                      CORBA::Boolean              HasAngles,
00244                      const SMESH::double_array & Angles,
00245                      CORBA::Boolean              HasRefPoint,
00246                      const SMESH::PointStruct &  RefPoint);
00247 
00248   SMESH::SMESH_MeshEditor::Extrusion_Error
00249   ExtrusionAlongPathObject(SMESH::SMESH_IDSource_ptr   theObject,
00250                            SMESH::SMESH_Mesh_ptr       PathMesh,
00251                            GEOM::GEOM_Object_ptr       PathShape,
00252                            CORBA::Long                 NodeStart,
00253                            CORBA::Boolean              HasAngles,
00254                            const SMESH::double_array & Angles,
00255                            CORBA::Boolean              HasRefPoint,
00256                            const SMESH::PointStruct &  RefPoint);
00257   SMESH::SMESH_MeshEditor::Extrusion_Error
00258   ExtrusionAlongPathObject1D(SMESH::SMESH_IDSource_ptr   theObject,
00259                              SMESH::SMESH_Mesh_ptr       PathMesh,
00260                              GEOM::GEOM_Object_ptr       PathShape,
00261                              CORBA::Long                 NodeStart,
00262                              CORBA::Boolean              HasAngles,
00263                              const SMESH::double_array & Angles,
00264                              CORBA::Boolean              HasRefPoint,
00265                              const SMESH::PointStruct &  RefPoint);
00266   SMESH::SMESH_MeshEditor::Extrusion_Error
00267   ExtrusionAlongPathObject2D(SMESH::SMESH_IDSource_ptr   theObject,
00268                              SMESH::SMESH_Mesh_ptr       PathMesh,
00269                              GEOM::GEOM_Object_ptr       PathShape,
00270                              CORBA::Long                 NodeStart,
00271                              CORBA::Boolean              HasAngles,
00272                              const SMESH::double_array & Angles,
00273                              CORBA::Boolean              HasRefPoint,
00274                              const SMESH::PointStruct &  RefPoint);
00275 
00276   SMESH::double_array* LinearAnglesVariation(SMESH::SMESH_Mesh_ptr       PathMesh,
00277                                              GEOM::GEOM_Object_ptr       PathShape,
00278                                              const SMESH::double_array & Angles);
00279 
00280   void Mirror(const SMESH::long_array &           IDsOfElements,
00281               const SMESH::AxisStruct &           Axis,
00282               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
00283               CORBA::Boolean                      Copy);
00284   void MirrorObject(SMESH::SMESH_IDSource_ptr           theObject,
00285                     const SMESH::AxisStruct &           Axis,
00286                     SMESH::SMESH_MeshEditor::MirrorType MirrorType,
00287                     CORBA::Boolean                      Copy);
00288   void Translate(const SMESH::long_array & IDsOfElements,
00289                  const SMESH::DirStruct &   Vector,
00290                  CORBA::Boolean            Copy);
00291   void TranslateObject(SMESH::SMESH_IDSource_ptr  theObject,
00292                        const SMESH::DirStruct &   Vector,
00293                        CORBA::Boolean             Copy);
00294   void Rotate(const SMESH::long_array & IDsOfElements,
00295               const SMESH::AxisStruct &  Axis,
00296               CORBA::Double             Angle,
00297               CORBA::Boolean            Copy);
00298   void RotateObject(SMESH::SMESH_IDSource_ptr  theObject,
00299                     const SMESH::AxisStruct &  Axis,
00300                     CORBA::Double              Angle,
00301                     CORBA::Boolean             Copy);
00302 
00303   SMESH::ListOfGroups* RotationSweepMakeGroups(const SMESH::long_array& IDsOfElements,
00304                                                const SMESH::AxisStruct& Axix,
00305                                                CORBA::Double            AngleInRadians,
00306                                                CORBA::Long              NbOfSteps,
00307                                                CORBA::Double            Tolerance);
00308   SMESH::ListOfGroups* RotationSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
00309                                                      const SMESH::AxisStruct&  Axix,
00310                                                      CORBA::Double             AngleInRadians,
00311                                                      CORBA::Long               NbOfSteps,
00312                                                      CORBA::Double             Tolerance);
00313   SMESH::ListOfGroups* RotationSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
00314                                                        const SMESH::AxisStruct&  Axix,
00315                                                        CORBA::Double             AngleInRadians,
00316                                                        CORBA::Long               NbOfSteps,
00317                                                        CORBA::Double             Tolerance);
00318   SMESH::ListOfGroups* RotationSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
00319                                                        const SMESH::AxisStruct&  Axix,
00320                                                        CORBA::Double             AngleInRadians,
00321                                                        CORBA::Long               NbOfSteps,
00322                                                        CORBA::Double             Tolerance);
00323   SMESH::ListOfGroups* ExtrusionSweepMakeGroups(const SMESH::long_array& IDsOfElements,
00324                                                 const SMESH::DirStruct&  StepVector,
00325                                                 CORBA::Long              NbOfSteps);
00326   SMESH::ListOfGroups* ExtrusionSweepMakeGroups0D(const SMESH::long_array& IDsOfElements,
00327                                                 const SMESH::DirStruct&  StepVector,
00328                                                 CORBA::Long              NbOfSteps);
00329 
00330   SMESH::ListOfGroups* AdvancedExtrusionMakeGroups(const SMESH::long_array& IDsOfElements,
00331                                                    const SMESH::DirStruct&  StepVector,
00332                                                    CORBA::Long              NbOfSteps,
00333                                                    CORBA::Long              ExtrFlags,
00334                                                    CORBA::Double            SewTolerance);
00335   SMESH::ListOfGroups* ExtrusionSweepObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
00336                                                       const SMESH::DirStruct&   StepVector,
00337                                                       CORBA::Long               NbOfSteps);
00338   SMESH::ListOfGroups* ExtrusionSweepObject0DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
00339                                                         const SMESH::DirStruct&   StepVector,
00340                                                         CORBA::Long               NbOfSteps);
00341   SMESH::ListOfGroups* ExtrusionSweepObject1DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
00342                                                         const SMESH::DirStruct&   StepVector,
00343                                                         CORBA::Long               NbOfSteps);
00344   SMESH::ListOfGroups* ExtrusionSweepObject2DMakeGroups(SMESH::SMESH_IDSource_ptr Object,
00345                                                         const SMESH::DirStruct&   StepVector,
00346                                                         CORBA::Long               NbOfSteps);
00347   SMESH::ListOfGroups* ExtrusionAlongPathMakeGroups(const SMESH::long_array&   IDsOfElements,
00348                                                     SMESH::SMESH_Mesh_ptr      PathMesh,
00349                                                     GEOM::GEOM_Object_ptr      PathShape,
00350                                                     CORBA::Long                NodeStart,
00351                                                     CORBA::Boolean             HasAngles,
00352                                                     const SMESH::double_array& Angles,
00353                                                     CORBA::Boolean             HasRefPoint,
00354                                                     const SMESH::PointStruct&  RefPoint,
00355                                                     SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
00356   SMESH::ListOfGroups* ExtrusionAlongPathObjectMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
00357                                                           SMESH::SMESH_Mesh_ptr      PathMesh,
00358                                                           GEOM::GEOM_Object_ptr      PathShape,
00359                                                           CORBA::Long                NodeStart,
00360                                                           CORBA::Boolean             HasAngles,
00361                                                           const SMESH::double_array& Angles,
00362                                                           CORBA::Boolean             HasRefPoint,
00363                                                           const SMESH::PointStruct&  RefPoint,
00364                                                           SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
00365   SMESH::ListOfGroups* ExtrusionAlongPathObject1DMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
00366                                                             SMESH::SMESH_Mesh_ptr      PathMesh,
00367                                                             GEOM::GEOM_Object_ptr      PathShape,
00368                                                             CORBA::Long                NodeStart,
00369                                                             CORBA::Boolean             HasAngles,
00370                                                             const SMESH::double_array& Angles,
00371                                                             CORBA::Boolean             HasRefPoint,
00372                                                             const SMESH::PointStruct&  RefPoint,
00373                                                             SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
00374   SMESH::ListOfGroups* ExtrusionAlongPathObject2DMakeGroups(SMESH::SMESH_IDSource_ptr  Object,
00375                                                             SMESH::SMESH_Mesh_ptr      PathMesh,
00376                                                             GEOM::GEOM_Object_ptr      PathShape,
00377                                                             CORBA::Long                NodeStart,
00378                                                             CORBA::Boolean             HasAngles,
00379                                                             const SMESH::double_array& Angles,
00380                                                             CORBA::Boolean             HasRefPoint,
00381                                                             const SMESH::PointStruct&  RefPoint,
00382                                                             SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
00383 
00384   // skl 04.06.2009 
00385   SMESH::ListOfGroups* ExtrusionAlongPathObjX(SMESH::SMESH_IDSource_ptr  Object,
00386                                               SMESH::SMESH_IDSource_ptr  Path,
00387                                               CORBA::Long                NodeStart,
00388                                               CORBA::Boolean             HasAngles,
00389                                               const SMESH::double_array& Angles,
00390                                               CORBA::Boolean             LinearVariation,
00391                                               CORBA::Boolean             HasRefPoint,
00392                                               const SMESH::PointStruct&  RefPoint,
00393                                               CORBA::Boolean             MakeGroups,
00394                                               SMESH::ElementType         ElemType,
00395                                               SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
00396   SMESH::ListOfGroups* ExtrusionAlongPathX(const SMESH::long_array&   IDsOfElements,
00397                                            SMESH::SMESH_IDSource_ptr  Path,
00398                                            CORBA::Long                NodeStart,
00399                                            CORBA::Boolean             HasAngles,
00400                                            const SMESH::double_array& Angles,
00401                                            CORBA::Boolean             LinearVariation,
00402                                            CORBA::Boolean             HasRefPoint,
00403                                            const SMESH::PointStruct&  RefPoint,
00404                                            CORBA::Boolean             MakeGroups,
00405                                            SMESH::ElementType         ElemType,
00406                                            SMESH::SMESH_MeshEditor::Extrusion_Error& Error);
00407 
00408   SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array&            IDsOfElements,
00409                                         const SMESH::AxisStruct&            Mirror,
00410                                         SMESH::SMESH_MeshEditor::MirrorType MirrorType);
00411   SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr           Object,
00412                                               const SMESH::AxisStruct&            Mirror,
00413                                               SMESH::SMESH_MeshEditor::MirrorType MirrorType);
00414   SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements,
00415                                            const SMESH::DirStruct&  Vector);
00416   SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
00417                                                  const SMESH::DirStruct&   Vector);
00418   SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements,
00419                                         const SMESH::AxisStruct& Axis,
00420                                         CORBA::Double            AngleInRadians);
00421   SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object,
00422                                               const SMESH::AxisStruct&  Axis,
00423                                               CORBA::Double             AngleInRadians);
00424 
00425   SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array&            IDsOfElements,
00426                                        const SMESH::AxisStruct&            Mirror,
00427                                        SMESH::SMESH_MeshEditor::MirrorType MirrorType,
00428                                        CORBA::Boolean                      CopyGroups,
00429                                        const char*                         MeshName);
00430   SMESH::SMESH_Mesh_ptr MirrorObjectMakeMesh(SMESH::SMESH_IDSource_ptr           Object,
00431                                              const SMESH::AxisStruct&            Mirror,
00432                                              SMESH::SMESH_MeshEditor::MirrorType MirrorType,
00433                                              CORBA::Boolean                      CopyGroups,
00434                                              const char*                         MeshName);
00435   SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements,
00436                                           const SMESH::DirStruct&  Vector,
00437                                           CORBA::Boolean           CopyGroups,
00438                                           const char*              MeshName);
00439   SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
00440                                                 const SMESH::DirStruct&   Vector,
00441                                                 CORBA::Boolean            CopyGroups,
00442                                                 const char*               MeshName);
00443   SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements,
00444                                        const SMESH::AxisStruct& Axis,
00445                                        CORBA::Double            AngleInRadians,
00446                                        CORBA::Boolean           CopyGroups,
00447                                        const char*              MeshName);
00448   SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object,
00449                                              const SMESH::AxisStruct&  Axis,
00450                                              CORBA::Double             AngleInRadians,
00451                                              CORBA::Boolean            CopyGroups,
00452                                              const char*               MeshName);
00453 
00454   void Scale(SMESH::SMESH_IDSource_ptr  theObject,
00455              const SMESH::PointStruct&  thePoint,
00456              const SMESH::double_array& theScaleFact,
00457              CORBA::Boolean             theCopy);
00458 
00459   SMESH::ListOfGroups* ScaleMakeGroups(SMESH::SMESH_IDSource_ptr  theObject,
00460                                        const SMESH::PointStruct&  thePoint,
00461                                        const SMESH::double_array& theScaleFact);
00462 
00463   SMESH::SMESH_Mesh_ptr ScaleMakeMesh(SMESH::SMESH_IDSource_ptr Object,
00464                                       const SMESH::PointStruct& Point,
00465                                       const SMESH::double_array& theScaleFact,
00466                                       CORBA::Boolean            CopyGroups,
00467                                       const char*               MeshName);
00468 
00469   void FindCoincidentNodes (CORBA::Double                  Tolerance,
00470                             SMESH::array_of_long_array_out GroupsOfNodes);
00471   void FindCoincidentNodesOnPart(SMESH::SMESH_IDSource_ptr      Object,
00472                                  CORBA::Double                  Tolerance,
00473                                  SMESH::array_of_long_array_out GroupsOfNodes);
00474   void FindCoincidentNodesOnPartBut(SMESH::SMESH_IDSource_ptr      Object,
00475                                     CORBA::Double                  Tolerance,
00476                                     SMESH::array_of_long_array_out GroupsOfNodes,
00477                                     const SMESH::ListOfIDSources&  ExceptSubMeshOrGroups);
00478   void MergeNodes (const SMESH::array_of_long_array& GroupsOfNodes);
00479   void FindEqualElements(SMESH::SMESH_IDSource_ptr      Object,
00480                          SMESH::array_of_long_array_out GroupsOfElementsID);
00481   void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID);
00482   void MergeEqualElements();
00483   CORBA::Long MoveClosestNodeToPoint(CORBA::Double x,
00484                                      CORBA::Double y,
00485                                      CORBA::Double z,
00486                                      CORBA::Long   nodeID);
00490   CORBA::Long FindNodeClosestTo(CORBA::Double x,
00491                                 CORBA::Double y,
00492                                 CORBA::Double z);
00497   SMESH::long_array* FindElementsByPoint(CORBA::Double      x,
00498                                          CORBA::Double      y,
00499                                          CORBA::Double      z,
00500                                          SMESH::ElementType type);
00506   SMESH::long_array* FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elements,
00507                                               CORBA::Double             x,
00508                                               CORBA::Double             y,
00509                                               CORBA::Double             z,
00510                                               SMESH::ElementType        type);
00511 
00516   CORBA::Short GetPointState(CORBA::Double x, CORBA::Double y, CORBA::Double z);
00517 
00518   SMESH::SMESH_MeshEditor::Sew_Error
00519   SewFreeBorders(CORBA::Long FirstNodeID1,
00520                  CORBA::Long SecondNodeID1,
00521                  CORBA::Long LastNodeID1,
00522                  CORBA::Long FirstNodeID2,
00523                  CORBA::Long SecondNodeID2,
00524                  CORBA::Long LastNodeID2,
00525                  CORBA::Boolean CreatePolygons,
00526                  CORBA::Boolean CreatePolyedrs);
00527   SMESH::SMESH_MeshEditor::Sew_Error
00528   SewConformFreeBorders(CORBA::Long FirstNodeID1,
00529                         CORBA::Long SecondNodeID1,
00530                         CORBA::Long LastNodeID1,
00531                         CORBA::Long FirstNodeID2,
00532                         CORBA::Long SecondNodeID2);
00533   SMESH::SMESH_MeshEditor::Sew_Error
00534   SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder,
00535                   CORBA::Long SecondNodeIDOnFreeBorder,
00536                   CORBA::Long LastNodeIDOnFreeBorder,
00537                   CORBA::Long FirstNodeIDOnSide,
00538                   CORBA::Long LastNodeIDOnSide,
00539                   CORBA::Boolean CreatePolygons,
00540                   CORBA::Boolean CreatePolyedrs);
00541   SMESH::SMESH_MeshEditor::Sew_Error
00542   SewSideElements(const SMESH::long_array& IDsOfSide1Elements,
00543                   const SMESH::long_array& IDsOfSide2Elements,
00544                   CORBA::Long NodeID1OfSide1ToMerge,
00545                   CORBA::Long NodeID1OfSide2ToMerge,
00546                   CORBA::Long NodeID2OfSide1ToMerge,
00547                   CORBA::Long NodeID2OfSide2ToMerge);
00548 
00554   CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs);
00555 
00559   SMESH::MeshPreviewStruct* GetPreviewData();
00560 
00566   SMESH::long_array* GetLastCreatedNodes();
00567 
00573   SMESH::long_array* GetLastCreatedElems();
00574 
00579   int GetMeshId() const { return myMesh->GetId(); }
00580 
00581   CORBA::Boolean DoubleNodes( const SMESH::long_array& theNodes,
00582                               const SMESH::long_array& theModifiedElems );
00583 
00584   CORBA::Boolean DoubleNode( CORBA::Long theNodeId,
00585                              const SMESH::long_array& theModifiedElems );
00586 
00587   CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theNodes,
00588                                   SMESH::SMESH_GroupBase_ptr theModifiedElems );
00589 
00598   SMESH::SMESH_Group_ptr DoubleNodeGroupNew( SMESH::SMESH_GroupBase_ptr theNodes,
00599                                              SMESH::SMESH_GroupBase_ptr theModifiedElems );
00600 
00601   CORBA::Boolean DoubleNodeGroups( const SMESH::ListOfGroups& theNodes,
00602                                    const SMESH::ListOfGroups& theModifiedElems );
00603 
00604   SMESH::SMESH_Group_ptr DoubleNodeGroupsNew( const SMESH::ListOfGroups& theNodes,
00605                                               const SMESH::ListOfGroups& theModifiedElems );
00606 
00617   CORBA::Boolean DoubleNodeElem( const SMESH::long_array& theElems, 
00618                                  const SMESH::long_array& theNodesNot,
00619                                  const SMESH::long_array& theAffectedElems );
00620 
00632   CORBA::Boolean DoubleNodeElemInRegion( const SMESH::long_array& theElems, 
00633                                          const SMESH::long_array& theNodesNot,
00634                                          GEOM::GEOM_Object_ptr    theShape );
00635 
00645   CORBA::Boolean DoubleNodeElemGroup( SMESH::SMESH_GroupBase_ptr theElems,
00646                                       SMESH::SMESH_GroupBase_ptr theNodesNot,
00647                                       SMESH::SMESH_GroupBase_ptr theAffectedElems );
00648 
00659   SMESH::SMESH_Group_ptr DoubleNodeElemGroupNew( SMESH::SMESH_GroupBase_ptr theElems,
00660                                                  SMESH::SMESH_GroupBase_ptr theNodesNot,
00661                                                  SMESH::SMESH_GroupBase_ptr theAffectedElems );
00662 
00663   SMESH::ListOfGroups*   DoubleNodeElemGroup2New(SMESH::SMESH_GroupBase_ptr theElems,
00664                                                  SMESH::SMESH_GroupBase_ptr theNodesNot,
00665                                                  SMESH::SMESH_GroupBase_ptr theAffectedElems,
00666                                                  CORBA::Boolean             theElemGroupNeeded,
00667                                                  CORBA::Boolean             theNodeGroupNeeded);
00668   
00679   CORBA::Boolean DoubleNodeElemGroupInRegion( SMESH::SMESH_GroupBase_ptr theElems,
00680                                               SMESH::SMESH_GroupBase_ptr theNodesNot,
00681                                               GEOM::GEOM_Object_ptr      theShape );
00682 
00693   CORBA::Boolean DoubleNodeElemGroups( const SMESH::ListOfGroups& theElems,
00694                                        const SMESH::ListOfGroups& theNodesNot,
00695                                        const SMESH::ListOfGroups& theAffectedElems );
00696 
00707   SMESH::SMESH_Group_ptr DoubleNodeElemGroupsNew( const SMESH::ListOfGroups& theElems,
00708                                                   const SMESH::ListOfGroups& theNodesNot,
00709                                                   const SMESH::ListOfGroups& theAffectedElems );
00710 
00711   SMESH::ListOfGroups*   DoubleNodeElemGroups2New(const SMESH::ListOfGroups& theElems,
00712                                                   const SMESH::ListOfGroups& theNodesNot,
00713                                                   const SMESH::ListOfGroups& theAffectedElems,
00714                                                   CORBA::Boolean             theElemGroupNeeded,
00715                                                   CORBA::Boolean             theNodeGroupNeeded);
00716 
00728   CORBA::Boolean DoubleNodeElemGroupsInRegion( const SMESH::ListOfGroups& theElems,
00729                                                const SMESH::ListOfGroups& theNodesNot,
00730                                                GEOM::GEOM_Object_ptr      theShape );
00741   CORBA::Boolean DoubleNodesOnGroupBoundaries( const SMESH::ListOfGroups& theDomains,
00742                                                CORBA::Boolean createJointElems )
00743     throw (SALOME::SALOME_Exception);
00753   CORBA::Boolean CreateFlatElementsOnFacesGroups( const SMESH::ListOfGroups& theGroupsOfFaces );
00754 
00760   CORBA::Boolean Make2DMeshFrom3D();
00761 
00762   SMESH::SMESH_Mesh_ptr MakeBoundaryMesh(SMESH::SMESH_IDSource_ptr elements,
00763                                          SMESH::Bnd_Dimension      dimension,
00764                                          const char*               groupName,
00765                                          const char*               meshName,
00766                                          CORBA::Boolean            toCopyElements,
00767                                          CORBA::Boolean            toCopyMissingBondary,
00768                                          SMESH::SMESH_Group_out    group);
00769 
00770   CORBA::Long MakeBoundaryElements(SMESH::Bnd_Dimension dimension,
00771                                    const char* groupName,
00772                                    const char* meshName,
00773                                    CORBA::Boolean toCopyAll,
00774                                    const SMESH::ListOfIDSources& groups,
00775                                    SMESH::SMESH_Mesh_out mesh,
00776                                    SMESH::SMESH_Group_out group)
00777     throw (SALOME::SALOME_Exception);
00778 
00779 private: 
00780 
00781   SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
00782 
00787   void storeResult(::SMESH_MeshEditor& anEditor);
00791   void initData(bool deleteSearchers=true);
00792 
00796   SMESH::ListOfGroups* getGroups(const std::list<int>* groupIDs);
00797 
00798   SMESH::ListOfGroups* rotationSweep(const SMESH::long_array & IDsOfElements,
00799                                      const SMESH::AxisStruct & Axis,
00800                                      CORBA::Double             AngleInRadians,
00801                                      CORBA::Long               NbOfSteps,
00802                                      CORBA::Double             Tolerance,
00803                                      const bool                MakeGroups,
00804                                      const SMDSAbs_ElementType ElementType=SMDSAbs_All);
00805   SMESH::ListOfGroups* extrusionSweep(const SMESH::long_array & IDsOfElements,
00806                                       const SMESH::DirStruct &  StepVector,
00807                                       CORBA::Long               NbOfSteps,
00808                                       bool                      MakeGroups,
00809                                       const SMDSAbs_ElementType ElementType=SMDSAbs_All);
00810   SMESH::ListOfGroups* advancedExtrusion(const SMESH::long_array & theIDsOfElements,
00811                                          const SMESH::DirStruct &  theStepVector,
00812                                          CORBA::Long               theNbOfSteps,
00813                                          CORBA::Long               theExtrFlags,
00814                                          CORBA::Double             theSewTolerance,
00815                                          const bool                MakeGroups);
00816   SMESH::ListOfGroups* extrusionAlongPath(const SMESH::long_array &   IDsOfElements,
00817                                           SMESH::SMESH_Mesh_ptr       PathMesh,
00818                                           GEOM::GEOM_Object_ptr       PathShape,
00819                                           CORBA::Long                 NodeStart,
00820                                           CORBA::Boolean              HasAngles,
00821                                           const SMESH::double_array & Angles,
00822                                           CORBA::Boolean              HasRefPoint,
00823                                           const SMESH::PointStruct &  RefPoint,
00824                                           const bool                  MakeGroups,
00825                                           SMESH::SMESH_MeshEditor::Extrusion_Error & Error,
00826                                           const SMDSAbs_ElementType   ElementType=SMDSAbs_All);
00827   SMESH::ListOfGroups* extrusionAlongPathX(const SMESH::long_array &  IDsOfElements,
00828                                            SMESH::SMESH_IDSource_ptr  Path,
00829                                            CORBA::Long                NodeStart,
00830                                            CORBA::Boolean             HasAngles,
00831                                            const SMESH::double_array& Angles,
00832                                            CORBA::Boolean             LinearVariation,
00833                                            CORBA::Boolean             HasRefPoint,
00834                                            const SMESH::PointStruct&  RefPoint,
00835                                            bool                       MakeGroups,
00836                                            const SMDSAbs_ElementType  ElementType,
00837                                            SMESH::SMESH_MeshEditor::Extrusion_Error & theError);
00838   SMESH::ListOfGroups* mirror(TIDSortedElemSet &                  IDsOfElements,
00839                               const SMESH::AxisStruct &           Axis,
00840                               SMESH::SMESH_MeshEditor::MirrorType MirrorType,
00841                               CORBA::Boolean                      Copy,
00842                               bool                                MakeGroups,
00843                               ::SMESH_Mesh*                       TargetMesh=0);
00844   SMESH::ListOfGroups* translate(TIDSortedElemSet        & IDsOfElements,
00845                                  const SMESH::DirStruct &  Vector,
00846                                  CORBA::Boolean            Copy,
00847                                  bool                      MakeGroups,
00848                                  ::SMESH_Mesh*             TargetMesh=0);
00849   SMESH::ListOfGroups* rotate(TIDSortedElemSet &           IDsOfElements,
00850                               const SMESH::AxisStruct &  Axis,
00851                               CORBA::Double             Angle,
00852                               CORBA::Boolean            Copy,
00853                               bool                      MakeGroups,
00854                               ::SMESH_Mesh*             TargetMesh=0);
00855 
00856   SMESH::ListOfGroups* scale(SMESH::SMESH_IDSource_ptr   theObject,
00857                              const SMESH::PointStruct&   thePoint,
00858                              const SMESH::double_array&  theScaleFact,
00859                              CORBA::Boolean              theCopy,
00860                              bool                        theMakeGroups,
00861                              ::SMESH_Mesh*               theTargetMesh=0);
00862 
00863   SMESH::SMESH_Mesh_ptr makeMesh(const char* theMeshName);
00864 
00865   void DumpGroupsList(SMESH::TPythonDump & theDumpPython, 
00866                       const SMESH::ListOfGroups * theGroupList);
00867 
00868   string generateGroupName(const string& thePrefix);
00869 
00870 private: 
00871 
00872   SMESH_Mesh_i*         myMesh_i;
00873   SMESH_Mesh *          myMesh;
00874 
00875   SMESH::long_array_var myLastCreatedElems;
00876   SMESH::long_array_var myLastCreatedNodes;
00877 
00878   SMESH::MeshPreviewStruct_var myPreviewData;
00879   bool                         myPreviewMode;
00880 };
00881 
00882 #endif