Package org.jzy3d.plot3d.primitives
Class Point
- java.lang.Object
-
- org.jzy3d.plot3d.primitives.Drawable
-
- org.jzy3d.plot3d.primitives.Point
-
- All Implemented Interfaces:
ISingleColorable
,IGLRenderer
,ISortableDraw
- Direct Known Subclasses:
CameraDistanceAnnotation
,PickablePoint
public class Point extends Drawable implements ISingleColorable
A Point3d is a storage for a Coord3d and a Color that represents a drawable 3d point.
The Point3d is used for:- adding a Point3d to a
Graph
. - providing to other primitives (e.g.
Polygon
) a way to associate a coordinate and a color.
A Point3d is defined by the following methods:- setData() defines the point's position
- setColor() defines the point's color
- setWidth() defines the point's width
- Author:
- Martin Pernollet
-
-
Field Summary
Fields Modifier and Type Field Description Color
rgb
float
width
Coord3d
xyz
-
Fields inherited from class org.jzy3d.plot3d.primitives.Drawable
bbox, boundingBoxColor, boundingBoxDisplayed, displayed, hasListeners, legend, legendDisplayed, listeners, spaceTransformer, transform, transformBefore
-
-
Constructor Summary
Constructors Constructor Description Point()
Intialize a point at the origin, with a white color and a width of 1.Point(Coord3d xyz)
Intialize a point with a white color and a width of 1.Point(Coord3d xyz, Color rgb)
Intialize a point with a width of 1.Point(Coord3d xyz, Color rgb, float width)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyGeometryTransform(Transform transform)
Point
clone()
void
draw(IPainter painter)
Call OpenGL2 routines for rendering the object.Color
getColor()
Get the color.Coord3d
getCoord()
double
getDistance(Camera camera)
Return the distance of the object center to theCamera
's eye.double
getLongestDistance(Camera camera)
double
getShortestDistance(Camera camera)
float
getWidth()
void
setColor(Color color)
Set the color.void
setCoord(Coord3d xyz)
void
setData(Coord3d xyz)
Set the coordinates of the point.void
setWidth(float width)
String
toString(int depth)
void
updateBounds()
-
Methods inherited from class org.jzy3d.plot3d.primitives.Drawable
addDrawableListener, asWireframeable, dispose, doDrawBoundsIfDisplayed, doTransform, fireDrawableChanged, fireDrawableChanged, getBarycentre, getBoundingBoxColor, getBounds, getLegend, getSpaceTransformer, getTransform, getTransformBefore, hasLegend, isBoundingBoxDisplayed, isDisplayed, isLegendDisplayed, removeDrawableListener, setBoundingBoxColor, setBoundingBoxDisplayed, setDisplayed, setLegend, setLegendDisplayed, setSpaceTransformer, setTransform, setTransformBefore, toString
-
-
-
-
Constructor Detail
-
Point
public Point()
Intialize a point at the origin, with a white color and a width of 1.
-
Point
public Point(Coord3d xyz)
Intialize a point with a white color and a width of 1.
-
-
Method Detail
-
draw
public void draw(IPainter painter)
Description copied from class:Drawable
Call OpenGL2 routines for rendering the object.- Specified by:
draw
in interfaceIGLRenderer
- Specified by:
draw
in classDrawable
-
applyGeometryTransform
public void applyGeometryTransform(Transform transform)
- Specified by:
applyGeometryTransform
in classDrawable
-
setData
public void setData(Coord3d xyz)
Set the coordinates of the point.- Parameters:
xyz
- point's coordinates
-
updateBounds
public void updateBounds()
- Specified by:
updateBounds
in classDrawable
-
setColor
public void setColor(Color color)
Description copied from interface:ISingleColorable
Set the color.- Specified by:
setColor
in interfaceISingleColorable
- Parameters:
color
- the color
-
getColor
public Color getColor()
Description copied from interface:ISingleColorable
Get the color.- Specified by:
getColor
in interfaceISingleColorable
- Returns:
- color the color.
-
setWidth
public void setWidth(float width)
-
getWidth
public float getWidth()
-
getDistance
public double getDistance(Camera camera)
Description copied from class:Drawable
Return the distance of the object center to theCamera
's eye.- Specified by:
getDistance
in interfaceISortableDraw
- Overrides:
getDistance
in classDrawable
-
getShortestDistance
public double getShortestDistance(Camera camera)
- Specified by:
getShortestDistance
in interfaceISortableDraw
- Overrides:
getShortestDistance
in classDrawable
-
getLongestDistance
public double getLongestDistance(Camera camera)
- Specified by:
getLongestDistance
in interfaceISortableDraw
- Overrides:
getLongestDistance
in classDrawable
-
getCoord
public Coord3d getCoord()
-
setCoord
public void setCoord(Coord3d xyz)
-
-