4
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
4
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
6
6
// This program is free software; you can redistribute it and/or modify
7
7
// it under the terms of the GNU General Public License as published by
17
17
// along with this program; if not, write to the Free Software
18
18
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21
21
// Please report all bugs and problems to <gmsh@geuz.org>.
23
23
#include "GEntity.h"
45
47
void addFace(GFace *f);
46
48
void delFace(GFace *f);
47
/* start==end and no more than 2 segments */
48
bool is_mesh_degenerated() const;
50
50
virtual int dim() const {return 1;}
51
virtual bool periodic(int dim=0) const = 0;
52
virtual bool continuous(int dim=0) const = 0;
53
51
virtual void setVisibility(char val, bool recursive=false);
55
/** True if the edge is a seam for the given face. */
56
virtual int isSeam(GFace *face) const {return 0;}
53
// True if the edge is a seam for the given face.
54
virtual int isSeam(GFace *face) const { return 0; }
58
56
// The bounding box
59
57
SBoundingBox3d bounds() const;
61
59
// Faces that bound this entity or that this entity bounds.
62
virtual std::list<GFace*> faces() const{return l_faces;}
60
virtual std::list<GFace*> faces() const { return l_faces; }
64
62
// Get the parameter location for a point in space on the edge.
65
63
virtual double parFromPoint(const SPoint3 &) const = 0;
68
66
virtual GPoint point(double p) const = 0;
70
68
// Get the closest point on the edge to the given point.
71
virtual GPoint closestPoint(const SPoint3 & queryPoint) =0;
69
virtual GPoint closestPoint(const SPoint3 & queryPoint) const { throw; }
73
71
// True if the edge contains the given parameter.
74
virtual int containsParam(double pt) const = 0;
72
virtual int containsParam(double pt) const;
76
74
// Get first derivative of edge at the given parameter.
77
75
virtual SVector3 firstDer(double par) const = 0;
79
77
// Get second derivative of edge at the given parameter.
80
78
// Default implentation using central differences
81
virtual SVector3 secondDer(double par) const ;
82
virtual double curvature (double par) const;
79
virtual SVector3 secondDer(double par) const;
80
virtual double curvature(double par) const;
84
82
// Reparmaterize the point onto the given face.
85
virtual SPoint2 reparamOnFace(GFace *face, double epar,int dir) const ;
83
virtual SPoint2 reparamOnFace(GFace *face, double epar,int dir) const;
87
85
// Recompute the mesh partitions defined on this edge.
88
86
void recomputeMeshPartitions();
91
89
void deleteMeshPartitions();
93
91
// Returns the minimum number of segments used for meshing the edge
94
virtual int minimumMeshSegments() const {return 1;}
92
virtual int minimumMeshSegments() const { return 1; }
96
94
// Returns the minimum number of segments used for drawing the edge
97
virtual int minimumDrawSegments() const {return 1;}
95
virtual int minimumDrawSegments() const { return 1; }
99
97
// Returns a type-specific additional information string
100
98
virtual std::string getAdditionalInfoString();
102
100
// tells if the edge is a 3D edge (in opposition with a trimmed curve on a surface)
103
virtual bool is3D() const {return true;}
101
virtual bool is3D() const { return true; }
105
103
// the length of the model edge
106
inline double length() const {return _length;}
107
inline void setLength(const double l) {_length = l;}
104
inline double length() const { return _length; }
105
inline void setLength(const double l) { _length = l; }
106
double length(const double &u0, const double &u1, const int nbQuadPoints = 4);
109
108
// one can impose the mesh size at an edge
110
virtual double prescribedMeshSizeAtVertex() const {return meshAttributes.meshSize;}
109
virtual double prescribedMeshSizeAtVertex() const { return meshAttributes.meshSize; }
111
// True if start == end and no more than 2 segments
112
bool isMeshDegenerated() const{ return (v0 == v1 && mesh_vertices.size() < 2); }
114
// Get number of elements in the mesh and get element by index
115
unsigned int getNumMeshElements();
116
MElement *getMeshElement(unsigned int index);
112
118
// Resets the mesh attributes to default values
113
119
virtual void resetMeshAttributes();
121
// True if entity is periodic in the "dim" direction.
122
virtual bool periodic(int dim) const { return v0 == v1 ; }
117
126
double coeffTransfinite;
119
int nbPointsTransfinite;
128
int nbPointsTransfinite;
130
int minimumMeshSegments;
121
131
// the extrusion parameters (if any)
122
132
ExtrudeParams *extrude;
123
133
} meshAttributes ;