1public:
 2  inline curve_rep () {}
 3  inline virtual ~curve_rep () {}
 4
 5  inline virtual int nr_components () { return 1; }
 6  // the number of components of the curve is useful for getting
 7  // nice parameterizations when concatenating curves
 8
 9  virtual point evaluate (double t)= 0;
10  // gives a point on the curve for its intrinsic parameterization
11  // curves are parameterized from 0.0 to 1.0
12
13  array<point> rectify (double eps);
14  // returns a rectification of the curve, which, modulo reparameterization
15  // has a uniform distance of at most 'eps' to the original curve
16
17  virtual void rectify_cumul (array<point>& a, double eps)= 0;
18  // add rectification of the curve  (except for the starting point)
19  // to an existing polysegment
20
21  /*
22  NOTE: more routines should be added later so that one
23  can reliably compute the intersections between curves
24  One might for instance take the following:
25  */
26  virtual double bound (double t, double eps)= 0;
27  // return delta such that |t' - t| < delta => |c(t') - c(t)| < eps.
28
29  virtual point grad (double t, bool& error)= 0;
30  // compute the first derivative at t.
31  // set error= true if this derivative does not exist.
32
33  virtual double curvature (double t1, double t2)= 0;
34  // compute a bound for the second derivative between t1 and t2.
35  /* FIXME: What is computed is *really* a bound for the curvature,
36       not for the norm of the second derivative. Make it precise
37       what it is that is computed exactly. */
38  // return a very large number if such a bound does not exist.
39
40  // returns the number of control points which belong to the curve.
41  // these control points are ordered and come first in pts & cips.
42  virtual int get_control_points (array<double>& abs, array<point>& pts,
43                                  array<path>& cip);
44
45  virtual array<double> find_closest_points (double t1, double t2, point p,
46                                             double eps);
47
48  virtual double find_closest_point (double t1, double t2, point p, double eps,
49                                     bool& found);