|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quinncurtis.chart3djava.PolygonList
public class PolygonList
A list class that organizes a list of 3D points into a collection of polygons.
Field Summary | |
---|---|
static int |
MAX_VALUE_SORT
Sort polygons using max value of vertices |
static int |
MEAN_BASE_VALUE_SORT
Sort polygons based on the value of element 0 |
static int |
MEAN_VALUE_SORT
Sort polygons using mean value of vertices |
static int |
MIN_VALUE_SORT
Sort polygons using min value of vertices |
static int |
REVERSE_MEAN_BASE_VALUE_SORT
Sort polygon in reverse order based on the value of element 0 |
Constructor Summary | |
---|---|
PolygonList()
The default constructor. |
|
PolygonList(PolygonList source)
Constructor initializes the PolygonList object as a copy of a another PolygonList object. |
Method Summary | |
---|---|
int |
addPolygon(PhysicalCoordinates transform,
ChartPoint3D[] points,
ChartAttribute attrib)
Add a polygon to the PolygonList object. |
int |
addPolygon(PhysicalCoordinates transform,
ChartPoint3D p1,
ChartPoint3D p2,
ChartAttribute attrib)
Add a two point line to the PolygonList object. |
int |
addPolygon(Polygon3D newpolygon)
Add the a polygon to the polygonArray. |
int |
addPolygonList(PolygonList newpolygons)
Adds an array of polygons from the source Polygon3D object to the current PolygonList object. |
int |
addPolygons(Polygon3D[] newpolygons)
Adds an array of polygons to the PolygonList object. |
int |
addSolidPointList(ChartPoint3D[] points)
Add an array of points to the PolygonList point list. |
int |
addSolidPolygon(int[] pointindices,
ChartAttribute outsideattrib)
Add a polygon, specified using point indices of the already populated pointList. |
int |
addSolidPolygon(PhysicalCoordinates transform,
int[] pointindices,
ChartAttribute outsideattrib)
Add a polygon, specified using point indices of the already populated pointList. |
void |
clampPolygonListToCoordinateLimits()
Clamp the polygon vertex values to the coordinate systems limits. |
java.lang.Object |
clone()
Returns an object that is a clone of this object. |
int |
compareTo(java.lang.Object obj)
CompareTo method require by IComparable interface. |
void |
copy(PolygonList source)
Copies the source object. |
int |
count()
Returns the count of the polygonArray. |
void |
cullRearFacingPolygons()
Cull the rear facing polygons. |
void |
draw(java.awt.Graphics2D g2)
The draw function for the class. |
int |
getCoordinateType()
Returns the coordinate type. |
Polygon3D |
getElement(int index)
Get the value of an individual polygon in the Polygon3D list. |
PolygonList |
getLongFormPolygonList()
This functions converts a PolygonList object that shares points in the pointList array across multipe polygons, into a PolygonList object where every polygon contains unique 3D points. |
double |
getMaxValue(int axis)
Returns the maximum value of the polygons for a given axis. |
double |
getMeanValue(int axis)
Returns the mean value of the polygons for a given axis. |
double |
getMinValue(int axis)
Returns the minimum value of the polygons for a given axis. |
int |
getObjectSortElement()
Get polygon sort element for the PolygonList object. |
Polygon3D |
getPolygon(int index)
Returns a specific polygon in the array of Polygon3D objects. |
int |
getPolygonAtTestPoint(double x,
double y)
Get the index of the polygon in the PolygonList object at the test point (x,y). |
Polygon3D[] |
getPolygons()
Returns an array of Polygon3D objects. |
int |
getSortingTestCase()
Get the sortingTestCase for the object. |
boolean |
getSortPolygonsByZDepth()
Returns true if the polygons are sorted by z-depth. |
void |
markPolygonIndices(int datapoint,
int group)
Mark all of the polygons in the polygon list object with data point and group indices. |
static void |
polygonTransform3D(ChartPoint3D[] points,
Transform3D transform)
Static routine transforms the points using the specified Transform3D object. |
static void |
polygonTransform3D(PolygonList polylist,
Transform3D transform)
Static routine transforms PolygonList object using the specified Transform3D object. |
void |
reset()
Resets the PolygonList object back to it's default (empty) state. |
void |
reversePolygons()
Reverses the drawing order of the polygons in the PolygonList object |
void |
scalePolyList(ChartPoint3D scalef,
ChartPoint3D offset)
Apply an mx + b scaling to each polygon of the PolygonList. |
void |
setCoordinateType(int value)
Sets the coordinate type. |
void |
setElement(int index,
Polygon3D value)
Sets the value of an individual polygon in the Polygon3D list. |
void |
setEnableCullRearFacing(boolean value)
Set to true to enable the culling of rear facing polygons |
void |
setObjectSortElement(int value)
Set polygon sort element for the PolygonList object. |
void |
setPolygonItems(PhysicalCoordinates physscale,
ChartAttribute attrib)
Set the coordinate system and color attribute for the polygons in the PolygonList object. |
void |
setSortingTestCase(int value)
Set the sortingTestCase for the object. |
void |
setSortPolygonsByZDepth(boolean value)
Set to True and the polygons are sorted by z-depth. |
void |
solidTransformPolyList()
A faster technique that transforms just the pointList array to screen coordinates. |
void |
sort()
Sort the Polygon3D objects in the PolygonList. |
void |
transformPolyList()
Transform all polygons in PolygonList object to Screen coordinates. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MEAN_VALUE_SORT
public static final int MAX_VALUE_SORT
public static final int MIN_VALUE_SORT
public static final int MEAN_BASE_VALUE_SORT
public static final int REVERSE_MEAN_BASE_VALUE_SORT
Constructor Detail |
---|
public PolygonList()
public PolygonList(PolygonList source)
source
- The source PolygonList object.Method Detail |
---|
public int compareTo(java.lang.Object obj)
compareTo
in interface java.lang.Comparable
obj
- sort object.
public void reset()
public void sort()
public void copy(PolygonList source)
source
- The source object.public void cullRearFacingPolygons()
public void clampPolygonListToCoordinateLimits()
public void reversePolygons()
public java.lang.Object clone()
clone
in class java.lang.Object
public int addSolidPointList(ChartPoint3D[] points)
points
- The source array of ChartPoint3D objects.
public int addSolidPolygon(PhysicalCoordinates transform, int[] pointindices, ChartAttribute outsideattrib)
transform
- The coordinate system associated with the polygons.pointindices
- An array of the point indices of points in the pointList defining the polygon.outsideattrib
- The outside attribute of the polygon.
public int addSolidPolygon(int[] pointindices, ChartAttribute outsideattrib)
pointindices
- An array of the point indices of points in the pointList defining the polygon.outsideattrib
- The outside attribute of the polygon.
public int addPolygon(Polygon3D newpolygon)
newpolygon
- Add this polygon to the polygonArray.
public int addPolygon(PhysicalCoordinates transform, ChartPoint3D[] points, ChartAttribute attrib)
transform
- The coordinate system associated with the polygons.points
- An array of the points defining the polygon.attrib
- The outside attribute of the polygon.
public int addPolygon(PhysicalCoordinates transform, ChartPoint3D p1, ChartPoint3D p2, ChartAttribute attrib)
transform
- The coordinate system associated with the polygons.p1
- The first of the two points to add.p2
- The second of the two points to add.attrib
- The outside attribute of the polygon.
public Polygon3D[] getPolygons()
public Polygon3D getPolygon(int index)
index
- The index of the polygon in the polygonArray.
public int addPolygons(Polygon3D[] newpolygons)
newpolygons
- An array of the Polygon3D objects.
public int addPolygonList(PolygonList newpolygons)
newpolygons
- The source Polygon3D object.
public void markPolygonIndices(int datapoint, int group)
datapoint
- The data point index of the polygon.group
- The group index of the polygon.public void transformPolyList()
public void solidTransformPolyList()
public static void polygonTransform3D(ChartPoint3D[] points, Transform3D transform)
transform
- The Transform3D object associated with the polygon.points
- The point list to transform.public static void polygonTransform3D(PolygonList polylist, Transform3D transform)
transform
- The Transform3D object associated with the polygon.polylist
- The PolygonList object to transform.public void scalePolyList(ChartPoint3D scalef, ChartPoint3D offset)
scalef
- The scale factor to apply to each point.offset
- The offset to apply to each point.public void setPolygonItems(PhysicalCoordinates physscale, ChartAttribute attrib)
physscale
- The coordinate system of the PolygonList object.attrib
- The color attribute of the PolygonList object.public int getPolygonAtTestPoint(double x, double y)
x
- The x-value of the test point.y
- The y-value of the test point.
public double getMeanValue(int axis)
axis
- The axis id (X_AXIS, Y_AXIS, Z_AXIS).
public double getMinValue(int axis)
axis
- The axis id (X_AXIS, Y_AXIS, Z_AXIS).
public double getMaxValue(int axis)
axis
- The axis id (X_AXIS, Y_AXIS, Z_AXIS).
public void draw(java.awt.Graphics2D g2)
g2
- A graphics contextpublic PolygonList getLongFormPolygonList()
public Polygon3D getElement(int index)
index
- Get the point at the index element.
public void setElement(int index, Polygon3D value)
index
- Set the point at the index element.value
- Set the point at the index element using this value.public int count()
public int getSortingTestCase()
public void setSortingTestCase(int value)
value
- Set the sortingTestCase for the object.public int getObjectSortElement()
public void setObjectSortElement(int value)
value
- Set the polygon sort element for the PolygonList object.public boolean getSortPolygonsByZDepth()
public void setSortPolygonsByZDepth(boolean value)
value
- Set to true if the polygons are sorted by z-depth.public void setEnableCullRearFacing(boolean value)
value
- Set to true to enable the culling of rear facing polygonspublic int getCoordinateType()
public void setCoordinateType(int value)
value
- Set the coordinate type.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |