Back to index

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

List of all members.

Public Member Functions

 compound_curve_rep (curve c1b, curve c2b)
int nr_components ()
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)
array< pointrectify (double eps)
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

curve c1
curve c2
int n1
int n2
int ref_count

Detailed Description

Definition at line 806 of file curve.cpp.


Constructor & Destructor Documentation

compound_curve_rep::compound_curve_rep ( curve  c1b,
curve  c2b 
) [inline]

Definition at line 809 of file curve.cpp.

                                           :
    c1 (c1b), c2 (c2b), n1 (c1->nr_components()), n2 (c2->nr_components()) {}

Member Function Documentation

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

Implements curve_rep.

Definition at line 820 of file curve.cpp.

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

Implements curve_rep.

Definition at line 828 of file curve.cpp.

                                          {
    return max (c1->curvature (t1, t2), c2->curvature (t1, t2));
  }
point compound_curve_rep::evaluate ( double  t) [inline, virtual]

Implements curve_rep.

Definition at line 812 of file curve.cpp.

                            {
    double n= n1+n2;
    if (t <= n1/n) return c1 (t*n/n1);
    else return c2 (t*n/n2 - n1); }
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 curve_rep::get_control_points ( array< double > &  abs,
array< point > &  pts,
array< path > &  cip 
) [virtual, inherited]

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;
}
point compound_curve_rep::grad ( double  t,
bool &  error 
) [inline, virtual]

Implements curve_rep.

Definition at line 823 of file curve.cpp.

                                     {
    double n= n1+n2;
    if (t <= n1/n) return (n * c1->grad ((t*n)/n1, error)) / n1;
    else return (n * c2->grad ((t*n)/n2 - n1, error)) / n2;
  }
int compound_curve_rep::nr_components ( ) [inline, virtual]

Reimplemented from curve_rep.

Definition at line 811 of file curve.cpp.

{ return n1 + n2; }
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 compound_curve_rep::rectify_cumul ( array< point > &  a,
double  eps 
) [inline, virtual]

Implements curve_rep.

Definition at line 816 of file curve.cpp.

                                                   {
    c1->rectify_cumul (a, eps);
    c2->rectify_cumul (a, eps);
  }

Member Data Documentation

Definition at line 807 of file curve.cpp.

Definition at line 807 of file curve.cpp.

Definition at line 808 of file curve.cpp.

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