Back to index

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

#include <GfxState.h>

Collaboration diagram for GfxPath:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 GfxPath ()
 ~GfxPath ()
GfxPathcopy ()
GBool isCurPt ()
GBool isPath ()
int getNumSubpaths ()
GfxSubpathgetSubpath (int i)
double getLastX ()
double getLastY ()
void moveTo (double x, double y)
void lineTo (double x, double y)
void curveTo (double x1, double y1, double x2, double y2, double x3, double y3)
void close ()
void append (GfxPath *path)
void offset (double dx, double dy)

Private Member Functions

 GfxPath (GBool justMoved1, double firstX1, double firstY1, GfxSubpath **subpaths1, int n1, int size1)

Private Attributes

GBool justMoved
double firstX
double firstY
GfxSubpath ** subpaths
int n
int size

Detailed Description

Definition at line 790 of file GfxState.h.


Constructor & Destructor Documentation

Definition at line 2270 of file GfxState.cc.

                 {
  justMoved = gFalse;
  size = 16;
  n = 0;
  firstX = firstY = 0;
  subpaths = (GfxSubpath **)gmalloc(size * sizeof(GfxSubpath *));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 2278 of file GfxState.cc.

                  {
  int i;

  for (i = 0; i < n; ++i)
    delete subpaths[i];
  gfree(subpaths);
}

Here is the call graph for this function:

GfxPath::GfxPath ( GBool  justMoved1,
double  firstX1,
double  firstY1,
GfxSubpath **  subpaths1,
int  n1,
int  size1 
) [private]

Definition at line 2287 of file GfxState.cc.

                                                          {
  int i;

  justMoved = justMoved1;
  firstX = firstX1;
  firstY = firstY1;
  size = size1;
  n = n1;
  subpaths = (GfxSubpath **)gmalloc(size * sizeof(GfxSubpath *));
  for (i = 0; i < n; ++i)
    subpaths[i] = subpaths1[i]->copy();
}

Here is the call graph for this function:


Member Function Documentation

Definition at line 2352 of file GfxState.cc.

                                  {
  int i;

  if (n + path->n > size) {
    size = n + path->n;
    subpaths = (GfxSubpath **)
                 grealloc(subpaths, size * sizeof(GfxSubpath *));
  }
  for (i = 0; i < path->n; ++i) {
    subpaths[n++] = path->subpaths[i]->copy();
  }
  justMoved = gFalse;
}

Here is the call graph for this function:

Definition at line 2336 of file GfxState.cc.

                    {
  // this is necessary to handle the pathological case of
  // moveto/closepath/clip, which defines an empty clipping region
  if (justMoved) {
    if (n >= size) {
      size += 16;
      subpaths = (GfxSubpath **)
                  grealloc(subpaths, size * sizeof(GfxSubpath *));
    }
    subpaths[n] = new GfxSubpath(firstX, firstY);
    ++n;
    justMoved = gFalse;
  }
  subpaths[n-1]->close();
}

Here is the call graph for this function:

GfxPath* GfxPath::copy ( ) [inline]

Definition at line 800 of file GfxState.h.

    { return new GfxPath(justMoved, firstX, firstY, subpaths, n, size); }

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 2321 of file GfxState.cc.

                                  {
  if (justMoved) {
    if (n >= size) {
      size += 16;
      subpaths = (GfxSubpath **)
                  grealloc(subpaths, size * sizeof(GfxSubpath *));
    }
    subpaths[n] = new GfxSubpath(firstX, firstY);
    ++n;
    justMoved = gFalse;
  }
  subpaths[n-1]->curveTo(x1, y1, x2, y2, x3, y3);
}

Here is the call graph for this function:

double GfxPath::getLastX ( ) [inline]

Definition at line 814 of file GfxState.h.

{ return subpaths[n-1]->getLastX(); }

Here is the call graph for this function:

double GfxPath::getLastY ( ) [inline]

Definition at line 815 of file GfxState.h.

{ return subpaths[n-1]->getLastY(); }

Here is the call graph for this function:

Definition at line 810 of file GfxState.h.

{ return n; }

Definition at line 811 of file GfxState.h.

{ return subpaths[i]; }
GBool GfxPath::isCurPt ( ) [inline]

Definition at line 804 of file GfxState.h.

{ return n > 0 || justMoved; }
GBool GfxPath::isPath ( ) [inline]

Definition at line 807 of file GfxState.h.

{ return n > 0; }
void GfxPath::lineTo ( double  x,
double  y 
)

Definition at line 2307 of file GfxState.cc.

                                       {
  if (justMoved) {
    if (n >= size) {
      size += 16;
      subpaths = (GfxSubpath **)
                  grealloc(subpaths, size * sizeof(GfxSubpath *));
    }
    subpaths[n] = new GfxSubpath(firstX, firstY);
    ++n;
    justMoved = gFalse;
  }
  subpaths[n-1]->lineTo(x, y);
}

Here is the call graph for this function:

void GfxPath::moveTo ( double  x,
double  y 
)

Definition at line 2301 of file GfxState.cc.

                                       {
  justMoved = gTrue;
  firstX = x;
  firstY = y;
}
void GfxPath::offset ( double  dx,
double  dy 
)

Definition at line 2366 of file GfxState.cc.

                                         {
  int i;

  for (i = 0; i < n; ++i) {
    subpaths[i]->offset(dx, dy);
  }
}

Here is the call graph for this function:


Member Data Documentation

double GfxPath::firstX [private]

Definition at line 839 of file GfxState.h.

double GfxPath::firstY [private]

Definition at line 839 of file GfxState.h.

Definition at line 838 of file GfxState.h.

int GfxPath::n [private]

Definition at line 841 of file GfxState.h.

int GfxPath::size [private]

Definition at line 842 of file GfxState.h.

Definition at line 840 of file GfxState.h.


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