Skip to content
Snippets Groups Projects
Commit 13a0e854 authored by Laurent Van Migroet's avatar Laurent Van Migroet
Browse files

setting filename when reading a geo file + add new function get all mesh vertices into GModel

parent 11aed392
No related branches found
No related tags found
No related merge requests found
...@@ -642,6 +642,21 @@ int GModel::getNumMeshVertices() ...@@ -642,6 +642,21 @@ int GModel::getNumMeshVertices()
return n; return n;
} }
void GModel::getMeshVertices(std::vector<MVertex *> &meshVertices)
{
meshVertices.resize(getNumMeshVertices());
std::vector<GEntity*> entities;
getEntities(entities);
int n = -1;
for(unsigned int i = 0; i < entities.size(); i++)
{
GEntity *entity=entities[i];
unsigned msh_size=entity->mesh_vertices.size();
for(unsigned j=0;j<msh_size;++j)
meshVertices[++n]=entity->mesh_vertices[j];
}
}
int GModel::getNumMeshElements() int GModel::getNumMeshElements()
{ {
std::vector<GEntity*> entities; std::vector<GEntity*> entities;
......
...@@ -310,6 +310,9 @@ class GModel ...@@ -310,6 +310,9 @@ class GModel
// return the total number of vertices in the mesh // return the total number of vertices in the mesh
int getNumMeshVertices(); int getNumMeshVertices();
// return all the mesh vertices
void getMeshVertices(std::vector<MVertex *> &meshVertices);
// access a mesh vertex by tag, using the vertex cache // access a mesh vertex by tag, using the vertex cache
MVertex *getMeshVertexByTag(int n); MVertex *getMeshVertexByTag(int n);
......
...@@ -39,7 +39,9 @@ void GModel::_deleteGEOInternals() ...@@ -39,7 +39,9 @@ void GModel::_deleteGEOInternals()
int GModel::readGEO(const std::string &name) int GModel::readGEO(const std::string &name)
{ {
ParseFile(name, true); ParseFile(name, true);
return GModel::current()->importGEOInternals(); GModel *newModel=GModel::current();
newModel->setFileName(name);
return newModel->importGEOInternals();
} }
int GModel::exportDiscreteGEOInternals() int GModel::exportDiscreteGEOInternals()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment