Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes
curve_rep Class Reference

#include <curve.hpp>

Inheritance diagram for curve_rep:
Inheritance graph
[legend]
Collaboration diagram for curve_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 curve_rep ()
virtual ~curve_rep ()
virtual int nr_components ()
virtual point evaluate (double t)=0
array< pointrectify (double eps)
virtual void rectify_cumul (array< point > &a, double eps)=0
virtual double bound (double t, double eps)=0
virtual point grad (double t, bool &error)=0
virtual double curvature (double t1, double t2)=0
virtual int get_control_points (array< double > &abs, array< point > &pts, array< path > &cip)
virtual array< double > find_closest_points (double t1, double t2, point p, double eps)
virtual double find_closest_point (double t1, double t2, point p, double eps, bool &found)

Public Attributes

int ref_count

Detailed Description

Definition at line 16 of file curve.hpp.


Constructor & Destructor Documentation

curve_rep::curve_rep ( ) [inline]

Definition at line 18 of file curve.hpp.

{}
virtual curve_rep::~curve_rep ( ) [inline, virtual]

Definition at line 19 of file curve.hpp.

{}

Member Function Documentation

double curve_rep::bound ( double  t,
double  eps 
) [pure virtual]

Implemented in transformed_curve_rep, inverted_curve_rep, compound_curve_rep, arc_rep, spline_rep, poly_segment_rep, and segment_rep.

Definition at line 33 of file curve.cpp.

                                      {
  //TODO: Improve this, as soon as the curvature ()
  //      for transformed_curves will be implemented
  bool b;
  double ng= norm (grad (t, b));
  if (ng <= 1.0e-12)
    return tm_infinity;
  double delta= eps / ng;
  while (delta >= 1.0e-6) {
    point val1 = evaluate (t);
    point val2 = evaluate (max (t-delta, 0.0));
    point val3 = evaluate (min (t+delta, 1.0));
    if (norm (val2 - val1) <= eps+1.0e-6 &&
       norm (val3 - val1) <= eps+1.0e-6)
      return delta;
    delta /= 2.0;
  }
  return delta;
}

Here is the call graph for this function:

virtual double curve_rep::curvature ( double  t1,
double  t2 
) [pure virtual]
virtual point curve_rep::evaluate ( double  t) [pure virtual]

Implemented in transformed_curve_rep, inverted_curve_rep, compound_curve_rep, arc_rep, spline_rep, poly_segment_rep, and segment_rep.

Here is the caller graph for this function:

double curve_rep::find_closest_point ( double  t1,
double  t2,
point  p,
double  eps,
bool &  found 
) [virtual]

Definition at line 138 of file curve.cpp.

{
  array<double> res= find_closest_points (t1, t2, p, eps);
  found= N(res)>0;
  if (found)
    return res[0];
  else
    return -1;
}

Here is the call graph for this function:

array< double > curve_rep::find_closest_points ( double  t1,
double  t2,
point  p,
double  eps 
) [virtual]

Definition at line 125 of file curve.cpp.

{
  array<curvet> res= curvet_closest_points (curve (this), t1, t2, p, eps);
  merge_sort_leq <curvet, less_eq_curvet> (res);
  array<double> rest= array<double> (N(res));
  int i;
  for (i=0; i<N(res); i++)
    rest[i]= res[i].t;
  return rest;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int curve_rep::get_control_points ( array< double > &  abs,
array< point > &  pts,
array< path > &  cip 
) [virtual]

Reimplemented in transformed_curve_rep, inverted_curve_rep, arc_rep, spline_rep, poly_segment_rep, and segment_rep.

Definition at line 54 of file curve.cpp.

{
  abs= array<double>();
  pts= array<point>();
  cip= array<path>();
  return 0;
}
virtual point curve_rep::grad ( double  t,
bool &  error 
) [pure virtual]

Implemented in transformed_curve_rep, inverted_curve_rep, compound_curve_rep, arc_rep, spline_rep, poly_segment_rep, and segment_rep.

Here is the caller graph for this function:

virtual int curve_rep::nr_components ( ) [inline, virtual]

Reimplemented in transformed_curve_rep, inverted_curve_rep, compound_curve_rep, and poly_segment_rep.

Definition at line 21 of file curve.hpp.

{ return 1; }
array< point > curve_rep::rectify ( double  eps)

Definition at line 25 of file curve.cpp.

                              {
  array<point> a (1);
  a[0]= evaluate (0.0);
  rectify_cumul (a, eps);
  return a;
}

Here is the call graph for this function:

virtual void curve_rep::rectify_cumul ( array< point > &  a,
double  eps 
) [pure virtual]

Implemented in transformed_curve_rep, inverted_curve_rep, compound_curve_rep, arc_rep, spline_rep, poly_segment_rep, and segment_rep.

Here is the caller graph for this function:


Member Data Documentation

int abstract_struct::ref_count [inherited]

Definition at line 142 of file basic.hpp.


The documentation for this class was generated from the following files: