org.cybertory.MSS
Class CircleFeatureShapeFactory

java.lang.Object
  extended byorg.cybertory.MSS.CircleFeatureShapeFactory
All Implemented Interfaces:
FeatureShapeFactory

public class CircleFeatureShapeFactory
extends java.lang.Object
implements FeatureShapeFactory

A flavor of FeatureShapeFactory that produces circular features, including support for the variability of location, size, and shape. Relies heavily on the PolygonFactory. Note that all random effects in this class are related to array manufacture -- therefore in the Cybertory, the random seed should be based on the serial number.


Constructor Summary
CircleFeatureShapeFactory()
          Constructor; variability can be added by setVariability(java.util.Random, float, float, int, boolean, org.cybertory.MSS.AngleBias[]).
 
Method Summary
 java.awt.Shape createFeatureShape(float featurePixelSize)
          Generate a specific shape, centered at 0,0.
 java.awt.Shape createFeatureShape(float featurePixelSize, java.awt.geom.Point2D featureCenter)
          Generate a specific shape, given the design location of a feature.
 void setVariability(java.util.Random rand, float locationVariability, float sizeVariability, int shapeVariability, boolean roundedCorners, AngleBias[] biases)
          Add variability factors to the shape generation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CircleFeatureShapeFactory

public CircleFeatureShapeFactory()
Constructor; variability can be added by setVariability(java.util.Random, float, float, int, boolean, org.cybertory.MSS.AngleBias[]).

Method Detail

createFeatureShape

public java.awt.Shape createFeatureShape(float featurePixelSize,
                                         java.awt.geom.Point2D featureCenter)
Generate a specific shape, given the design location of a feature.

Specified by:
createFeatureShape in interface FeatureShapeFactory
Parameters:
featurePixelSize - size of feature in pixel units
featureCenter - the design location of a feature; this could by altered if setVariability is called.
Returns:
the Shape of the feature.

setVariability

public void setVariability(java.util.Random rand,
                           float locationVariability,
                           float sizeVariability,
                           int shapeVariability,
                           boolean roundedCorners,
                           AngleBias[] biases)
Add variability factors to the shape generation. Default (if this method isn't called) is for zero variability (perfect in place circles of uniform size).

Parameters:
rand - random number object (which caller has seeded)
locationVariability - Standard deviation of location from design location using a random angle.
sizeVariability - This number is used as a base for an exponential with random number as exponent, the result is multiplied by the design size.
shapeVariability - 0=none, 1=low, 2=medium, 3=high
roundedCorners -

createFeatureShape

public java.awt.Shape createFeatureShape(float featurePixelSize)
Generate a specific shape, centered at 0,0.

Parameters:
featurePixelSize - size of feature in pixel units
Returns:
the Shape of the feature.