Salome HOME
Compilation on Windows platform.
[modules/smesh.git] / src / SMESH / SMESH_Mesh.cxx
index 4a00711b7a6f76286586fd9afc2cf8cc7fed0186..b3cf4dfda3677f04b029546ba3874aa1095e5d98 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -143,7 +143,7 @@ SMESH_Mesh::SMESH_Mesh():
 namespace
 {
 #ifndef WIN32
- void deleteMeshDS(SMESHDS_Mesh* meshDS)
 void deleteMeshDS(SMESHDS_Mesh* meshDS)
   {
     //cout << "deleteMeshDS( " << meshDS << endl;
     delete meshDS;
@@ -152,18 +152,18 @@ namespace
   static void* deleteMeshDS(void* meshDS)
   {
     //cout << "deleteMeshDS( " << meshDS << endl;
-       SMESHDS_Mesh* m = (SMESHDS_Mesh*)meshDS;
-       if(m) { 
-         delete m;       
-       }
-   return 0;
+    SMESHDS_Mesh* m = (SMESHDS_Mesh*)meshDS;
+    if(m) {
+      delete m;
+    }
+    return 0;
   }
 #endif
 }
 
 //=============================================================================
 /*!
- * 
+ *
  */
 //=============================================================================
 
@@ -207,7 +207,7 @@ SMESH_Mesh::~SMESH_Mesh()
   _myDocument = 0;
 
   if ( _myMeshDS ) {
-    // delete _myMeshDS, in a thread in order not to block closing a study with large meshes   
+    // delete _myMeshDS, in a thread in order not to block closing a study with large meshes
 #ifndef WIN32
     boost::thread aThread(boost::bind( & deleteMeshDS, _myMeshDS ));
 #else
@@ -1268,6 +1268,19 @@ bool SMESH_Mesh::HasDuplicatedGroupNamesMED()
 //================================================================================
 /*!
  * \brief Export the mesh to a med file
+ *  \param [in] file - name of the MED file
+ *  \param [in] theMeshName - name of this mesh
+ *  \param [in] theAutoGroups - boolean parameter for creating/not creating
+ *              the groups Group_On_All_Nodes, Group_On_All_Faces, ... ;
+ *              the typical use is auto_groups=false.
+ *  \param [in] theVersion - defines the version of format of MED file, that will be created
+ *  \param [in] meshPart - mesh data to export
+ *  \param [in] theAutoDimension - if \c true, a space dimension of a MED mesh can be either
+     *         - 1D if all mesh nodes lie on OX coordinate axis, or
+     *         - 2D if all mesh nodes lie on XOY coordinate plane, or
+     *         - 3D in the rest cases.
+     *         If \a theAutoDimension is \c false, the space dimension is always 3.
+ *  \return int - mesh index in the file
  */
 //================================================================================
 
@@ -1276,7 +1289,8 @@ void SMESH_Mesh::ExportMED(const char *        file,
                            bool                theAutoGroups,
                            int                 theVersion,
                            const SMESHDS_Mesh* meshPart,
-                           bool                theAutoDimension)
+                           bool                theAutoDimension,
+                           bool                theAddODOnVertices)
   throw(SALOME_Exception)
 {
   SMESH_TRY;
@@ -1285,6 +1299,7 @@ void SMESH_Mesh::ExportMED(const char *        file,
   myWriter.SetFile         ( file, MED::EVersion(theVersion) );
   myWriter.SetMesh         ( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS   );
   myWriter.SetAutoDimension( theAutoDimension );
+  myWriter.AddODOnVertices ( theAddODOnVertices );
   if ( !theMeshName ) 
     myWriter.SetMeshId     ( _id         );
   else {