Package edu.cnu.mdi.mdi3D.item3D
Class PointSet3D
java.lang.Object
edu.cnu.mdi.mdi3D.item3D.Item3D
edu.cnu.mdi.mdi3D.item3D.PointSet3D
A set of same-color, same-size points, drawn as either square or circular
point sprites.
-
Field Summary
Fields inherited from class edu.cnu.mdi.mdi3D.item3D.Item3D
_panel3D, FILLALPHA, FILLCOLOR, FONT, LINE_WIDTH, LINEALPHA, LINECOLOR, TEXT_COLOR -
Constructor Summary
ConstructorsConstructorDescriptionPointSet3D(Panel3D panel3D, float[] coords, Color color, float pointSize, boolean circular) Create a set of same color and size points for use on a Panel3D. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(com.jogamp.opengl.GLAutoDrawable drawable) The custom drawing methodfloat[]Compute the centroid (mean position) of the points.float[]A representative point for transparent sorting, in world coordinates.voidsetCoords(float[] coords) Set the coordinates of the points.Methods inherited from class edu.cnu.mdi.mdi3D.item3D.Item3D
addChild, defaultProperties, dispose, disposeItem, drawItem, get, getChildren, getColor, getFillAlpha, getFillColor, getFloat, getFont, getFont, getInt, getLineAlpha, getLineColor, getLineWidth, getPanel3D, getParent, getString, getTextColor, isVisible, put, removeChild, setAlphaOfColor, setFillAlpha, setFillColor, setFont, setLineAlpha, setLineColor, setLineWidth, setTextColor, setVisible
-
Constructor Details
-
PointSet3D
Create a set of same color and size points for use on a Panel3D.- Parameters:
panel3D- the owner 3D panelcoords- the points as [x1, y1, z1, ..., xn, yn, zn]color- the color of the pointspointSize- the drawing size of the pointscircular- iftrue, draw round point sprites; iffalse, square
-
-
Method Details
-
draw
public void draw(com.jogamp.opengl.GLAutoDrawable drawable) Description copied from class:Item3DThe custom drawing method -
setCoords
public void setCoords(float[] coords) Set the coordinates of the points.- Parameters:
coords- the points as [x1, y1, z1, ..., xn, yn, zn]
-
getCentroid
public float[] getCentroid()Compute the centroid (mean position) of the points.- Returns:
- the centroid as [x, y, z]
-
getSortPoint
public float[] getSortPoint()Description copied from class:Item3DA representative point for transparent sorting, in world coordinates. Default is origin. Override in items with a natural center (Sphere, Cube, Cylinder, etc.).- Overrides:
getSortPointin classItem3D- Returns:
- the sort point as
[x, y, z]
-