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

add resetMeshAttributes

parent 349b5642
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
GVertex::GVertex(GModel *m, int tag, double ms) : GEntity(m, tag), meshSize(ms) GVertex::GVertex(GModel *m, int tag, double ms) : GEntity(m, tag), meshSize(ms)
{ {
resetMeshAttributes();
} }
GVertex::~GVertex() GVertex::~GVertex()
...@@ -30,6 +31,11 @@ void GVertex::deleteMesh() ...@@ -30,6 +31,11 @@ void GVertex::deleteMesh()
model()->destroyMeshCaches(); model()->destroyMeshCaches();
} }
void GVertex::resetMeshAttributes()
{
meshSize = MAX_LC;
}
void GVertex::setPosition(GPoint &p) void GVertex::setPosition(GPoint &p)
{ {
Msg::Error("Cannot set position of this kind of vertex"); Msg::Error("Cannot set position of this kind of vertex");
......
...@@ -33,6 +33,9 @@ class GVertex : public GEntity ...@@ -33,6 +33,9 @@ class GVertex : public GEntity
// delete mesh data // delete mesh data
virtual void deleteMesh(); virtual void deleteMesh();
// reset the mesh attributes to default values
virtual void resetMeshAttributes();
// get/set the coordinates of the vertex // get/set the coordinates of the vertex
virtual GPoint point() const = 0; virtual GPoint point() const = 0;
virtual double x() const = 0; virtual double x() const = 0;
......
...@@ -17,6 +17,11 @@ gmshVertex::gmshVertex(GModel *m, Vertex *_v) ...@@ -17,6 +17,11 @@ gmshVertex::gmshVertex(GModel *m, Vertex *_v)
{ {
} }
void gmshVertex::resetMeshAttributes()
{
meshSize = v->lc;
}
void gmshVertex::setPosition(GPoint &p) void gmshVertex::setPosition(GPoint &p)
{ {
v->Pos.X = p.x(); v->Pos.X = p.x();
...@@ -42,8 +47,6 @@ SPoint2 gmshVertex::reparamOnFace(const GFace *face, int dir) const ...@@ -42,8 +47,6 @@ SPoint2 gmshVertex::reparamOnFace(const GFace *face, int dir) const
Surface *s = (Surface*)face->getNativePtr(); Surface *s = (Surface*)face->getNativePtr();
// printf("coucou HERE I AM %d\n",s->Typ);
if(s->geometry){ if(s->geometry){
// It is not always right if it is periodic. // It is not always right if it is periodic.
if(l_edges.size() == 1 && if(l_edges.size() == 1 &&
...@@ -95,7 +98,6 @@ SPoint2 gmshVertex::reparamOnFace(const GFace *face, int dir) const ...@@ -95,7 +98,6 @@ SPoint2 gmshVertex::reparamOnFace(const GFace *face, int dir) const
return SPoint2(U, V); return SPoint2(U, V);
} }
else if(s->Typ == MSH_SURF_TRIC){ else if(s->Typ == MSH_SURF_TRIC){
// printf("coucou HERE I AM TRIC\n");
Curve *C[3]; Curve *C[3];
for(int i = 0; i < 3; i++) for(int i = 0; i < 3; i++)
List_Read(s->Generatrices, i, &C[i]); List_Read(s->Generatrices, i, &C[i]);
...@@ -125,7 +127,6 @@ SPoint2 gmshVertex::reparamOnFace(const GFace *face, int dir) const ...@@ -125,7 +127,6 @@ SPoint2 gmshVertex::reparamOnFace(const GFace *face, int dir) const
Msg::Info("Reparameterizing point %d on face %d", v->Num, s->Num); Msg::Info("Reparameterizing point %d on face %d", v->Num, s->Num);
return GVertex::reparamOnFace(face, dir); return GVertex::reparamOnFace(face, dir);
} }
// printf("coucou1 %g %g\n",U,V);
return SPoint2(U, V); return SPoint2(U, V);
} }
else{ else{
......
...@@ -16,6 +16,7 @@ class gmshVertex : public GVertex { ...@@ -16,6 +16,7 @@ class gmshVertex : public GVertex {
public: public:
gmshVertex(GModel *m, Vertex *_v); gmshVertex(GModel *m, Vertex *_v);
virtual ~gmshVertex() {} virtual ~gmshVertex() {}
virtual void resetMeshAttributes();
virtual GPoint point() const virtual GPoint point() const
{ {
return GPoint(v->Pos.X, v->Pos.Y, v->Pos.Z, this); return GPoint(v->Pos.X, v->Pos.Y, v->Pos.Z, this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment