~ubuntu-branches/ubuntu/karmic/gmsh/karmic

« back to all changes in this revision

Viewing changes to Geo/GEdge.h

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Daniel Leidert
  • Date: 2008-05-18 12:46:05 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080518124605-716xqbqeo07o497k
Tags: 2.2.0-2
[Christophe Prud'homme]
* Bug fix: "gmsh ships no .desktop", thanks to Vassilis Pandis (Closes:
  #375770). Applied the Ubuntu patch.

[Daniel Leidert]
* debian/control (Vcs-Svn): Fixed.
  (Build-Depends): Use texlive instead of tetex-bin.
* debian/gmsh.doc-base (Section): Fixed accordingly to doc-base (>= 0.8.10).
* debian/rules: Removed some variable declarations, that lead to double
  configuration and seem to be useless.
  (build/gmsh): Try to avoid multiple runs by using a stamp.
  (orig-tarball): Renamed to get-orig-source and changed to use uscan.
* debian/watch: Added.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef _GEDGE_H_
2
2
#define _GEDGE_H_
3
3
 
4
 
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 
4
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
5
5
//
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
19
19
// USA.
20
 
// 
 
20
//
21
21
// Please report all bugs and problems to <gmsh@geuz.org>.
22
22
 
23
23
#include "GEntity.h"
25
25
#include "SVector3.h"
26
26
#include "SPoint3.h"
27
27
#include "SPoint2.h"
28
 
#include "MElement.h"
29
 
#include "ExtrudeParams.h"
 
28
 
 
29
class MElement;
 
30
class MLine;
 
31
class ExtrudeParams;
30
32
 
31
33
// A model edge.
32
34
class GEdge : public GEntity {
44
46
 
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;
49
49
 
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);
54
52
 
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; }
57
55
 
58
56
  // The bounding box
59
57
  SBoundingBox3d bounds() const;
60
58
 
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; }
63
61
 
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;
69
67
 
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; }
72
70
 
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;
75
73
 
76
74
  // Get first derivative of edge at the given parameter.
77
75
  virtual SVector3 firstDer(double par) const = 0;
78
76
 
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;
83
81
 
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;
86
84
 
87
85
  // Recompute the mesh partitions defined on this edge.
88
86
  void recomputeMeshPartitions();
91
89
  void deleteMeshPartitions();
92
90
 
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; }
95
93
 
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; }
98
96
 
99
97
  // Returns a type-specific additional information string
100
98
  virtual std::string getAdditionalInfoString();
101
99
 
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; }
104
102
 
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);
108
107
 
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; }
 
110
 
 
111
  // True if start == end and no more than 2 segments
 
112
  bool isMeshDegenerated() const{ return (v0 == v1 && mesh_vertices.size() < 2); }
 
113
 
 
114
  // Get number of elements in the mesh and get element by index
 
115
  unsigned int getNumMeshElements();
 
116
  MElement *getMeshElement(unsigned int index);
111
117
 
112
118
  // Resets the mesh attributes to default values
113
119
  virtual void resetMeshAttributes();
114
120
 
 
121
  // True if entity is periodic in the "dim" direction.
 
122
  virtual bool periodic(int dim) const { return v0 == v1 ; }
 
123
 
115
124
  struct {
116
 
    char   Method;
 
125
    char Method;
117
126
    double coeffTransfinite;
118
127
    double meshSize;
119
 
    int    nbPointsTransfinite;
120
 
    int    typeTransfinite;
 
128
    int nbPointsTransfinite;
 
129
    int typeTransfinite;
 
130
    int minimumMeshSegments;
121
131
    // the extrusion parameters (if any)
122
132
    ExtrudeParams *extrude;
123
133
  } meshAttributes ;