Back to index

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

List of all members.

Public Member Functions

 segment_rep (point p1b, point p2b)
point evaluate (double t)
void rectify_cumul (array< point > &a, double eps)
double bound (double t, double eps)
point grad (double t, bool &error)
double curvature (double t1, double t2)
int get_control_points (array< double > &abs, array< point > &pts, array< path > &cip)
virtual int nr_components ()
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

point p1
point p2
path cip1
path cip2
int ref_count

Detailed Description

Definition at line 232 of file curve.cpp.


Constructor & Destructor Documentation

segment_rep::segment_rep ( point  p1b,
point  p2b 
) [inline]

Definition at line 235 of file curve.cpp.

: p1 (p1b), p2 (p2b) {}

Member Function Documentation

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

Implements curve_rep.

Definition at line 238 of file curve.cpp.

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

Implements curve_rep.

Definition at line 246 of file curve.cpp.

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

Implements curve_rep.

Definition at line 236 of file curve.cpp.

{ return (1.0-t)*p1 + t*p2; }
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 segment_rep::get_control_points ( array< double > &  abs,
array< point > &  pts,
array< path > &  cip 
) [virtual]

Reimplemented from curve_rep.

Definition at line 255 of file curve.cpp.

{
  array<double> u;
  u << 0.0;
  u << 1.0;
  abs= u;
  array<point> a;
  a << p1;
  a << p2;
  pts= a;
  cip= array<path> ();
  cip << cip1;
  cip << cip2;
  return 2;
}
point segment_rep::grad ( double  t,
bool &  error 
) [inline, virtual]

Implements curve_rep.

Definition at line 241 of file curve.cpp.

                                     {
    (void) t;
    error= false;
    return p2 - p1;
  }
virtual int curve_rep::nr_components ( ) [inline, virtual, inherited]

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) [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 segment_rep::rectify_cumul ( array< point > &  a,
double  eps 
) [inline, virtual]

Implements curve_rep.

Definition at line 237 of file curve.cpp.

{ (void) eps; a << p2; }

Member Data Documentation

Definition at line 234 of file curve.cpp.

Definition at line 234 of file curve.cpp.

Definition at line 233 of file curve.cpp.

Definition at line 233 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: