Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes
poly_segment_rep Struct Reference
Inheritance diagram for poly_segment_rep:
Inheritance graph
[legend]
Collaboration diagram for poly_segment_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 poly_segment_rep (array< point > a2, array< path > cip2)
int nr_components ()
point evaluate (double t)
void rectify_cumul (array< point > &cum, double eps)
double bound (double t, double eps)
double curvature (double t1, double t2)
point grad (double t, bool &error)
int get_control_points (array< double > &abs, array< point > &pts, array< path > &cip)
array< pointrectify (double eps)
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

array< pointa
array< pathcip
int n
int ref_count

Detailed Description

Definition at line 281 of file curve.cpp.


Constructor & Destructor Documentation

poly_segment_rep::poly_segment_rep ( array< point a2,
array< path cip2 
) [inline]

Definition at line 285 of file curve.cpp.

                                                      :
    a (a2), cip (cip2), n(N(a)-1) {}

Member Function Documentation

double poly_segment_rep::bound ( double  t,
double  eps 
) [inline, virtual]

Implements curve_rep.

Definition at line 297 of file curve.cpp.

                                      {
    return curve_rep::bound (t, eps);
  }
double poly_segment_rep::curvature ( double  t1,
double  t2 
) [inline, virtual]

Implements curve_rep.

Definition at line 300 of file curve.cpp.

                                          {
    (void) t1; (void) t2;
    return tm_infinity;
  }
point poly_segment_rep::evaluate ( double  t) [inline, virtual]

Implements curve_rep.

Definition at line 288 of file curve.cpp.

                            {
    int i= min ((int) (n*t), n-1);
    return (i+1 - n*t)*a[i] + (n*t - i)*a[i+1];
  }
double curve_rep::find_closest_point ( double  t1,
double  t2,
point  p,
double  eps,
bool &  found 
) [virtual, inherited]

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, inherited]

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 poly_segment_rep::get_control_points ( array< double > &  abs,
array< point > &  pts,
array< path > &  cip 
) [virtual]

Reimplemented from curve_rep.

Definition at line 314 of file curve.cpp.

{
  array<double> u(n+1);
  int i;
  for (i=0; i<n+1; i++)
    u[i]= ((double)i) / (n==0?1:n);
  abs = u;
  pts = a;
  rcip= cip;
  return n+1;
}
point poly_segment_rep::grad ( double  t,
bool &  error 
) [inline, virtual]

Implements curve_rep.

Definition at line 304 of file curve.cpp.

                                     {
    error= false;
    int i= min ((int) (n*t), n-1);
    return n * (a[i+1] - a[i]);
  }
int poly_segment_rep::nr_components ( ) [inline, virtual]

Reimplemented from curve_rep.

Definition at line 287 of file curve.cpp.

{ return n; }
array< point > curve_rep::rectify ( double  eps) [inherited]

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:

void poly_segment_rep::rectify_cumul ( array< point > &  cum,
double  eps 
) [inline, virtual]

Implements curve_rep.

Definition at line 292 of file curve.cpp.

                                                     {
    (void) eps;
    for (int i=0; i<n; i++)
      cum << a[i+1];
  }

Member Data Documentation

Definition at line 282 of file curve.cpp.

Definition at line 283 of file curve.cpp.

Definition at line 284 of file curve.cpp.

int abstract_struct::ref_count [inherited]

Definition at line 142 of file basic.hpp.


The documentation for this struct was generated from the following file: