org.opensourcephysics.display3d.core
Interface ElementPolygon

All Superinterfaces:
Element, org.opensourcephysics.display3d.core.interaction.InteractionSource
All Known Implementing Classes:
ElementPolygon

public interface ElementPolygon
extends Element

Title: ElementPolygon

Description: A 3D polygon.

Polygons can be closed (a real polygon) or open (polylines).


Nested Class Summary
static class ElementPolygon.ElementPolygonLoader
           
 
Nested classes inherited from class org.opensourcephysics.display3d.core.Element
Element.Loader
 
Field Summary
 
Fields inherited from interface org.opensourcephysics.display3d.core.Element
TARGET_POSITION, TARGET_SIZE
 
Method Summary
 double[][] getData()
          Gets ths data of the points fo the polygon
 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.
 
Methods inherited from interface org.opensourcephysics.display3d.core.Element
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
 

Method Detail

setClosed

public void setClosed(boolean closed)
Sets whether the polygon is closed

Parameters:
closed - boolean

isClosed

public boolean isClosed()
Gets whether the polygon is closed

Returns:
boolean

setData

public void setData(double[][] data)
Sets the data for the points of the polygon. Each entry in the data array corresponds to one vertex. If the polygon is closed, the last point will be connected to the first one and the interior will be filled (unless the fill color of the style is set to null).

Parameters:
data - double[][] the double[nPoints][3] array with the data

getData

public double[][] getData()
Gets ths data of the points fo the polygon

Returns:
double[][] the double[nPoints][3] array with the data