net.paulhertz.aifile
Class BezTriangle

java.lang.Object
  extended by net.paulhertz.aifile.DisplayComponent
      extended by net.paulhertz.aifile.BezShape
          extended by net.paulhertz.aifile.BezTriangle
All Implemented Interfaces:
ColorableINF, Visitable

public class BezTriangle
extends BezShape

Provides factory methods to create and operate on a triangular shape.


Nested Class Summary
 
Nested classes/interfaces inherited from class net.paulhertz.aifile.BezShape
BezShape.BezType
 
Field Summary
 
Fields inherited from class net.paulhertz.aifile.BezShape
bezType, CURVE_SEGMENT, KAPPA, LINE_SEGMENT
 
Method Summary
static BezTriangle makeCenterRadius(float xctr, float yctr, float radius)
          Returns an equilateral triangle with center xctr, yctr and distance from center to each vertex equal to radius.
static BezTriangle makeCenterRadius(PApplet parent, float xctr, float yctr, float radius)
          Returns an equilateral triangle with center xctr, yctr and distance from center to each vertex equal to radius.
static BezTriangle makeThreePoints(float x1, float y1, float x2, float y2, float x3, float y3)
          Returns a triangle constructed from three points.
static BezTriangle makeThreePoints(PApplet parent, float x1, float y1, float x2, float y2, float x3, float y3)
          Returns a triangle constructed from three points.
 
Methods inherited from class net.paulhertz.aifile.BezShape
accept, accept, add, add, append, append, append, asPolygon, asPolygon, asPolygon, asPolygon, bezCircle, bezCurve, bezCurveShape, bezEllipse, bezLine, bezMultiCurve, bezMultiLine, bezPoly, bezRectangle, bezRegularPoly, bezTriangle, bezTriangle, bezType, bounds, bounds, boundsRect, calculateCenter, centerVertex, children, clone, containsPoint, containsPoint, curveIterator, curves, curvesCopy, draw, draw, drawQuick, fillColor, fillOpacity, get, getAnchorCenter, getBoundsCenter, getCoords, getCtm, getGeoCenter, getMatrix, hasFill, hasStroke, isClosed, isTerminal, iterator, moveTo, polySize, polySize, polySteps, remove, rotateShape, rotateShape, scaleShape, scaleShape, scaleShape, scaleShape, setBezType, setCenter, setCenter, setCenter, setColors, setCtm, setCtm, setCtm, setCurves, setFillColor, setFillOpacity, setHasFill, setHasStroke, setIsClosed, setNoFill, setNoStroke, setPolySteps, setStartPoint, setStartPoint, setStartPoint, setStrokeColor, setStrokeOpacity, setUseTransparency, setWeight, setX, setY, startVertex, startVertexArray, strokeColor, strokeOpacity, transform, transform, transformShape, translateShape, useTransparency, weight, write, write, x, xcoords, xcoords, xctr, y, ycoords, ycoords, yctr
 
Methods inherited from class net.paulhertz.aifile.DisplayComponent
hide, id, isLocked, isVisible, parentComponent, setLocked, setParentComponent, setVisible, show
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

makeCenterRadius

public static BezTriangle makeCenterRadius(PApplet parent,
                                           float xctr,
                                           float yctr,
                                           float radius)
Returns an equilateral triangle with center xctr, yctr and distance from center to each vertex equal to radius. The base is aligned with the x-axis, apex points down.

Parameters:
parent - PApplet used for calls to the Processing environment
xctr - x-coordinate of center of triangle
yctr - y-coordinate of center of triangle
radius - radius of the triangle

makeCenterRadius

public static BezTriangle makeCenterRadius(float xctr,
                                           float yctr,
                                           float radius)
Returns an equilateral triangle with center xctr, yctr and distance from center to each vertex equal to radius. The base is aligned with the x-axis, apex points down. PApplet used for calls to the Processing environment is obtained from IgnoCodeLib, which must be correctly initialized in setup. If IgnoCodeLib does not have a reference to a PApplet, it throws a NullPointerException.

Parameters:
xctr - x-coordinate of center of triangle
yctr - y-coordinate of center of triangle
radius - radius of the triangle

makeThreePoints

public static BezTriangle makeThreePoints(PApplet parent,
                                          float x1,
                                          float y1,
                                          float x2,
                                          float y2,
                                          float x3,
                                          float y3)
Returns a triangle constructed from three points.

Parameters:
parent - PApplet used for calls to the Processing environment
x1 - x-coordinate of first point
y1 - y-coordinate of first point
x2 - x-coordinate of second point
y2 - y-coordinate of second point
x3 - x-coordinate of third point
y3 - y-coordinate of third point

makeThreePoints

public static BezTriangle makeThreePoints(float x1,
                                          float y1,
                                          float x2,
                                          float y2,
                                          float x3,
                                          float y3)
Returns a triangle constructed from three points. PApplet used for calls to the Processing environment is obtained from IgnoCodeLib, which must be correctly initialized in setup. If IgnoCodeLib does not have a reference to a PApplet, it throws a NullPointerException.

Parameters:
x1 - x-coordinate of first point
y1 - y-coordinate of first point
x2 - x-coordinate of second point
y2 - y-coordinate of second point
x3 - x-coordinate of third point
y3 - y-coordinate of third point


Processing library IgnoCodeLib by Paul Hertz. (C) 2013