|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.display3d.simple3d.Element org.opensourcephysics.display3d.simple3d.ElementPolygon
public class ElementPolygon
Title: ElementPolygon
Description: A Polygon using the painter's algorithm
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.opensourcephysics.display3d.core.ElementPolygon |
---|
ElementPolygon.ElementPolygonLoader |
Field Summary | |
---|---|
protected org.opensourcephysics.display3d.simple3d.Object3D[] |
closedObject
|
protected org.opensourcephysics.display3d.simple3d.Object3D[] |
lineObjects
|
Fields inherited from class org.opensourcephysics.display3d.simple3d.Element |
---|
targetPosition, targetSize |
Fields inherited from interface org.opensourcephysics.display3d.core.Element |
---|
TARGET_POSITION, TARGET_SIZE |
Constructor Summary | |
---|---|
ElementPolygon()
|
Method Summary | |
---|---|
double[][] |
getData()
Gets (a copy of) the data of the points for the polygon |
void |
getExtrema(double[] min,
double[] max)
Returns the extreme points of a box that contains the element. |
static XML.ObjectLoader |
getLoader()
Returns an XML.ObjectLoader to save and load object data. |
protected InteractionTarget |
getTargetHit(int x,
int y)
Gets the target that is under the (x,y) position of the screen |
boolean |
isClosed()
Gets whether the polygon is closed |
void |
setClosed(boolean closed)
Sets whether the polygon is closed |
void |
setData(double[][] data)
Sets the data for the points of the polygon. |
void |
setData(double[] xArray,
double[] yArray,
double[] zArray)
Sets the data for the points of the polygon. |
Methods inherited from class org.opensourcephysics.display3d.simple3d.Element |
---|
addInteractionListener, getAxesMode, getDrawingPanel3D, getHotSpotBodyCoordinates, getInteractionTarget, getName, getSizeX, getSizeY, getSizeZ, getStyle, getTransformation, getX, getY, getZ, isReallyVisible, isVisible, loadUnmutableObjects, removeInteractionListener, setName, setSizeX, setSizeXYZ, setSizeXYZ, setSizeY, setSizeZ, setTransformation, setVisible, setX, setXYZ, setXYZ, setY, setZ, toBodyFrame, toSpaceFrame |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.opensourcephysics.display3d.core.Element |
---|
getDrawingPanel3D, getName, getSizeX, getSizeY, getSizeZ, getStyle, getTransformation, getX, getY, getZ, isVisible, loadUnmutableObjects, setName, setSizeX, setSizeXYZ, setSizeXYZ, setSizeY, setSizeZ, setTransformation, setVisible, setX, setXYZ, setXYZ, setY, setZ, toBodyFrame, toSpaceFrame |
Methods inherited from interface org.opensourcephysics.display3d.core.interaction.InteractionSource |
---|
addInteractionListener, getInteractionTarget, removeInteractionListener |
Field Detail |
---|
protected org.opensourcephysics.display3d.simple3d.Object3D[] lineObjects
protected org.opensourcephysics.display3d.simple3d.Object3D[] closedObject
Constructor Detail |
---|
public ElementPolygon()
Method Detail |
---|
public void setClosed(boolean closed)
ElementPolygon
setClosed
in interface ElementPolygon
closed
- booleanpublic boolean isClosed()
ElementPolygon
isClosed
in interface ElementPolygon
public void setData(double[][] data)
setData
in interface ElementPolygon
data
- double[][] the double[nPoints][3] array with the datapublic void setData(double[] xArray, double[] yArray, double[] zArray)
ElementPolygon
setData
in interface ElementPolygon
xArray
- double[] the double[nPoints] array with the X coordinatesyArray
- double[] the double[nPoints] array with the Y coordinateszArray
- double[] the double[nPoints] array with the Z coordinatespublic double[][] getData()
getData
in interface ElementPolygon
public void getExtrema(double[] min, double[] max)
Element
min
- double[] A previously allocated double[3] array that will hold
the minimum pointmax
- double[] A previously allocated double[3] array that will hold
the maximum pointprotected InteractionTarget getTargetHit(int x, int y)
Element
getTargetHit
in class Element
x
- inty
- int
public static XML.ObjectLoader getLoader()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |