diff --git a/Geo/GEntity.h b/Geo/GEntity.h index cf185bb9151314e686b2cbaee76e56543a3d93bd..e2bcddd3cdd75874ff094cce312c5c7f3f6a1860 100644 --- a/Geo/GEntity.h +++ b/Geo/GEntity.h @@ -1,22 +1,48 @@ #ifndef H_GEntity #define H_GEntity +#include "Range.h" +#include "SPoint3.h" +#include <list> + class GModel; -class MeshRep; +class GVertex; +class GEdge; +class GFace; +class GRegion; +//class MeshRep; /** A geometric model entity. All enitites are owned by a GModel. */ class GEntity { - int tag; - GModel *model; - DiscreteRep *mesh, *modelMesh; + int _tag; + GModel *_model; + // DiscreteRep *mesh, *modelMesh; public: - GEntity(GModel *model, int tag); + + enum GeomType{ + Unknown, + Point, + Line, + Circle, + Ellipse, + ParametricCurve, + Plane, + Nurb, + Cylinder, + Sphere, + Cone, + Torus, + ParametricSurface, + ThreeDimVolume + }; + + GEntity(GModel *m, int t) : _model(m),_tag(t){} virtual ~GEntity(); /** Return a renderable representation of the entity.*/ - virtual MeshRep * getGeometry() ; + // virtual MeshRep * getGeometry() ; /** Return a mesh of the entity */ - virtual MeshRep * getMesh() ; + // virtual MeshRep * getMesh() ; /// Spatial dimension of the entity. virtual int dim() const = 0; @@ -40,16 +66,16 @@ public: virtual GeomType geomType() const = 0; /// True if parametric space is continuous in the "dim" direction. - virtual bool continuous(int dim) const; + virtual bool continuous(int dim) const {return true;} /// True if entity is periodic in the "dim" direction. - virtual bool periodic(int dim) const; + virtual bool periodic(int dim) const {return false;} /// True if there are parametric degeneracies in the "dim" direction. - virtual bool degenerate(int dim) const; + virtual bool degenerate(int dim) const {return false;} /// Orientation of the parametric space w.r.t. the entity. - virtual int geomDirection() const; + // virtual int geomDirection() const; /// Parametric bounds of the entity in the "i" direction. virtual Range<double> parBounds(int i) const; @@ -64,7 +90,10 @@ public: virtual void * getNativePtr() const= 0; /// The model owning this entity. - GModel *model() const; + GModel *model() const {return _model;} + // The tag of the entity + int tag () const {return _tag;} + }; diff --git a/Geo/GFace.h b/Geo/GFace.h index 4913ca6de011c4ae2c64e6c26b8a30e0edc2011f..3dd55887cd6f23d325df797501724c49d6afec7d 100644 --- a/Geo/GFace.h +++ b/Geo/GFace.h @@ -58,6 +58,7 @@ public: /* true if the surface underlying the face is periodic and we need to worry about that. */ virtual bool surfPeriodic(int dim) const = 0; + virtual int inClosure(GEntity *ent) const {throw;} protected: }; diff --git a/Geo/GRegion.h b/Geo/GRegion.h index 8e7f06ae1d48d4cef51bf398d57cd51d79b9757d..0320a16f29c9932434eccda126ece5f29de29926 100644 --- a/Geo/GRegion.h +++ b/Geo/GRegion.h @@ -11,6 +11,8 @@ public: GRegion(GModel *model, int tag) : GEntity (model,tag) {} virtual ~GRegion(); virtual int dim() const {return 3;} + virtual int inClosure(GEntity *ent) const {throw;} + virtual GeomType geomType() const {return ThreeDimVolume;} }; #endif diff --git a/Geo/GVertex.h b/Geo/GVertex.h index a04de813884b5a99972f89bd22ff6f144d1e3dfd..8bca9d3268c5bbae4186f370670c2ff413c63a5b 100644 --- a/Geo/GVertex.h +++ b/Geo/GVertex.h @@ -13,6 +13,10 @@ public: virtual GPoint point() const = 0; void addEdge ( GEdge *e ); void delEdge ( GEdge *e ); + virtual int dim() const {return 0;} + virtual int inClosure(GEntity *ent) const {throw;} + virtual GeomType geomType() const {return Point;} + protected: std::list<GEdge*> l_edges; }; diff --git a/Geo/Makefile b/Geo/Makefile index 2eeadbb998d2a7df41d4c246da046393a92cd34b..166801cddc6123423af89c53660900f5cb07cf60 100644 --- a/Geo/Makefile +++ b/Geo/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.74 2006-03-10 06:39:46 geuzaine Exp $ +# $Id: Makefile,v 1.75 2006-07-09 15:22:57 remacle Exp $ # # Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle # @@ -38,6 +38,11 @@ SRC = CAD.cpp \ ExtrudeParams.cpp \ Geo.cpp \ GeoUtils.cpp \ + GVertex.cpp\ + GEdge.cpp\ + GFace.cpp\ + GRegion.cpp\ + GModel.cpp\ gmshModel.cpp\ gmshEdge.cpp\ gmshFace.cpp\ diff --git a/Geo/gmshDefs.h b/Geo/gmshDefs.h deleted file mode 100644 index 51ae88548cacff67352512b85ebac6b26ed37ee0..0000000000000000000000000000000000000000 --- a/Geo/gmshDefs.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef _H_GMSH_DEFS_ -#define _H_GMSH_DEFS_ -#ifdef _HAVE_SGMODEL_ -#include "SGModel.h" -#include "GVPoint.h" -#include "GEPoint.h" -#include "GFPoint.h" -#include "Pair.h" -#else -#include "SPoint2.h" -class GRegion; -class GFace; -class GEdge; -class GVertex; -class SGModel { - public: - SGModel ( const char * ){} - void add(GRegion *r){} - void add(GFace *f){} - void add(GEdge *e){} - void add(GVertex *v){} -}; - -class GeoRep { -}; - -struct GVPoint -{ - double X,Y,Z; - GVPoint (double _x, double _y, double _z, const GVertex *v):X(_x),Y(_y),Z(_z){}; -}; -struct GEPoint -{ - double X,Y,Z; - GEPoint (double _x, double _y, double _z, const GEdge *e, double par):X(_x),Y(_y),Z(_z){}; -}; -struct GFPoint -{ - double X,Y,Z; - GFPoint (double _x, double _y, double _z, - const GFace *e, const SPoint2 & par):X(_x),Y(_y),Z(_z){}; -}; - - -class Logical{ -public: - enum Value{ - False = 0, - True, - Unknown - }; -}; - -class GeomType{ -public: - enum Value{ - Unknown, - Point, - Line, - Circle, - Ellipse, - ParametricCurve, - Plane, - Nurb, - Cylinder, - Sphere, - Cone, - Torus, - ParametricSurface - }; -}; -#endif -#endif diff --git a/Geo/gmshEdge.cpp b/Geo/gmshEdge.cpp index 1af5aed73aff5407a03b8d19402ef962142ef9d6..418ed46d833e33529d9b02a631a10d7b89d17f34 100644 --- a/Geo/gmshEdge.cpp +++ b/Geo/gmshEdge.cpp @@ -4,7 +4,7 @@ #include "CAD.h" #include "Geo.h" -gmshEdge::gmshEdge(SGModel *model,Curve *edge,GVertex *v1,GVertex *v2) +gmshEdge::gmshEdge(GModel *model,Curve *edge,GVertex *v1,GVertex *v2) : GEdge ( model, edge->Num, v1, v2 ), c(edge) {} @@ -47,13 +47,13 @@ SBoundingBox3d gmshEdge::bounds() const return bbox; } -GEPoint gmshEdge::point(double par) const +GPoint gmshEdge::point(double par) const { Vertex a = InterpolateCurve(c, par, 0); - return GEPoint(a.Pos.X,a.Pos.Y,a.Pos.Z,this,par); + return GPoint(a.Pos.X,a.Pos.Y,a.Pos.Z,this,par); } -GEPoint gmshEdge::closestPoint(const SPoint3 & qp) +GPoint gmshEdge::closestPoint(const SPoint3 & qp) { Vertex v; Vertex a; @@ -62,7 +62,7 @@ GEPoint gmshEdge::closestPoint(const SPoint3 & qp) v.Pos.Y = qp.y(); v.Pos.Z = qp.z(); ProjectPointOnCurve (c,&v,&a,&der); - return GEPoint(a.Pos.X,a.Pos.Y,a.Pos.Z,this,a.u); + return GPoint(a.Pos.X,a.Pos.Y,a.Pos.Z,this,a.u); } int gmshEdge::containsParam(double pt) const @@ -89,19 +89,19 @@ double gmshEdge::parFromPoint(const SPoint3 &pt) const return a.u; } -Logical::Value gmshEdge::continuous(int) const +bool gmshEdge::continuous(int) const { - return Logical::True; + return true; } -Logical::Value gmshEdge::degenerate(int) const +bool gmshEdge::degenerate(int) const { - return Logical::False; + return false; } -Logical::Value gmshEdge::periodic(int dim) const +bool gmshEdge::periodic(int dim) const { - return Logical::False; + return false; } int gmshEdge::isSeam(GFace *face) const @@ -115,21 +115,21 @@ double gmshEdge::period() const return 0; } -GeomType::Value gmshEdge::geomType() const +GEntity::GeomType gmshEdge::geomType() const { switch (c->Typ) { - case MSH_SEGM_LINE : return GeomType::Line; - case MSH_SEGM_PARAMETRIC : return GeomType::ParametricCurve; + case MSH_SEGM_LINE : return Line; + case MSH_SEGM_PARAMETRIC : return ParametricCurve; case MSH_SEGM_CIRC : - case MSH_SEGM_CIRC_INV : return GeomType::Circle; + case MSH_SEGM_CIRC_INV : return Circle; case MSH_SEGM_ELLI: - case MSH_SEGM_ELLI_INV: return GeomType::Ellipse; + case MSH_SEGM_ELLI_INV: return Ellipse; case MSH_SEGM_BSPLN: case MSH_SEGM_BEZIER: case MSH_SEGM_NURBS: - case MSH_SEGM_SPLN: return GeomType::Nurb; - default : return GeomType::Unknown; + case MSH_SEGM_SPLN: return Nurb; + default : return Unknown; } } diff --git a/Geo/gmshEdge.h b/Geo/gmshEdge.h index 4fad122b002c0a7b0389b3379a50c6a5bf77154c..3e0164344d0a59048a6eb22ad779039bb9f2ad76 100644 --- a/Geo/gmshEdge.h +++ b/Geo/gmshEdge.h @@ -1,37 +1,27 @@ #ifndef _H_GMSH_EDGE_ #define _H_GMSH_EDGE_ -#include "gmshDefs.h" +#include "GEdge.h" #include "gmshModel.h" #include "gmshVertex.h" #include "Mesh.h" #include "Range.h" -#ifdef _HAVE_SGMODEL_ -#include "GEdge.h" -#else -class GEdge { - public: - GEdge (SGModel *model, int tag, GVertex *v0, GVertex *v1) - {}; -}; -#endif - class gmshEdge : public GEdge{ public: - gmshEdge(SGModel *model,Curve *edge,GVertex *v1,GVertex *v2); + gmshEdge(GModel *model,Curve *edge,GVertex *v1,GVertex *v2); virtual ~gmshEdge(); int isSeam(GFace *face) const; double period() const; Range<double> parBounds(int i) const; - virtual Logical::Value periodic(int dim=0) const; - virtual GeomType::Value geomType() const; - virtual Logical::Value degenerate(int) const; - virtual Logical::Value continuous(int dim) const; + virtual bool periodic(int dim=0) const; + virtual GeomType geomType() const; + virtual bool degenerate(int) const; + virtual bool continuous(int dim) const; // Geometric Ops SBoundingBox3d bounds() const; - virtual GEPoint point(double p) const; - virtual GEPoint closestPoint(const SPoint3 & queryPoint); + virtual GPoint point(double p) const; + virtual GPoint closestPoint(const SPoint3 & queryPoint); virtual int containsPoint(const SPoint3 &pt) const; virtual int containsParam(double pt) const; virtual SVector3 firstDer(double par) const; @@ -45,13 +35,7 @@ public: void * getNativePtr() const; virtual GVertex * split(double par); Curve *c; - virtual GeoRep * geometry() {return 0;} -#ifdef _HAVE_SGMODEL_ - virtual SSList<GEPoint> intersect(int fAxis, double fPar, GFace *f) - { - throw; - } -#endif + // virtual GeoRep * geometry() {return 0;} virtual double parFromPoint(const SPoint3 &pt) const; protected: }; diff --git a/Geo/gmshFace.cpp b/Geo/gmshFace.cpp index a0ebc47efcb4dd133e591e99742c056ad0995731..6c5c4e5522fe98413138857b943a6a46d4abfb23 100644 --- a/Geo/gmshFace.cpp +++ b/Geo/gmshFace.cpp @@ -58,18 +58,19 @@ double * gmshFace::nthDerivative(const SPoint2 ¶m, int n, double *array) con throw; } -GFPoint gmshFace::point(const SPoint2 &pt) const +GPoint gmshFace::point(const SPoint2 &pt) const { return point(pt.x(),pt.y()); } -GFPoint gmshFace::point(double par1,double par2) const +GPoint gmshFace::point(double par1,double par2) const { + double pp[2]={par1,par2}; Vertex v = InterpolateSurface( s, par1, par2,0,0); - return GFPoint(v.Pos.X,v.Pos.Y,v.Pos.Z,this,SPoint2(par1,par2)); + return GPoint(v.Pos.X,v.Pos.Y,v.Pos.Z,this,pp); } -GFPoint gmshFace::closestPoint(const SPoint3 & qp) +GPoint gmshFace::closestPoint(const SPoint3 & qp) { Vertex v; @@ -79,8 +80,8 @@ GFPoint gmshFace::closestPoint(const SPoint3 & qp) if ( s->Typ != MSH_SURF_PLAN ) ProjectPointOnSurface(s, v); - return GFPoint(v.Pos.X,v.Pos.Y,v.Pos.Z, - this,SPoint2(v.us[0],v.us[1])); + return GPoint(v.Pos.X,v.Pos.Y,v.Pos.Z, + this,v.us); } int gmshFace::containsParam(const SPoint2 &pt) const @@ -109,32 +110,32 @@ SPoint2 gmshFace::parFromPoint(const SPoint3 &qp) const GeoRep * gmshFace::geometry() { return new gmshGeoRep(this,2); } */ -Logical::Value gmshFace::continuous(int dim) const +bool gmshFace::continuous(int dim) const { - return Logical::True; + return true; } -Logical::Value gmshFace::periodic(int dim) const +bool gmshFace::periodic(int dim) const { - return Logical::False; + return false; } -Logical::Value gmshFace::degenerate(int dim) const +bool gmshFace::degenerate(int dim) const { - return Logical::False; + return false; } -GeomType::Value gmshFace::geomType() const +GEntity::GeomType gmshFace::geomType() const { int type; type = s->Typ; //if(type == CONE_TYPE) //return GeomType::Cone; if(type == MSH_SURF_NURBS) - return GeomType::Nurb; + return Nurb; if(type == MSH_SURF_PLAN) - return GeomType::Plane; - return GeomType::Unknown; + return Plane; + return Unknown; } diff --git a/Geo/gmshFace.h b/Geo/gmshFace.h index 887f1fe9602e16aae9258ebecfac9dd02366c34d..7404e3e6d0e22af22854c4b0f6682a8ab6ec555a 100644 --- a/Geo/gmshFace.h +++ b/Geo/gmshFace.h @@ -1,63 +1,47 @@ #ifndef _H_GMSH_FACE_ #define _H_GMSH_FACE_ -#include "gmshDefs.h" +#include "GFace.h" #include "gmshModel.h" #include "gmshVertex.h" #include "Mesh.h" #include "Range.h" -#ifdef _HAVE_SGMODEL_ -#include "GFace.h" -static SSList<GEdge*> e; -static SSList<int> d; -#else -class GFace { - public: - GFace () - {}; -}; -#endif - class gmshFace : public GFace { public: -#ifdef _HAVE_SGMODEL_ - gmshFace(SGModel *m,Surface * face):GFace (m,face->Num,e,d), s(face){} -#else - gmshFace(SGModel *m,Surface * face): s(face){} -#endif - virtual ~gmshFace(){} - Range<double> parBounds(int i) const; - virtual int paramDegeneracies(int dir, double *par); - - virtual SBoundingBox3d bounds() const; - virtual GFPoint point(double par1, double par2) const; - virtual GFPoint point(const SPoint2 &pt) const; - virtual GFPoint closestPoint(const SPoint3 & queryPoint); - - virtual int containsPoint(const SPoint3 &pt) const; - virtual int containsParam(const SPoint2 &pt) const; - - virtual SVector3 normal(const SPoint2 ¶m) const; - virtual Pair<SVector3,SVector3> firstDer(const SPoint2 ¶m) const; - virtual double * nthDerivative(const SPoint2 ¶m, int n, + gmshFace(GModel *m,Surface * face):GFace (m,face->Num), s(face){} + virtual ~gmshFace(){} + Range<double> parBounds(int i) const; + virtual int paramDegeneracies(int dir, double *par); + + virtual SBoundingBox3d bounds() const; + virtual GPoint point(double par1, double par2) const; + virtual GPoint point(const SPoint2 &pt) const; + virtual GPoint closestPoint(const SPoint3 & queryPoint); + + virtual int containsPoint(const SPoint3 &pt) const; + virtual int containsParam(const SPoint2 &pt) const; + + virtual SVector3 normal(const SPoint2 ¶m) const; + virtual Pair<SVector3,SVector3> firstDer(const SPoint2 ¶m) const; + virtual double * nthDerivative(const SPoint2 ¶m, int n, double *array) const; - - virtual GeomType::Value geomType() const; - virtual int geomDirection() const; - - virtual Logical::Value continuous(int dim) const; - virtual Logical::Value periodic(int dim) const; - virtual Logical::Value degenerate(int dim) const; - virtual double period(int dir) const; // 200306 - virtual double tolerance() const; - virtual GeoRep * geometry() {return 0;} - void * getNativePtr() const; - Surface *s; - virtual Logical::Value surfPeriodic(int dim) const - {throw;} - virtual SPoint2 parFromPoint(const SPoint3 &) const; + + virtual GEntity::GeomType geomType() const; + virtual int geomDirection() const; + + virtual bool continuous(int dim) const; + virtual bool periodic(int dim) const; + virtual bool degenerate(int dim) const; + virtual double period(int dir) const; // 200306 + virtual double tolerance() const; + // virtual GeoRep * geometry() {return 0;} + void * getNativePtr() const; + Surface *s; + virtual bool surfPeriodic(int dim) const + {throw;} + virtual SPoint2 parFromPoint(const SPoint3 &) const; protected: }; diff --git a/Geo/gmshModel.cpp b/Geo/gmshModel.cpp index 452c385e6750c97e33ac8d5593218cf72330f828..325aaa32c9708de2f70706c86acb8b89076c7f85 100644 --- a/Geo/gmshModel.cpp +++ b/Geo/gmshModel.cpp @@ -4,45 +4,8 @@ #include "Message.h" extern Mesh *THEM; -GFace * gmshModel::faceByTag(int n) const -{ - std::list<GFace*>:: const_iterator it = faces.begin(); - std::list<GFace*>:: const_iterator end = faces.end(); - while (it != end) - { - gmshFace *ff = (gmshFace*) (*it); - if ( ff->s->Num == n)return *it; - ++it; - } - return 0; -} - -GEdge * gmshModel::edgeByTag(int n) const -{ - std::list<GEdge*>:: const_iterator it = edges.begin(); - std::list<GEdge*>:: const_iterator end = edges.end(); - while (it != end) - { - gmshEdge *ee = (gmshEdge*) (*it); - if ( ee->c->Num == n)return *it; - ++it; - } - return 0; -} -GVertex * gmshModel::vertexByTag(int n) const -{ - std::list<GVertex*>:: const_iterator it = vertices.begin(); - std::list<GVertex*>:: const_iterator end = vertices.end(); - while (it != end) - { - gmshVertex *vv = (gmshVertex*) (*it); - if ( vv->v->Num == n)return *it; - ++it; - } - return 0; -} gmshModel::gmshModel(char *geofile) - : SGModel ( "toto" ) + : GModel ( geofile ) { if (geofile) { @@ -62,20 +25,20 @@ gmshModel::gmshModel(char *geofile) { points.insert(c->beg); gmshVertex *v = new gmshVertex ( this, c->beg ); - vertices.push_back(v); + //vertices.push_back(v); add(v); } if (points.find(c->end) == points.end()) { points.insert(c->end); gmshVertex *v = new gmshVertex ( this , c->end ); - vertices.push_back(v); + //vertices.push_back(v); add(v); } gmshEdge *e = new gmshEdge ( this, c , vertexByTag(c->beg->Num), vertexByTag(c->end->Num) ); - edges.push_back(e); + // edges.push_back(e); add(e); } } @@ -87,7 +50,7 @@ gmshModel::gmshModel(char *geofile) Surface *s; List_Read(surfaces, i, &s); gmshFace *f = new gmshFace ( this, s ); - faces.push_back(f); + // faces.push_back(f); add ( f); } List_Delete(surfaces); @@ -98,7 +61,7 @@ gmshModel::gmshModel(char *geofile) Volume *v; List_Read(volumes, i, &v); gmshRegion *r = new gmshRegion ( this, v ); - regions.push_back(r); + // regions.push_back(r); add ( r); } List_Delete(volumes); @@ -112,7 +75,7 @@ gmshModel::gmshModel(char *geofile) } -SGModel *createGmshModel (char *f ) +GModel *createGmshModel (char *f ) { return new gmshModel (f); } diff --git a/Geo/gmshModel.h b/Geo/gmshModel.h index 37efe5d9d77ea20e6734f84ab76387e8e3321a95..a1cdfc272a274e0cbd9b9aa3745ee1f7bf2d751f 100644 --- a/Geo/gmshModel.h +++ b/Geo/gmshModel.h @@ -2,7 +2,6 @@ #define _H_GMSH_MODEL_ #include <list> -#include "gmshDefs.h" #include "Mesh.h" #include "Range.h" #include "Pair.h" @@ -14,9 +13,10 @@ #include "gmshFace.h" #include "gmshEdge.h" #include "gmshRegion.h" +#include "GModel.h" -class gmshModel : public SGModel { +class gmshModel : public GModel { public: gmshModel(char *geofile = 0); virtual ~gmshModel() {}; diff --git a/Geo/gmshRegion.h b/Geo/gmshRegion.h index 71e34f11f214b4d0467f752e7043f4dc863eafc7..6cf7cd457f01932a22cacea36991c59c0a5cd4ab 100644 --- a/Geo/gmshRegion.h +++ b/Geo/gmshRegion.h @@ -3,29 +3,22 @@ #include "Mesh.h" #include "gmshModel.h" -#ifdef _HAVE_SGMODEL_ #include "GRegion.h" -#else -class GRegion { - public: - GRegion(SGModel *m, int tag){} -}; -#endif class gmshRegion : public GRegion { public: - gmshRegion(SGModel *m, Volume *_v) + gmshRegion(GModel *m, Volume *_v) : GRegion(m, _v->Num), v(_v) { } virtual ~gmshRegion() {} - virtual GeoRep * geometry(){return 0;} + // virtual GeoRep * geometry(){return 0;} virtual double tolerance() const {return 1.e-14;} - void * getNativePtr() {return v;} + void * getNativePtr() const {return v;} Volume *v; protected: diff --git a/Geo/gmshVertex.h b/Geo/gmshVertex.h index 1ce3e566626a69950b825a73781a366c3d839406..e581fb7a1b81bdf0caa8592701e73436ea42fe70 100644 --- a/Geo/gmshVertex.h +++ b/Geo/gmshVertex.h @@ -3,29 +3,18 @@ #include "Mesh.h" #include "gmshModel.h" - -#ifdef _HAVE_SGMODEL_ #include "GVertex.h" -#else -class GVertex { - public: - GVertex(SGModel *m, int tag){} -}; -#endif class gmshVertex : public GVertex { public: - gmshVertex(SGModel *m, Vertex *_v) : GVertex(m, _v->Num), v(_v){} + gmshVertex(GModel *m, Vertex *_v) : GVertex(m, _v->Num), v(_v){} virtual ~gmshVertex() {} - virtual GVPoint point() const + virtual GPoint point() const { - return GVPoint ( v->Pos.X,v->Pos.Y,v->Pos.Z, this); + return GPoint ( v->Pos.X,v->Pos.Y,v->Pos.Z,this); } - virtual GeoRep * geometry() {return 0;} - virtual double tolerance() const {return 1.e-14;} - void * getNativePtr() const {return v;} Vertex *v; protected: