Back to index

wims  3.65+svn20090927
Public Member Functions | Public Attributes | Static Public Attributes | Package Attributes
rene.zirkel.graphics.PolygonFiller Class Reference
Collaboration diagram for rene.zirkel.graphics.PolygonFiller:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PolygonFiller (MyGraphics g, ConstructionObject o)
void startPolygon (double c, double r)
void start ()
void drawTo (double c, double r)
void drawTo (double c, double r, boolean optimized)
void finishPolygon ()
int length ()
double x (int i)
double y (int i)
void setGraphics (MyGraphics g)

Public Attributes

boolean Started

Static Public Attributes

static int step = 5

Package Attributes

MyGraphics G
ConstructionObject O
double C
double R
double C1
double R1
boolean HaveToFinish
boolean Solid
double x []
double y []
int nx

Detailed Description

Author:
Rene

Definition at line 13 of file PolygonFiller.java.


Constructor & Destructor Documentation

Definition at line 26 of file PolygonFiller.java.

       {      G=g; O=o;
              Started=false;
       }

Member Function Documentation

void rene.zirkel.graphics.PolygonFiller.drawTo ( double  c,
double  r 
) [inline]

Definition at line 43 of file PolygonFiller.java.

       {      drawTo(c,r,true);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void rene.zirkel.graphics.PolygonFiller.drawTo ( double  c,
double  r,
boolean  optimized 
) [inline]

Definition at line 47 of file PolygonFiller.java.

       {      if (!Started)
              {      startPolygon(c,r);
                     return;
              }
              if (!optimized || (c-C)*(c-C)+(r-R)*(r-R)>step)
              {      if (x==null)
                     {      x=new double[1000];
                            y=new double[1000];
                            nx=0;
                     }
                     if (nx>=x.length)
                     {      double xn[]=new double[2*x.length]; 
                            double yn[]=new double[2*x.length];
                            for (int i=0; i<nx; i++)
                            {      xn[i]=x[i]; yn[i]=y[i]; 
                            }
                            x=xn; y=yn;
                     }
                     x[nx]=c; y[nx++]=r;
                     C=c; R=r;
                     HaveToFinish=false;
              }
              else
              {      C1=c; R1=r;
                     HaveToFinish=true;
              }
       }

Here is the call graph for this function:

Definition at line 76 of file PolygonFiller.java.

       {      if (HaveToFinish)
              {      drawTo(C1,R1,false);
                     HaveToFinish=false;
              }
              G.fillPolygon(x,y,nx,false,true,O);
              Started=false;
       }

Here is the call graph for this function:

Definition at line 85 of file PolygonFiller.java.

       {      return nx;
       }

Definition at line 96 of file PolygonFiller.java.

       {      G=g;
       }

Definition at line 39 of file PolygonFiller.java.

       {      nx=0; Started=false;
       }
void rene.zirkel.graphics.PolygonFiller.startPolygon ( double  c,
double  r 
) [inline]

Definition at line 31 of file PolygonFiller.java.

       {      C=c; R=r;
              HaveToFinish=false;
              nx=0;
              Started=true;
              drawTo(c,r,false);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

double rene.zirkel.graphics.PolygonFiller.x ( int  i) [inline]

Definition at line 89 of file PolygonFiller.java.

       {      return x[i];
       }
double rene.zirkel.graphics.PolygonFiller.y ( int  i) [inline]

Definition at line 92 of file PolygonFiller.java.

       {      return y[i];
       }

Member Data Documentation

Definition at line 16 of file PolygonFiller.java.

Definition at line 17 of file PolygonFiller.java.

Definition at line 14 of file PolygonFiller.java.

Definition at line 18 of file PolygonFiller.java.

Definition at line 24 of file PolygonFiller.java.

Definition at line 15 of file PolygonFiller.java.

Definition at line 16 of file PolygonFiller.java.

Definition at line 17 of file PolygonFiller.java.

Definition at line 21 of file PolygonFiller.java.

Definition at line 20 of file PolygonFiller.java.

Definition at line 19 of file PolygonFiller.java.

Definition at line 23 of file PolygonFiller.java.

Definition at line 23 of file PolygonFiller.java.


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