Salome HOME
First attempt to write a size-map file from an existing .mesh file
authorrnc <rnc@opencascade.com>
Thu, 30 May 2013 16:39:07 +0000 (16:39 +0000)
committerrnc <rnc@opencascade.com>
Thu, 30 May 2013 16:39:07 +0000 (16:39 +0000)
src/DriverGMF/DriverGMF_Write.cxx
src/DriverGMF/DriverGMF_Write.hxx

index d4f474771395ce3206d9c9deeb1bf8634901d7b6..f0e2dc3f85cc4affaa9793bed2a7f768b045f8ab 100644 (file)
@@ -340,6 +340,48 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
   return DRS_OK;
 }
 
+void DriverGMF_Write::AddSizeMapSection(int meshID, int nbControlPoints)
+{
+//   const int dim = 3, version = sizeof(long) == 4 ? 2 : 3;
+//   int meshID = GmfOpenMesh( myFile.c_str(), GmfWrite, version, dim );
+  int TypTab[] = {GmfSca};
+  GmfSetKwd(meshID, GmfSolAtVertices, nbControlPoints, 1, TypTab);
+//   GmfCloseMesh(meshID);
+//   return DRS_OK;
+}
+
+void DriverGMF_Write::AppendSize(int meshID, double size)
+{
+//   const int dim = 3, version = sizeof(long) == 4 ? 2 : 3;
+//   int meshID = GmfOpenMesh( myFile.c_str(), GmfWrite, version, dim );
+//   int nbPoints = GmfStatKwd( meshID, GmfSolAtVertices);
+//   GmfSetKwd( meshID, GmfSolAtVertices, nbPoints+1, 1, 1 );
+  double ValTab[] = {size};
+  GmfSetLin( meshID, GmfSolAtVertices, ValTab);
+//   return DRS_OK;
+}
+
+int DriverGMF_Write::NbVerticesInFile()
+{
+  int dim, version;
+  // open the file
+  int meshID = GmfOpenMesh( myFile.c_str(), GmfRead, &version, &dim );
+  int nbVertices = GmfStatKwd( meshID, GmfVertices);
+  return nbVertices;
+}
+
+int DriverGMF_Write::OpenFileToWrite()
+{
+  const int dim = 3, version = sizeof(long) == 4 ? 2 : 3;
+  int meshID = GmfOpenMesh( myFile.c_str(), GmfWrite, version, dim );
+  return meshID;
+}
+
+void DriverGMF_Write::CloseFile( int meshID )
+{
+  GmfCloseMesh( meshID );
+}
+
 //================================================================================
 /*!
  * \brief Returns an iterator on elements of a certain type
index 96c7df16e771e6790dca2fb2fce252017f6630da..e01f6b03ac8affe87d206bdf41ed08d2a691485a 100644 (file)
@@ -47,8 +47,13 @@ public:
   {
     _exportRequiredGroups = toExport;
   }
-
-  virtual Status Perform();
+   
+  virtual Status Perform(); 
+  void AddSizeMapSection( int meshID, int nbControlPoints );
+  void AppendSize( int meshID, double size );
+  int NbVerticesInFile();
+  int OpenFileToWrite();
+  void CloseFile( int );
 
  private: