Skip to content
Snippets Groups Projects
Commit b5bf8456 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

call resetMeshAttributes for lines and points, too!

parent 5b1422fa
No related branches found
No related tags found
No related merge requests found
...@@ -134,6 +134,9 @@ int GModel::importGEOInternals() ...@@ -134,6 +134,9 @@ int GModel::importGEOInternals()
v = new gmshVertex(this, p); v = new gmshVertex(this, p);
add(v); add(v);
} }
else{
v->resetMeshAttributes();
}
if(!p->Visible) v->setVisibility(0); if(!p->Visible) v->setVisibility(0);
} }
List_Delete(points); List_Delete(points);
...@@ -170,6 +173,9 @@ int GModel::importGEOInternals() ...@@ -170,6 +173,9 @@ int GModel::importGEOInternals()
e = new gmshEdge(this, c, 0, 0); e = new gmshEdge(this, c, 0, 0);
add(e); add(e);
} }
else{
e->resetMeshAttributes();
}
if(!c->Visible) e->setVisibility(0); if(!c->Visible) e->setVisibility(0);
if(c->Color.type) e->setColor(c->Color.mesh); if(c->Color.type) e->setColor(c->Color.mesh);
...@@ -297,8 +303,9 @@ int GModel::importGEOInternals() ...@@ -297,8 +303,9 @@ int GModel::importGEOInternals()
r = new gmshRegion(this, v); r = new gmshRegion(this, v);
add(r); add(r);
} }
else else{
r->resetMeshAttributes(); r->resetMeshAttributes();
}
if(!v->Visible) r->setVisibility(0); if(!v->Visible) r->setVisibility(0);
if(v->Color.type) r->setColor(v->Color.mesh); if(v->Color.type) r->setColor(v->Color.mesh);
} }
...@@ -326,27 +333,29 @@ int GModel::importGEOInternals() ...@@ -326,27 +333,29 @@ int GModel::importGEOInternals()
} }
// create periodic mesh relationships // create periodic mesh relationships
for(std::map<int,int>::iterator it = _geo_internals->periodicEdges.begin();
for (std::map<int,int>::iterator it = _geo_internals->periodicEdges.begin(); it != _geo_internals->periodicEdges.end(); ++it){
it != _geo_internals->periodicEdges.end(); ++it){
GEdge *ge = getEdgeByTag(abs(it->first)); GEdge *ge = getEdgeByTag(abs(it->first));
if (ge){ if (ge){
int MASTER = it->second * (it->first > 0 ? 1 : -1); int MASTER = it->second * (it->first > 0 ? 1 : -1);
ge->setMeshMaster(MASTER); ge->setMeshMaster(MASTER);
} }
} }
for (std::map<int,int>::iterator it = _geo_internals->periodicFaces.begin(); for(std::map<int,int>::iterator it = _geo_internals->periodicFaces.begin();
it != _geo_internals->periodicFaces.end(); ++it){ it != _geo_internals->periodicFaces.end(); ++it){
GFace *gf = getFaceByTag(abs(it->first)); GFace *gf = getFaceByTag(abs(it->first));
if (gf)gf->setMeshMaster(it->second * (it->first > 0 ? 1 : -1)); if (gf)gf->setMeshMaster(it->second * (it->first > 0 ? 1 : -1));
} }
for(eiter it = firstEdge() ; it != lastEdge() ; ++it){
for (eiter it = firstEdge() ; it != lastEdge() ; ++it){
int meshMaster = (*it)->meshMaster(); int meshMaster = (*it)->meshMaster();
if (meshMaster != (*it)->tag()){ if (meshMaster != (*it)->tag()){
GEdge *ge_master = getEdgeByTag(abs(meshMaster)); GEdge *ge_master = getEdgeByTag(abs(meshMaster));
if(ge_master)(*it)->getBeginVertex()->setMeshMaster ( (meshMaster > 0) ? ge_master->getBeginVertex()->tag() : ge_master->getEndVertex()->tag()); if(ge_master)
if(ge_master)(*it)->getEndVertex()->setMeshMaster ( (meshMaster < 0) ? ge_master->getBeginVertex()->tag() : ge_master->getEndVertex()->tag()); (*it)->getBeginVertex()->setMeshMaster((meshMaster > 0) ? ge_master->getBeginVertex()->tag() :
ge_master->getEndVertex()->tag());
if(ge_master)
(*it)->getEndVertex()->setMeshMaster((meshMaster < 0) ? ge_master->getBeginVertex()->tag() :
ge_master->getEndVertex()->tag());
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment