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

*** empty log message ***

parent 366a865e
No related branches found
No related tags found
No related merge requests found
// $Id: Geo.cpp,v 1.52 2006-08-05 10:05:45 geuzaine Exp $
// $Id: Geo.cpp,v 1.53 2006-08-12 18:05:14 geuzaine Exp $
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
......@@ -100,8 +100,7 @@ void add_infile(char *text, char *fich)
fprintf(file, "%s\n", text);
fclose(file);
if(GMODEL) delete GMODEL;
GMODEL = new gmshModel;
GMODEL->import();
}
void coherence(char *fich)
......
......@@ -10,30 +10,33 @@
extern Mesh *THEM;
gmshModel::gmshModel()
: GModel("noname")
{
import();
}
void gmshModel::import()
{
std::set<Vertex*> points;
if(Tree_Nbr(THEM->Points)) {
List_T *points = Tree2List(THEM->Points);
for(int i = 0; i < List_Nbr(points); i++){
Vertex *p;
List_Read(points, i, &p);
if(!vertexByTag(p->Num)){
gmshVertex *v = new gmshVertex(this, p);
v->setVisibility(p->Visible);
add(v);
}
}
List_Delete(points);
}
if(Tree_Nbr(THEM->Curves)) {
List_T *curves = Tree2List(THEM->Curves);
for(int i = 0; i < List_Nbr(curves); i++){
Curve *c;
List_Read(curves, i, &c);
if(c->Num >= 0 && c->beg && c->end){
if(!vertexByTag(c->beg->Num) && points.find(c->beg) == points.end()){
points.insert(c->beg);
if(!vertexByTag(c->beg->Num)){
gmshVertex *v = new gmshVertex(this, c->beg);
v->setVisibility(c->beg->Visible);
add(v);
}
if(!vertexByTag(c->end->Num) && points.find(c->end) == points.end()){
points.insert(c->end);
if(!vertexByTag(c->end->Num)){
gmshVertex *v = new gmshVertex(this, c->end);
v->setVisibility(c->beg->Visible);
add(v);
......@@ -94,7 +97,7 @@ void gmshModel::import()
}
}
Msg(DEBUG, "gmshModel Created");
Msg(DEBUG, "gmshModel:");
Msg(DEBUG, "%d Vertices", vertices.size());
Msg(DEBUG, "%d Edges", edges.size());
Msg(DEBUG, "%d Faces", faces.size());
......
......@@ -5,8 +5,8 @@
class gmshModel : public GModel {
public:
gmshModel();
virtual ~gmshModel() {};
gmshModel() : GModel("empty") {}
virtual ~gmshModel(){};
// import data from the old Gmsh database ("THEM")
virtual void import();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment