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

*** empty log message ***

parent ff508f3e
No related branches found
No related tags found
No related merge requests found
...@@ -54,3 +54,11 @@ void GEdge::recomputeMeshPartitions() ...@@ -54,3 +54,11 @@ void GEdge::recomputeMeshPartitions()
if(part) model()->getMeshPartitions().insert(part); if(part) model()->getMeshPartitions().insert(part);
} }
} }
std::string GEdge::getAdditionalInfoString()
{
if(!v0 || !v1) return std::string("");
char tmp[256];
sprintf(tmp, "{%d,%d}", v0->tag(), v1->tag());
return std::string(tmp);
}
...@@ -67,13 +67,7 @@ class GEdge : public GEntity { ...@@ -67,13 +67,7 @@ class GEdge : public GEntity {
virtual int minimumMeshSegments () const {return 1;} virtual int minimumMeshSegments () const {return 1;}
virtual int minimumDrawSegments () const {return 1;} virtual int minimumDrawSegments () const {return 1;}
virtual std::string getAdditionalInfoString() virtual std::string getAdditionalInfoString();
{
if(!v0 || !v1) return "";
char tmp[256];
sprintf(tmp, "{%d,%d}", v0->tag(), v1->tag());
return std::string(tmp);
}
}; };
#endif #endif
#include "GEntity.h"
std::string GEntity::getInfoString()
{
char str[256];
sprintf(str, "%s %d", getTypeString().c_str(), tag());
std::string info = getAdditionalInfoString();
if(info.size()){
strcat(str, " ");
strcat(str, info.c_str());
}
if(physicals.size()){
char str2[256] = " [";
for(unsigned int i = 0; i < physicals.size(); i++){
char str3[256];
sprintf(str3, "%d", physicals[i]);
if(i) strcat(str2, " ");
strcat(str2, str3);
}
strcat(str2, "]");
strcat(str, str2);
}
return std::string(str);
}
...@@ -145,28 +145,7 @@ class GEntity { ...@@ -145,28 +145,7 @@ class GEntity {
virtual MRep *meshRep(){ return _mesh; } virtual MRep *meshRep(){ return _mesh; }
// Returns an information string for the entity // Returns an information string for the entity
virtual std::string getInfoString() virtual std::string getInfoString();
{
char str[256];
sprintf(str, "%s %d", getTypeString().c_str(), tag());
std::string info = getAdditionalInfoString();
if(info.size()){
strcat(str, " ");
strcat(str, info.c_str());
}
if(physicals.size()){
char str2[256] = " [";
for(unsigned int i = 0; i < physicals.size(); i++){
char str3[256];
sprintf(str3, "%d", physicals[i]);
if(i) strcat(str2, " ");
strcat(str2, str3);
}
strcat(str2, "]");
strcat(str, str2);
}
return std::string(str);
}
// Returns a type-specific additional information string // Returns a type-specific additional information string
virtual std::string getAdditionalInfoString() { return std::string(""); } virtual std::string getAdditionalInfoString() { return std::string(""); }
......
...@@ -10,3 +10,17 @@ void GVertex::delEdge(GEdge *e) ...@@ -10,3 +10,17 @@ void GVertex::delEdge(GEdge *e)
{ {
l_edges.erase(std::find(l_edges.begin(), l_edges.end(), e)); l_edges.erase(std::find(l_edges.begin(), l_edges.end(), e));
} }
std::string GVertex::getAdditionalInfoString()
{
char str[256];
sprintf(str, "{%g,%g,%g", x(), y(), z());
double lc = prescribedMeshSizeAtVertex();
if(lc > 0.){
char str2[256];
sprintf(str2, ",%g", lc);
strcat(str, str2);
}
strcat(str, "}");
return std::string(str);
}
...@@ -8,7 +8,10 @@ ...@@ -8,7 +8,10 @@
// A model vertex // A model vertex
class GVertex : public GEntity class GVertex : public GEntity
{ {
public: protected:
std::list<GEdge*> l_edges;
public:
GVertex(GModel *m, int tag) : GEntity (m, tag) GVertex(GModel *m, int tag) : GEntity (m, tag)
{ {
} }
...@@ -27,22 +30,7 @@ public: ...@@ -27,22 +30,7 @@ public:
virtual GeomType geomType() const {return Point;} virtual GeomType geomType() const {return Point;}
virtual double prescribedMeshSizeAtVertex() const {return 0;} virtual double prescribedMeshSizeAtVertex() const {return 0;}
virtual SBoundingBox3d bounds(){ return SBoundingBox3d(SPoint3(x(), y(), z())); } virtual SBoundingBox3d bounds(){ return SBoundingBox3d(SPoint3(x(), y(), z())); }
virtual std::string getAdditionalInfoString() virtual std::string getAdditionalInfoString();
{
char str[256];
sprintf(str, "{%g,%g,%g", x(), y(), z());
double lc = prescribedMeshSizeAtVertex();
if(lc > 0.){
char str2[256];
sprintf(str2, ",%g", lc);
strcat(str, str2);
}
strcat(str, "}");
return std::string(str);
}
protected:
std::list<GEdge*> l_edges;
}; };
#endif #endif
......
# $Id: Makefile,v 1.89 2006-08-13 02:46:53 geuzaine Exp $ # $Id: Makefile,v 1.90 2006-08-13 03:23:44 geuzaine Exp $
# #
# Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle # Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
# #
...@@ -37,6 +37,7 @@ SRC = CAD.cpp \ ...@@ -37,6 +37,7 @@ SRC = CAD.cpp \
ExtrudeParams.cpp \ ExtrudeParams.cpp \
Geo.cpp \ Geo.cpp \
GeoUtils.cpp \ GeoUtils.cpp \
GEntity.cpp\
GVertex.cpp\ GVertex.cpp\
GEdge.cpp\ GEdge.cpp\
GFace.cpp\ GFace.cpp\
...@@ -125,6 +126,9 @@ GeoUtils.o: GeoUtils.cpp ../Common/Gmsh.h ../Common/Message.h \ ...@@ -125,6 +126,9 @@ GeoUtils.o: GeoUtils.cpp ../Common/Gmsh.h ../Common/Message.h \
../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h ExtrudeParams.h \ ../Mesh/Simplex.h ../Mesh/Mesh.h ../Mesh/Matrix.h ExtrudeParams.h \
../Numeric/Numeric.h ../Numeric/Numeric.h
# 1 "/Users/geuzaine/.gmsh/Geo//" # 1 "/Users/geuzaine/.gmsh/Geo//"
GEntity.o: GEntity.cpp GEntity.h Range.h SPoint3.h SBoundingBox3d.h \
MVertex.h ../Common/GmshDefines.h
# 1 "/Users/geuzaine/.gmsh/Geo//"
GVertex.o: GVertex.cpp GVertex.h GEntity.h Range.h SPoint3.h \ GVertex.o: GVertex.cpp GVertex.h GEntity.h Range.h SPoint3.h \
SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h GPoint.h SBoundingBox3d.h MVertex.h ../Common/GmshDefines.h GPoint.h
# 1 "/Users/geuzaine/.gmsh/Geo//" # 1 "/Users/geuzaine/.gmsh/Geo//"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment