Back to index

tetex-bin  3.0
Public Member Functions | Private Member Functions | Private Attributes
GfxSubpath Class Reference

#include <GfxState.h>

List of all members.

Public Member Functions

 GfxSubpath (double x1, double y1)
 ~GfxSubpath ()
GfxSubpathcopy ()
int getNumPoints ()
double getX (int i)
double getY (int i)
GBool getCurve (int i)
double getLastX ()
double getLastY ()
void lineTo (double x1, double y1)
void curveTo (double x1, double y1, double x2, double y2, double x3, double y3)
void close ()
GBool isClosed ()
void offset (double dx, double dy)

Private Member Functions

 GfxSubpath (GfxSubpath *subpath)

Private Attributes

double * x
double * y
GBoolcurve
int n
int size
GBool closed

Detailed Description

Definition at line 742 of file GfxState.h.


Constructor & Destructor Documentation

GfxSubpath::GfxSubpath ( double  x1,
double  y1 
)

Definition at line 2191 of file GfxState.cc.

                                           {
  size = 16;
  x = (double *)gmalloc(size * sizeof(double));
  y = (double *)gmalloc(size * sizeof(double));
  curve = (GBool *)gmalloc(size * sizeof(GBool));
  n = 1;
  x[0] = x1;
  y[0] = y1;
  curve[0] = gFalse;
  closed = gFalse;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2203 of file GfxState.cc.

                        {
  gfree(x);
  gfree(y);
  gfree(curve);
}

Here is the call graph for this function:

GfxSubpath::GfxSubpath ( GfxSubpath subpath) [private]

Definition at line 2210 of file GfxState.cc.

                                          {
  size = subpath->size;
  n = subpath->n;
  x = (double *)gmalloc(size * sizeof(double));
  y = (double *)gmalloc(size * sizeof(double));
  curve = (GBool *)gmalloc(size * sizeof(GBool));
  memcpy(x, subpath->x, n * sizeof(double));
  memcpy(y, subpath->y, n * sizeof(double));
  memcpy(curve, subpath->curve, n * sizeof(GBool));
  closed = subpath->closed;
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 2254 of file GfxState.cc.

                       {
  if (x[n-1] != x[0] || y[n-1] != y[0]) {
    lineTo(x[0], y[0]);
  }
  closed = gTrue;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 752 of file GfxState.h.

{ return new GfxSubpath(this); }

Here is the call graph for this function:

Here is the caller graph for this function:

void GfxSubpath::curveTo ( double  x1,
double  y1,
double  x2,
double  y2,
double  x3,
double  y3 
)

Definition at line 2235 of file GfxState.cc.

                                            {
  if (n+3 > size) {
    size += 16;
    x = (double *)grealloc(x, size * sizeof(double));
    y = (double *)grealloc(y, size * sizeof(double));
    curve = (GBool *)grealloc(curve, size * sizeof(GBool));
  }
  x[n] = x1;
  y[n] = y1;
  x[n+1] = x2;
  y[n+1] = y2;
  x[n+2] = x3;
  y[n+2] = y3;
  curve[n] = curve[n+1] = gTrue;
  curve[n+2] = gFalse;
  n += 3;
}

Here is the call graph for this function:

Here is the caller graph for this function:

GBool GfxSubpath::getCurve ( int  i) [inline]

Definition at line 758 of file GfxState.h.

{ return curve[i]; }
double GfxSubpath::getLastX ( ) [inline]

Definition at line 761 of file GfxState.h.

{ return x[n-1]; }

Here is the caller graph for this function:

double GfxSubpath::getLastY ( ) [inline]

Definition at line 762 of file GfxState.h.

{ return y[n-1]; }

Here is the caller graph for this function:

Definition at line 755 of file GfxState.h.

{ return n; }

Here is the caller graph for this function:

double GfxSubpath::getX ( int  i) [inline]

Definition at line 756 of file GfxState.h.

{ return x[i]; }

Here is the caller graph for this function:

double GfxSubpath::getY ( int  i) [inline]

Definition at line 757 of file GfxState.h.

{ return y[i]; }

Here is the caller graph for this function:

Definition at line 773 of file GfxState.h.

{ return closed; }
void GfxSubpath::lineTo ( double  x1,
double  y1 
)

Definition at line 2222 of file GfxState.cc.

                                            {
  if (n >= size) {
    size += 16;
    x = (double *)grealloc(x, size * sizeof(double));
    y = (double *)grealloc(y, size * sizeof(double));
    curve = (GBool *)grealloc(curve, size * sizeof(GBool));
  }
  x[n] = x1;
  y[n] = y1;
  curve[n] = gFalse;
  ++n;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void GfxSubpath::offset ( double  dx,
double  dy 
)

Definition at line 2261 of file GfxState.cc.

                                            {
  int i;

  for (i = 0; i < n; ++i) {
    x[i] += dx;
    y[i] += dy;
  }
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 785 of file GfxState.h.

Definition at line 781 of file GfxState.h.

int GfxSubpath::n [private]

Definition at line 783 of file GfxState.h.

int GfxSubpath::size [private]

Definition at line 784 of file GfxState.h.

double* GfxSubpath::x [private]

Definition at line 780 of file GfxState.h.

double * GfxSubpath::y [private]

Definition at line 780 of file GfxState.h.


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