org.opensourcephysics.display3d.simple3d
Class ElementPoints

java.lang.Object
  extended by org.opensourcephysics.display3d.simple3d.Element
      extended by org.opensourcephysics.display3d.simple3d.ElementPoints
All Implemented Interfaces:
Element, ElementPoints, InteractionSource

public class ElementPoints
extends Element
implements ElementPoints

Title: ElementPolygon

Description: A Polygon using the painter's algorithm

Version:
March 2005
Author:
Francisco Esquembre

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.opensourcephysics.display3d.core.ElementPoints
ElementPoints.ElementPointsLoader
 
Field Summary
protected  org.opensourcephysics.display3d.simple3d.Object3D[] pointObjects
           
 
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
ElementPoints()
           
 
Method Summary
 double[][] getData()
          Gets the data of the coordinates of the points
 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
 void setData(double[][] data)
          Sets the data for the coordinates of the points.
 
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

pointObjects

protected org.opensourcephysics.display3d.simple3d.Object3D[] pointObjects
Constructor Detail

ElementPoints

public ElementPoints()
Method Detail

setData

public void setData(double[][] data)
Description copied from interface: ElementPoints
Sets the data for the coordinates of the points. Each entry in the data array corresponds to one point.

Specified by:
setData in interface ElementPoints
Parameters:
data - double[][] the double[nPoints][3] array with the data

getData

public double[][] getData()
Description copied from interface: ElementPoints
Gets the data of the coordinates of the points

Specified by:
getData in interface ElementPoints
Returns:
double[][] the double[nPoints][3] array with the data

getExtrema

public void getExtrema(double[] min,
                       double[] max)
Description copied from class: Element
Returns the extreme points of a box that contains the element.

Parameters:
min - double[] A previously allocated double[3] array that will hold the minimum point
max - double[] A previously allocated double[3] array that will hold the maximum point

getTargetHit

protected InteractionTarget getTargetHit(int x,
                                         int y)
Description copied from class: Element
Gets the target that is under the (x,y) position of the screen

Overrides:
getTargetHit in class Element
Parameters:
x - int
y - int
Returns:
InteractionTarget

getLoader

public static XML.ObjectLoader getLoader()
Returns an XML.ObjectLoader to save and load object data.

Returns:
the XML.ObjectLoader