mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-15 01:58:35 +05:00
First attempt to write a size-map file from an existing .mesh file
This commit is contained in:
parent
1227aa421b
commit
5c19c58d3d
@ -340,6 +340,48 @@ Driver_Mesh::Status DriverGMF_Write::Perform()
|
|||||||
return DRS_OK;
|
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
|
* \brief Returns an iterator on elements of a certain type
|
||||||
|
@ -47,8 +47,13 @@ public:
|
|||||||
{
|
{
|
||||||
_exportRequiredGroups = toExport;
|
_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:
|
private:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user