jfig.utils
Class Xspline

java.lang.Object
  extended byjfig.utils.Xspline

public class Xspline
extends java.lang.Object


Nested Class Summary
(package private)  class Xspline.DemoFrame
           
(package private)  class Xspline.RandomClosedSplineGenerator
           
(package private)  class Xspline.RandomOpenSplineGenerator
           
 
Field Summary
(package private)  double HIGH_PRECISION
           
(package private)  double LOW_PRECISION
           
(package private)  double MAX_SPLINE_STEP
           
(package private)  java.awt.Point[] points
           
(package private)  double[] sfactors
           
 
Constructor Summary
Xspline(java.awt.Point[] points, double[] sfactors)
           
 
Method Summary
(package private)  void addPoint(int x, int y)
           
 void compute_closed_spline()
          given our arrays of N control points and N control factors, calculate a closed X-spline.
 void compute_open_spline()
          given our arrays of N control points and N control factors, calculate an open X-spline.
 void drawSpline(java.awt.Graphics g, boolean closed)
           
 java.awt.Point[] getComputedPointArray()
           
static void main(java.lang.String[] argv)
           
static void msg(java.lang.String s)
           
 void setPoints(java.awt.Point[] points, double[] sfactors)
           
(package private)  void spline_segment_loop(int k, java.awt.Point p0, java.awt.Point p1, java.awt.Point p2, java.awt.Point p3, double s1, double s2, double precision)
           
 double step_computing(int k, java.awt.Point p0, java.awt.Point p1, java.awt.Point p2, java.awt.Point p3, double s1, double s2, double precision)
          From xfig 3.2.3 u_draw.c: This function computes the step used to draw the segment (p1, p2) (xv1, yv1) : coordinates of the vector from middle to origin (xv2, yv2) : coordinates of the vector from middle to extremity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

points

java.awt.Point[] points

sfactors

double[] sfactors

LOW_PRECISION

final double LOW_PRECISION
See Also:
Constant Field Values

HIGH_PRECISION

final double HIGH_PRECISION
See Also:
Constant Field Values

MAX_SPLINE_STEP

final double MAX_SPLINE_STEP
See Also:
Constant Field Values
Constructor Detail

Xspline

public Xspline(java.awt.Point[] points,
               double[] sfactors)
Method Detail

setPoints

public void setPoints(java.awt.Point[] points,
                      double[] sfactors)

getComputedPointArray

public java.awt.Point[] getComputedPointArray()

compute_open_spline

public void compute_open_spline()
given our arrays of N control points and N control factors, calculate an open X-spline. This method seems to work since 16.04.2001.


compute_closed_spline

public void compute_closed_spline()
given our arrays of N control points and N control factors, calculate a closed X-spline. This method still has problems (always, but for unknown reasons, with the third point)


spline_segment_loop

void spline_segment_loop(int k,
                         java.awt.Point p0,
                         java.awt.Point p1,
                         java.awt.Point p2,
                         java.awt.Point p3,
                         double s1,
                         double s2,
                         double precision)

step_computing

public double step_computing(int k,
                             java.awt.Point p0,
                             java.awt.Point p1,
                             java.awt.Point p2,
                             java.awt.Point p3,
                             double s1,
                             double s2,
                             double precision)
From xfig 3.2.3 u_draw.c: This function computes the step used to draw the segment (p1, p2) (xv1, yv1) : coordinates of the vector from middle to origin (xv2, yv2) : coordinates of the vector from middle to extremity


addPoint

void addPoint(int x,
              int y)

drawSpline

public void drawSpline(java.awt.Graphics g,
                       boolean closed)

msg

public static void msg(java.lang.String s)

main

public static void main(java.lang.String[] argv)