Salome HOME
bos #24400 [CEA] Option in SALOME for not storing in med files the indices (number...
[modules/smesh.git] / src / DriverMED / DriverMED_W_SMESHDS_Mesh.cxx
index cb3be452e68b1a1302b1248ab2a184762bc3952e..5076ae51d156712b743f5f3f19cd270822269c08 100644 (file)
@@ -53,6 +53,12 @@ using namespace std;
 using namespace MED;
 
 
+//================================================================================
+/*!
+ * \brief Constructor
+ */
+//================================================================================
+
 DriverMED_W_SMESHDS_Mesh::DriverMED_W_SMESHDS_Mesh():
   myAllSubMeshes (false),
   myDoGroupOfNodes (false),
@@ -65,19 +71,31 @@ DriverMED_W_SMESHDS_Mesh::DriverMED_W_SMESHDS_Mesh():
   myAddODOnVertices(false),
   myDoAllInGroups(false),
   myVersion(-1),
-  myZTolerance(-1.)
+  myZTolerance(-1.),
+  mySaveNumbers(true)
 {}
 
+//================================================================================
+/*!
+ * \brief Set a file name and a version
+ *  \param [in] theFileName - output file name
+ *  \param [in] theVersion - desired MED file version == major * 10 + minor
+ */
+//================================================================================
+
 void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName, int theVersion)
 {
   myVersion = theVersion;
   Driver_SMESHDS_Mesh::SetFile(theFileName);
 }
 
+//================================================================================
 /*!
  * MED version is either the latest available, or with an inferior minor,
  * to ensure backward compatibility on writing med files.
  */
+//================================================================================
+
 string DriverMED_W_SMESHDS_Mesh::GetVersionString(int theMinor, int theNbDigits)
 {
   TInt majeur, mineur, release;
@@ -166,6 +184,12 @@ void DriverMED_W_SMESHDS_Mesh::AddAllToGroup()
 
 namespace
 {
+  //---------------------------------------------
+  /*!
+   * \brief Retrieving node coordinates utilities
+   */
+  //---------------------------------------------
+
   typedef double (SMDS_MeshNode::* TGetCoord)() const;
   typedef const char* TName;
   typedef const char* TUnit;
@@ -344,12 +368,24 @@ namespace
   }
 }
 
+//================================================================================
+/*!
+ * \brief Write my mesh to a file
+ */
+//================================================================================
+
 Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
 {
   MED::PWrapper myMed = CrWrapperW(myFile, myVersion);
   return this->PerformInternal<MED::PWrapper>(myMed);
 }
 
+//================================================================================
+/*!
+ * \brief Write my mesh to a MEDCoupling DS
+ */
+//================================================================================
+
 Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh_Mem::Perform()
 {
   void *ptr(nullptr);
@@ -571,7 +607,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::PerformInternal(LowLevelWriter myM
 #endif
     const EModeSwitch   theMode        = eFULL_INTERLACE;
     const ERepere       theSystem      = eCART;
-    const EBooleen      theIsElemNum   = eVRAI;
+    const EBooleen      theIsElemNum   = mySaveNumbers ? eVRAI : eFAUX;
     const EBooleen      theIsElemNames = eFAUX;
     const EConnectivite theConnMode    = eNOD;