Back to index

plt-scheme  4.2.1
Public Member Functions | Public Attributes
os_wxPath Class Reference
Inheritance diagram for os_wxPath:
Inheritance graph
[legend]
Collaboration diagram for os_wxPath:
Collaboration graph
[legend]

List of all members.

Public Member Functions

os_wxPath CONSTRUCTOR_ARGS (())
 ~os_wxPath ()
void Reset ()
Bool IsOpen ()
void Close ()
void MoveTo (double x, double y)
void LineTo (double x, double y)
void Arc (double x, double y, double w, double h, double start, double end, Bool ccw)
void CurveTo (double x1, double y1, double x2, double y2, double x3, double y3)
void Rectangle (double x, double y, double width, double height)
void RoundedRectangle (double x, double y, double width, double height, double radius=20.0)
void Ellipse (double x, double y, double width, double height)
void Lines (int n, wxPoint points[], double xoffset=0, double yoffset=0)
void Translate (double x, double y)
void Scale (double x, double y)
void Rotate (double a)
void Reverse (int start_cmd=0, Bool start_with_line=0)
void AddPath (wxPath *p)
void Install (long target, double dx, double dy, double ox, double oy, double sx, double sy, Bool align, double pox, double poy)
void InstallPS (wxPostScriptDC *dc, wxPSStream *s, double dx, double dy)
int ToPolygons (int **_lens, double ***_pts, double sx, double sy)
void BoundingBox (double *x1, double *y1, double *x2, double *y2)
void install_cleanup ()
voidoperator new (size_t size)
voidoperator new (size_t size, GCPlacement gcp)
voidoperator new (size_t size, void *p)
voidoperator new (size_t size)
voidoperator new (size_t size, GCPlacement gcp)
void operator delete (void *obj)
void operator delete (void *, void *)
void operator delete (void *obj)
voidoperator new[] (size_t size)
voidoperator new[] (size_t size, GCPlacement gcp)
voidoperator new[] (size_t size, void *p)
void operator delete[] (void *obj)
void operator delete[] (void *, void *)

Public Attributes

long cmd_size
long alloc_cmd_size
long last_cmd
double * cmds
int num_polys
double ** poly_pts
WXTYPE __type
void__gc_external

Detailed Description

Definition at line 4399 of file wxs_gdi.cxx.


Constructor & Destructor Documentation

Definition at line 4426 of file wxs_gdi.cxx.

Here is the call graph for this function:


Member Function Documentation

void wxPath::AddPath ( wxPath p) [inherited]

Definition at line 2317 of file Region.cxx.

{
  int i, closed_n;

  if (!IsOpen()) {
    /* Simple case: this path is closed, so just append p */
    MakeRoom(p->cmd_size);
    last_cmd = cmd_size + p->last_cmd;
    for (i = 0; i < p->cmd_size; i++) {
      cmds[cmd_size++] = p->cmds[i];
    }
  } else {
    /* Put closed paths in p on the front of this path,
       and add unclosed paths to this path's unclosed
       path. */
    if (p->IsOpen()) {
      for (i = 0; i < p->cmd_size; i++) {
       if (p->cmds[i] == CMD_CLOSE)
         break;
       else if (cmds[i] == CMD_CURVE)
         i += 7;
       else
         i += 3;
      }
      
      if (i < p->cmd_size) {
       closed_n = i + 1;
      } else {
       closed_n = 0;
      }
    } else {
      /* No open path in p */
      closed_n = p->cmd_size;
    }
    
    MakeRoom(p->cmd_size);
    memmove(cmds + closed_n, cmds, cmd_size * sizeof(double));
    memcpy(cmds, p->cmds, closed_n * sizeof(double));
    if (closed_n  < p->cmd_size) {
      /* There was an open path in p... */
      memcpy(cmds + cmd_size + closed_n, p->cmds + closed_n, (p->cmd_size - closed_n) * sizeof(double));

      /* p's open path must start with CMD_MOVE; change it to CMD_LINE */
      cmds[closed_n + cmd_size] = CMD_LINE;
    
      last_cmd = cmd_size + p->last_cmd;
    } else {
      /* No open path in p, so just adjust last_cmd */
      last_cmd += closed_n;
    }
    cmd_size += p->cmd_size;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void wxPath::Arc ( double  x,
double  y,
double  w,
double  h,
double  start,
double  end,
Bool  ccw 
) [inherited]

Definition at line 1995 of file Region.cxx.

{
  double delta, angle, rotate;
  double x0, y0, x1, y1, x2, y2, x3, y3;
  double xx, xy, yy, yx, xtmp1, ytmp1, xtmp2, ytmp2;
  int did_one = 0, start_cmd = cmd_size, start_open;

  start_open = IsOpen();

  /* The arc below is backwards from the MrEd API.... */
  {
    double s;
    s = start;
    start = end;
    end = s;
  }

  if (ccw) {
    double s;
    s = start;
    start = end;
    end = s;
  }

  delta = end - start;
  if (delta > 2 * wxPI)
    delta = 2 * wxPI;
  else if (delta < 0) {
    delta = fmod(delta, 2 * wxPI);
    delta += 2 * wxPI;
  }

  /* At this point, delta is between 0 and 2pi */
  
  if (delta == 2 * wxPI)
    start = 0;

  /* Change top-left to center: */
  x += w/2;
  y += h/2;

  /* Make up to 4 curves to represent the arc. */
  do {
    if (delta > (wxPI / 2))
      angle = (wxPI / 2);
    else
      angle = delta;

    /* First generate points for an arc
       of `angle' length from -angle/2 to
       +angle/2. */

    x0  = cos(angle / 2);
    y0  = sin(angle / 2);
    x1 = (4 - x0) / 3;
    y1 = ((1 - x0) * (3 - x0)) / (3 * y0);
    x2 = x1;
    y2 = -y1;
    x3 = x0;
    y3 = -y0;
    
    /* Rotate to start: */
    rotate = start + (angle / 2);
    xx = cos(rotate);
    xy = sin(rotate);
    yy = xx;
    yx = -xy;
    ROTATE_XY(x0, y0);
    ROTATE_XY(x1, y1);
    ROTATE_XY(x2, y2);
    ROTATE_XY(x3, y3);

    /* Scale and move to match ellipse: */
    x0 = (x0 * w/2) + x;
    x1 = (x1 * w/2) + x;
    x2 = (x2 * w/2) + x;
    x3 = (x3 * w/2) + x;

    y0 = (y0 * h/2) + y;
    y1 = (y1 * h/2) + y;
    y2 = (y2 * h/2) + y;
    y3 = (y3 * h/2) + y;

    if (!did_one) {
      if (IsOpen()) {
       LineTo(x0, y0);
      } else {
       MoveTo(x0, y0);
      }
    }

    if (angle)
      CurveTo(x1, y1, x2, y2, x3, y3);
    else
      LineTo(x3, y3);
    
    start += angle;
    delta -= angle;
    did_one = 1;
  } while (delta > 0);

  if (!ccw) {
    Reverse(start_cmd, start_open);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void wxPath::BoundingBox ( double *  x1,
double *  y1,
double *  x2,
double *  y2 
) [inherited]

Definition at line 2657 of file Region.cxx.

{
  double x1, x2, y1, y2;
  int i;

  if (cmd_size) {
    /* First command must be move-to: */
    x1 = cmds[1];
    y1 = cmds[2];
    x2 = x1;
    y2 = y1;
    for (i = 3; i < cmd_size; ) {
      if (cmds[i] == CMD_CLOSE) {
       i += 1;
      } else if ((cmds[i] == CMD_MOVE)
               || (cmds[i] == CMD_LINE)) {
       if (cmds[i+1] < x1)
         x1 = cmds[i+1];
       if (cmds[i+1] > x2)
         x2 = cmds[i+1];
       if (cmds[i+2] < y1)
         y1 = cmds[i+2];
       if (cmds[i+2] > y2)
         y2 = cmds[i+2];
       i += 3;
      } else if (cmds[i] == CMD_CURVE) {
       int j;
       for (j = 0; j < 6; j += 2) {
         if (cmds[i+j+1] < x1)
           x1 = cmds[i+j+1];
         if (cmds[i+j+1] > x2)
           x2 = cmds[i+j+1];
         if (cmds[i+j+2] < y1)
           y1 = cmds[i+j+2];
         if (cmds[i+j+2] > y2)
           y2 = cmds[i+j+2];
       }
       i += 7;
      }
    }
  } else {
    x1 = y1 = x2 = y2 = 0.0;
  }

  *_x1 = x1;
  *_x2 = x2;
  *_y1 = y1;
  *_y2 = y2;
}

Here is the caller graph for this function:

void wxPath::Close ( ) [inherited]

Definition at line 1966 of file Region.cxx.

{
  if ((last_cmd > -1) && (cmds[last_cmd] != CMD_CLOSE)) {
    MakeRoom(1);
    last_cmd = cmd_size;
    cmds[cmd_size++] = CMD_CLOSE;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void wxPath::CurveTo ( double  x1,
double  y1,
double  x2,
double  y2,
double  x3,
double  y3 
) [inherited]

Definition at line 2101 of file Region.cxx.

{
  MakeRoom(7);
  last_cmd = cmd_size;
  cmds[cmd_size++] = CMD_CURVE;
  cmds[cmd_size++] = x1;
  cmds[cmd_size++] = y1;
  cmds[cmd_size++] = x2;
  cmds[cmd_size++] = y2;
  cmds[cmd_size++] = x3;
  cmds[cmd_size++] = y3;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void wxPath::Ellipse ( double  x,
double  y,
double  width,
double  height 
) [inherited]

Definition at line 2147 of file Region.cxx.

{
  Close();
  Arc(x, y, width, height, 0, 2 * wxPI, TRUE);
  Close();
}

Here is the call graph for this function:

void wxPath::Install ( long  target,
double  dx,
double  dy,
double  ox,
double  oy,
double  sx,
double  sy,
Bool  align,
double  pox,
double  poy 
) [inherited]

Definition at line 2371 of file Region.cxx.

{
  int i = 0;
  double lx = 0.0, ly = 0.0, lxx = 0.0, lyy = 0.0;

#ifdef WX_USE_CAIRO
  cairo_new_path(CAIRO_DEV);
#endif

  while (i < cmd_size) {
    if (cmds[i] == CMD_CLOSE) {
#ifdef WX_USE_CAIRO
      cairo_close_path(CAIRO_DEV);
#endif
#ifdef wx_mac
      CGPathCloseSubpath(PATHPATH);;
#endif
#ifdef wx_msw
      wxGPathCloseFigure(PATH_GP);
#endif
      i += 1;
    } else if (cmds[i] == CMD_MOVE) {
      double xx, yy;
      xx = (cmds[i+1]+dx) * sx + ox;
      yy = (cmds[i+2]+dy) * sy + oy;
      if (align) {
       xx = floor(xx) + pox;
       yy = floor(yy) + poy;
      }

#ifdef WX_USE_CAIRO
      cairo_move_to(CAIRO_DEV, xx, yy);
#endif
#ifdef wx_mac
      CGPathMoveToPoint(PATHPATH, NULL, xx, yy);
#endif

      lx = cmds[i+1];
      ly = cmds[i+2];
      lxx = xx;
      lyy = yy;

      i += 3;
    } else if (cmds[i] == CMD_LINE) {
      if ((cmds[i+1] != lx) || (cmds[i+2] != ly)) {
       double xx, yy;
       xx = (cmds[i+1]+dx) * sx + ox;
       yy = (cmds[i+2]+dy) * sy + oy;
       if (align) {
         xx = floor(xx) + pox;
         yy = floor(yy) + poy;
       }

#ifdef WX_USE_CAIRO
       cairo_line_to(CAIRO_DEV, xx, yy);
#endif
#ifdef wx_mac
       CGPathAddLineToPoint(PATHPATH, NULL, xx, yy);
#endif
#ifdef wx_msw
       wxGPathAddLine(PATH_GP, lxx, lyy, xx, yy);
#endif

       lx = cmds[i+1];
       ly = cmds[i+2];
       lxx = xx;
       lyy = yy;
      }
      i += 3;
    } else if (cmds[i] == CMD_CURVE) {
      if ((cmds[i+5] != lx) || (cmds[i+6] != ly)) {
       double xx, yy, xx1, yy1, xx2, yy2;
       xx = (cmds[i+5]+dx) * sx + ox;
       yy = (cmds[i+6]+dy) * sy + oy;
       if (align) {
         xx = floor(xx) + pox;
         yy = floor(yy) + poy;
       }

       xx1 = (cmds[i+1]+dx) * sx + ox;
       yy1 = (cmds[i+2]+dy) * sy + oy;
       xx2 = (cmds[i+3]+dx) * sx + ox;
       yy2 = (cmds[i+4]+dy) * sy + oy;

#ifdef WX_USE_CAIRO
       cairo_curve_to(CAIRO_DEV, xx1, yy1, xx2, yy2, xx, yy);
#endif
#ifdef wx_mac
       CGPathAddCurveToPoint(PATHPATH, NULL, xx1, yy1, xx2, yy2, xx, yy);
#endif
#ifdef wx_msw
       wxGPathAddBezier(PATH_GP, lxx, lyy, xx1, yy1, xx2, yy2, xx, yy);
#endif
       lx = cmds[i+5];
       ly = cmds[i+6];
       lxx = xx;
       lyy = yy;
      }
      i += 7;
    }
  }
}

Here is the caller graph for this function:

Definition at line 99 of file wxGC.cxx.

{
  GC_finalization_proc old_fn;
  void *old_data;

# ifdef MZ_PRECISE_GC
#  define ALLOW_NON_BASE 0
#  define CHECK_BASE 0
# else
#  ifdef wx_xt
#   define ALLOW_NON_BASE 0
#   define CHECK_BASE 0
#  else
#   ifdef WIN32
#    define ALLOW_NON_BASE 0
#    define CHECK_BASE 1
#    define CRASH_ON_NONBASE 1
#   else
#    define ALLOW_NON_BASE 1
#    define CHECK_BASE 0
#   endif
#  endif
# endif

# if CHECK_BASE || ALLOW_NON_BASE
  if (GC_base(this) != (void *)this) {
#  if ALLOW_NON_BASE
    return;
#  else
#   ifdef CRASH_ON_NONBASE
    *(long *)0x0 = 1;
#   else
    printf("Clean-up object is not the base object\n");
    abort();
#   endif
#  endif
  }
# endif

  GC_register_finalizer_ignore_self(gcOBJ_TO_PTR(this), 
                                CAST_GCP GC_cleanup, NULL, 
                                CAST_GCPP &old_fn, &old_data);

# if CHECK_BASE
  if (old_fn) {
#  ifdef CRASH_ON_NONBASE
       *(long *)0x0 = 1;
#  else
    printf("Object already has a clean-up\n");
    abort();
#  endif
  }
# endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

void wxPath::InstallPS ( wxPostScriptDC *  dc,
wxPSStream s,
double  dx,
double  dy 
) [inherited]

Definition at line 2476 of file Region.cxx.

{
  int i = 0;

  while (i < cmd_size) {
    if (cmds[i] == CMD_CLOSE) {
      s->Out("closepath\n");
      i += 1;
    } else if ((cmds[i] == CMD_MOVE) 
              || (cmds[i] == CMD_LINE)) {
      double x, y;
      x = dc->FLogicalToDeviceX(cmds[i+1]+ dx);
      y = dc->FLogicalToDeviceY(cmds[i+2]+ dy);
      s->Out(x); s->Out(" "); s->Out(y);
      if (cmds[i] == CMD_LINE)
       s->Out(" lineto\n");
      else
       s->Out(" moveto\n");
      i += 3;
    } else if (cmds[i] == CMD_CURVE) {
      double x1, y1, x2, y2, x3, y3;
      x1 = dc->FLogicalToDeviceX(cmds[i+1] + dx);
      y1 = dc->FLogicalToDeviceY(cmds[i+2] + dy);
      x2 = dc->FLogicalToDeviceX(cmds[i+3] + dx);
      y2 = dc->FLogicalToDeviceY(cmds[i+4] + dy);
      x3 = dc->FLogicalToDeviceX(cmds[i+5] + dx);
      y3 = dc->FLogicalToDeviceY(cmds[i+6] + dy);
      s->Out(x1); s->Out(" "); s->Out(y1); s->Out(" "); 
      s->Out(x2); s->Out(" "); s->Out(y2); s->Out(" "); 
      s->Out(x3); s->Out(" "); s->Out(y3); s->Out(" "); 
      s->Out("curveto\n");
      i += 7;
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool wxPath::IsOpen ( ) [inherited]

Definition at line 1961 of file Region.cxx.

{
  return ((last_cmd > -1) && (cmds[last_cmd] != CMD_CLOSE));
}

Here is the caller graph for this function:

void wxPath::Lines ( int  n,
wxPoint  points[],
double  xoffset = 0,
double  yoffset = 0 
) [inherited]

Definition at line 2154 of file Region.cxx.

{
  int i;
  for (i = 0; i < n; i++) {
    LineTo(points[i].x + xoffset, points[i].y + yoffset);
  }
}

Here is the call graph for this function:

void wxPath::LineTo ( double  x,
double  y 
) [inherited]

Definition at line 1986 of file Region.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void wxPath::MoveTo ( double  x,
double  y 
) [inherited]

Definition at line 1975 of file Region.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

void gc::operator delete ( void obj) [inline, inherited]
void gc::operator delete ( void obj) [inline, inherited]

Definition at line 287 of file gc_cpp.h.

                                           {
    GC_FREE( obj );}

Here is the caller graph for this function:

void gc::operator delete ( void ,
void  
) [inline, inherited]

Definition at line 291 of file gc_cpp.h.

{}
void gc::operator delete[] ( void obj) [inline, inherited]

Definition at line 305 of file gc_cpp.h.

                                             {
    gc::operator delete( obj );}

Here is the call graph for this function:

void gc::operator delete[] ( void ,
void  
) [inline, inherited]

Definition at line 309 of file gc_cpp.h.

{}
void* gc::operator new ( size_t  size) [inline, inherited]
void* gc::operator new ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]
void * gc::operator new ( size_t  size) [inline, inherited]

Definition at line 273 of file gc_cpp.h.

                                           {
    return GC_MALLOC( size );}

Here is the caller graph for this function:

void * gc::operator new ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]

Definition at line 276 of file gc_cpp.h.

                                                            {
    if (gcp == UseGC) 
        return GC_MALLOC( size );
    else if (gcp == PointerFreeGC)
       return GC_MALLOC_ATOMIC( size );
    else
        return GC_MALLOC_UNCOLLECTABLE( size );}
void * gc::operator new ( size_t  size,
void p 
) [inline, inherited]

Definition at line 284 of file gc_cpp.h.

                                                    {
    return p;}
void * gc::operator new[] ( size_t  size) [inline, inherited]

Definition at line 296 of file gc_cpp.h.

                                             {
    return gc::operator new( size );}

Here is the call graph for this function:

void * gc::operator new[] ( size_t  size,
GCPlacement  gcp 
) [inline, inherited]

Definition at line 299 of file gc_cpp.h.

                                                              {
    return gc::operator new( size, gcp );}

Here is the call graph for this function:

void * gc::operator new[] ( size_t  size,
void p 
) [inline, inherited]

Definition at line 302 of file gc_cpp.h.

                                                      {
    return p;}
void wxPath::Rectangle ( double  x,
double  y,
double  width,
double  height 
) [inherited]

Definition at line 2114 of file Region.cxx.

{
  MoveTo(x, y);
  LineTo(x + width, y);
  LineTo(x + width, y + height);
  LineTo(x, y + height);
  Close();
}

Here is the call graph for this function:

void wxPath::Reset ( ) [inherited]

Definition at line 1933 of file Region.cxx.

{
  ClearCache();
  cmd_size = 0;
  alloc_cmd_size = 0;
  cmds = NULL;
  last_cmd = -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void wxPath::Reverse ( int  start_cmd = 0,
Bool  start_with_line = 0 
) [inherited]

Definition at line 2234 of file Region.cxx.

{
  int e, i, j, pos, n, *cs, controls;
  double *a;

  while (start_cmd < cmd_size) {
    /* Find next starting point: */
    if (cmds[start_cmd] == CMD_CLOSE) {
      start_cmd += 1;
    }

    i = start_cmd;
    n = 0;
    while (i < cmd_size) {
      if (cmds[i] == CMD_CLOSE) {
       break;
      } else {
       n++;
       if (cmds[i] == CMD_MOVE) {
         i += 3;
       } else if (cmds[i] == CMD_LINE) {
         i += 3;
       } else if (cmds[i] == CMD_CURVE) {
         i += 7;
       }
      }
    }
    e = i;

    /* Reverse sub-path in [start_cmd, e) */

    a = new WXGC_ATOMIC double[e - start_cmd];
    cs = new WXGC_ATOMIC int[n];

    /* Traverse again to find command starts: */
    n = 0;
    i = start_cmd;
    while (i < e) {
      cs[n++] = i;
      if (cmds[i] == CMD_MOVE) {
       i += 3;
      } else if (cmds[i] == CMD_LINE) {
       i += 3;
      } else if (cmds[i] == CMD_CURVE) {
       i += 7;
      }
    }

    /* Reverse */
    controls = -1;
    pos = 0;
    for (j = n; j--; ) {
      i = cs[j];
      if (!start_with_line && (j == n - 1)) {
       a[pos++] = CMD_MOVE;
      } else if (controls >= 0) {
       a[pos++] = CMD_CURVE;
       a[pos++] = cmds[controls+3];
       a[pos++] = cmds[controls+4];
       a[pos++] = cmds[controls+1];
       a[pos++] = cmds[controls+2];
      } else {
       a[pos++] = CMD_LINE;
      }

      if ((cmds[i] == CMD_MOVE)
         || (cmds[i] == CMD_LINE)) {
       a[pos++] = cmds[i+1];
       a[pos++] = cmds[i+2];
       controls = -1;
      } else if (cmds[i] == CMD_CURVE) {
       a[pos++] = cmds[i+5];
       a[pos++] = cmds[i+6];
       controls = i;
      }
    }

    memcpy(cmds + start_cmd, a, (e - start_cmd) * sizeof(double));

    start_cmd = e;
  }
}

Here is the caller graph for this function:

void wxPath::Rotate ( double  a) [inherited]

Definition at line 2208 of file Region.cxx.

{
  double xx, xy, yy, yx, xtmp1, ytmp1, xtmp2, ytmp2;
  int i = 0;

  xx = cos(a);
  xy = sin(a);
  yy = xx;
  yx = -xy;

  while (i < cmd_size) {
    if (cmds[i] == CMD_CLOSE) {
      i += 1;
    } else if ((cmds[i] == CMD_MOVE)
              || (cmds[i] == CMD_LINE)) {
      ROTATE_XY(cmds[i+1], cmds[i+2]);
      i += 3;
    } else if (cmds[i] == CMD_CURVE) {
      ROTATE_XY(cmds[i+1], cmds[i+2]);
      ROTATE_XY(cmds[i+3], cmds[i+4]);
      ROTATE_XY(cmds[i+5], cmds[i+6]);
      i += 7;
    }
  }
}

Here is the caller graph for this function:

void wxPath::RoundedRectangle ( double  x,
double  y,
double  width,
double  height,
double  radius = 20.0 
) [inherited]

Definition at line 2123 of file Region.cxx.

{
  // A negative radius value is interpreted to mean
  // 'the proportion of the smallest X or Y dimension'
  if (radius < 0.0) {
    double smallest = 0.0;
    if (width < height)
      smallest = width;
    else
      smallest = height;
    radius = (double)(- radius * smallest);
  }
    
  Close();
  Arc(x, y, radius * 2, radius * 2, wxPI, 0.5 * wxPI, FALSE);
  LineTo(x + width - radius, y);
  Arc(x + width - 2 * radius, y, radius * 2, radius * 2, 0.5 * wxPI, 0 * wxPI, FALSE);
  LineTo(x + width, y + height - radius);
  Arc(x + width - 2 * radius, y + height - 2 * radius, 2 * radius, 2 * radius, 0 * wxPI, 1.5 * wxPI, FALSE);
  LineTo(x + radius, y + height);
  Arc(x, y + height - 2 * radius, 2 * radius, 2 * radius, 1.5 * wxPI, 1.0 * wxPI, FALSE);
  Close();
}

Here is the call graph for this function:

void wxPath::Scale ( double  x,
double  y 
) [inherited]

Definition at line 2185 of file Region.cxx.

{
  int i = 0;
  while (i < cmd_size) {
    if (cmds[i] == CMD_CLOSE) {
      i += 1;
    } else if ((cmds[i] == CMD_MOVE)
              || (cmds[i] == CMD_LINE)) {
      cmds[i+1] *= x;
      cmds[i+2] *= y;
      i += 3;
    } else if (cmds[i] == CMD_CURVE) {
      cmds[i+1] *= x;
      cmds[i+2] *= y;
      cmds[i+3] *= x;
      cmds[i+4] *= y;
      cmds[i+5] *= x;
      cmds[i+6] *= y;
      i += 7;
    }
  }
}

Here is the caller graph for this function:

int wxPath::ToPolygons ( int **  _lens,
double ***  _pts,
double  sx,
double  sy 
) [inherited]

Definition at line 2531 of file Region.cxx.

{
  int i, cnt, *lens, len, alloc_len, need_len;
  double lx, ly, **ptss, *pts, *naya;

  cnt = 0;
  for (i = 0; i < cmd_size; ) {
    if (cmds[i] == CMD_CLOSE) {
      cnt++;
      i += 1;
    } else if (cmds[i] == CMD_MOVE) {
      i += 3;
    } else if (cmds[i] == CMD_LINE) {
      i += 3;
    } else if (cmds[i] == CMD_CURVE) {
      i += 7;
    }
  }

  if (IsOpen())
    cnt++;

  ptss = new WXGC_PTRS double*[cnt];
  lens = new WXGC_ATOMIC int[cnt];
  cnt = 0;

  pts = NULL;
  len = 0;
  alloc_len = 0;
  lx = ly = 0;

  for (i = 0; i < cmd_size; ) {
    if (cmds[i] == CMD_CLOSE) {
      ptss[cnt] = pts;
      lens[cnt] = len;
      cnt++;

      len = 0;
      alloc_len = 0;
      pts = NULL;
      lx = ly = 0;

      i += 1;
    } else {
      if ((cmds[i] == CMD_MOVE)
         || (cmds[i] == CMD_LINE)) {
       need_len = 1;
      } else if (cmds[i] == CMD_CURVE) {
       double dx, dy;
       dx = sx * (lx - cmds[i + 5]);
       dy = sy * (ly - cmds[i + 6]);
       if (dx < 0) dx = -dx;
       if (dy < 0) dy = -dy;
       if (dx > dy)
         need_len = (int)ceil(dx);
       else
         need_len = (int)ceil(dy);
       need_len += 1;
      } else {
       need_len = 0;
      }

      if (len + (2 * need_len) > alloc_len) {
       int l;
       l = (len + (2 * need_len)) * 2;
       naya = new WXGC_ATOMIC double[l];
       memcpy(naya, pts, len * sizeof(double));
       pts = naya;
       alloc_len = l;
      }

      if ((cmds[i] == CMD_MOVE)
         || (cmds[i] == CMD_LINE)) {
       lx = cmds[i+1];
       ly = cmds[i+2];
       pts[len++] = lx;
       pts[len++] = ly;
       i += 3;
      } else if (cmds[i] == CMD_CURVE) {
       int d;
       double x0 = lx, x1 = cmds[i+1], x2 = cmds[i+3], x3 = cmds[i+5];
       double y0 = ly, y1 = cmds[i+2], y2 = cmds[i+4], y3 = cmds[i+6];
       double ax = (((x3 - (x2 * 3)) + (x1 * 3)) - x0);
       double ay = (((y3 - (y2 * 3)) + (y1 * 3)) - y0);
       double bx = (((x2 * 3) - (x1 * 6)) + (x0 * 3));
       double by = (((y2 * 3) - (y1 * 6)) + (y0 * 3));
       double cx = ((x1 * 3) - (x0 * 3));
       double cy = ((y1 * 3) -  (y0 * 3));
       double dx = x0, dy = y0, tt, x, y;

       for (d = 0; d < need_len; d++) {
         tt = ((double)d / (double)(need_len - 1));
         x = ((((((tt * ax) + bx) * tt) + cx) * tt) + dx);
         y = ((((((tt * ay) + by) * tt) + cy) * tt) + dy);
         if ((d > 0) && (d < need_len-1)) {
           /* We've generating points to map to pixels
              after scaling, so round intermediate points.
              End point have to be floored, for consistency
              with everything else, so leave them alone. */
           x = my_round(x * sx) / sx;
           y = my_round(y * sy) / sy;
         }
         pts[len++] = x;
         pts[len++] = y;
       }

       lx = x3;
       ly = y3;

       i += 7;
      }
    }
  }

  if (IsOpen()) {
    ptss[cnt] = pts;
    lens[cnt] = len;
    cnt++;
  }

  *_lens = lens;
  *_ptss = ptss;

  return cnt;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void wxPath::Translate ( double  x,
double  y 
) [inherited]

Definition at line 2162 of file Region.cxx.

{
  int i = 0;
  while (i < cmd_size) {
    if (cmds[i] == CMD_CLOSE) {
      i += 1;
    } else if ((cmds[i] == CMD_MOVE)
              || (cmds[i] == CMD_LINE)) {
      cmds[i+1] += x;
      cmds[i+2] += y;
      i += 3;
    } else if (cmds[i] == CMD_CURVE) {
      cmds[i+1] += x;
      cmds[i+2] += y;
      cmds[i+3] += x;
      cmds[i+4] += y;
      cmds[i+5] += x;
      cmds[i+6] += y;
      i += 7;
    }
  }
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 146 of file wxGC.h.

WXTYPE wxObject::__type [inherited]

Definition at line 77 of file Object.h.

long wxPath::alloc_cmd_size [inherited]

Definition at line 224 of file Region.h.

long wxPath::cmd_size [inherited]

Definition at line 224 of file Region.h.

double* wxPath::cmds [inherited]

Definition at line 225 of file Region.h.

long wxPath::last_cmd [inherited]

Definition at line 224 of file Region.h.

int wxPath::num_polys [inherited]

Definition at line 227 of file Region.h.

double** wxPath::poly_pts [inherited]

Definition at line 228 of file Region.h.


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