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

*** empty log message ***

parent 3bac9963
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,19 @@ GEdge::~GEdge() ...@@ -38,6 +38,19 @@ GEdge::~GEdge()
lines.clear(); lines.clear();
} }
SBoundingBox3d GEdge::bounds() const
{
Range<double> tr = parBounds(0);
SBoundingBox3d bbox;
const int N = 10;
for(int i = 0; i < N; i++){
double t = tr.low() + (double)i/(double)(N - 1) * (tr.high() - tr.low());
GPoint p = point(t);
bbox += SPoint3(p.x(), p.y(), p.z());
}
return bbox;
}
void GEdge::setVisibility(char val, bool recursive) void GEdge::setVisibility(char val, bool recursive)
{ {
GEntity::setVisibility(val); GEntity::setVisibility(val);
......
...@@ -33,6 +33,9 @@ class GEdge : public GEntity { ...@@ -33,6 +33,9 @@ class GEdge : public GEntity {
virtual bool continuous(int dim=0) const = 0; virtual bool continuous(int dim=0) const = 0;
virtual void setVisibility(char val, bool recursive=false); virtual void setVisibility(char val, bool recursive=false);
// The bounding box
SBoundingBox3d bounds() const;
// Get the parameter location for a point in space on the edge. // Get the parameter location for a point in space on the edge.
virtual double parFromPoint(const SPoint3 &) const = 0; virtual double parFromPoint(const SPoint3 &) const = 0;
......
...@@ -135,12 +135,16 @@ class GEntity { ...@@ -135,12 +135,16 @@ class GEntity {
// The bounding box // The bounding box
virtual SBoundingBox3d bounds() const{throw;} virtual SBoundingBox3d bounds() const{throw;}
// Get/set the visibility flag // Get the visibility flag
virtual char getVisibility(){ return _visible; } virtual char getVisibility(){ return _visible; }
// Set the visibility flag
virtual void setVisibility(char val, bool recursive=false){ _visible = val; } virtual void setVisibility(char val, bool recursive=false){ _visible = val; }
// Get/set the multi-purpose flag // Get the multi-purpose flag
virtual char getFlag(){ return _flag; } virtual char getFlag(){ return _flag; }
// Set the multi-purpose flag
virtual void setFlag(char val){ _flag = val; } virtual void setFlag(char val){ _flag = val; }
// Returns an information string for the entity // Returns an information string for the entity
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "GPoint.h" #include "GPoint.h"
// A model vertex // A model vertex
class GVertex : public GEntity class GVertex : public GEntity
{ {
protected: protected:
std::list<GEdge*> l_edges; std::list<GEdge*> l_edges;
......
...@@ -28,18 +28,6 @@ Range<double> gmshEdge::parBounds(int i) const ...@@ -28,18 +28,6 @@ Range<double> gmshEdge::parBounds(int i) const
return(Range<double>(c->ubeg, c->uend)); return(Range<double>(c->ubeg, c->uend));
} }
SBoundingBox3d gmshEdge::bounds() const
{
SBoundingBox3d bbox;
const int N = 10;
for(int i = 0; i < N; i++){
double u = c->ubeg + (double)i/(double)(N - 1) * (c->uend - c->ubeg);
Vertex a = InterpolateCurve(c, u, 0);
bbox += SPoint3(a.Pos.X, a.Pos.Y, a.Pos.Z);
}
return bbox;
}
GPoint gmshEdge::point(double par) const GPoint gmshEdge::point(double par) const
{ {
Vertex a = InterpolateCurve(c, par, 0); Vertex a = InterpolateCurve(c, par, 0);
......
...@@ -16,12 +16,11 @@ class gmshEdge : public GEdge { ...@@ -16,12 +16,11 @@ class gmshEdge : public GEdge {
gmshEdge(GModel *model, int num); gmshEdge(GModel *model, int num);
virtual ~gmshEdge() {} virtual ~gmshEdge() {}
double period() const { throw ; } double period() const { throw ; }
Range<double> parBounds(int i) const;
virtual bool periodic(int dim=0) const { return false; } virtual bool periodic(int dim=0) const { return false; }
virtual Range<double> parBounds(int i) const;
virtual GeomType geomType() const; virtual GeomType geomType() const;
virtual bool degenerate(int) const { return false; } virtual bool degenerate(int) const { return false; }
virtual bool continuous(int dim) const { return true; } virtual bool continuous(int dim) const { return true; }
SBoundingBox3d bounds() const;
virtual GPoint point(double p) const; virtual GPoint point(double p) const;
virtual GPoint closestPoint(const SPoint3 & queryPoint); virtual GPoint closestPoint(const SPoint3 & queryPoint);
virtual int containsPoint(const SPoint3 &pt) const { throw; } virtual int containsPoint(const SPoint3 &pt) const { throw; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment