First attempt to write a size-map file from an existing .mesh file

This commit is contained in:
rnc 2013-05-30 16:39:07 +00:00
parent 1227aa421b
commit 5c19c58d3d
2 changed files with 49 additions and 2 deletions

View 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

View 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: