public class DefaultDrawable3D extends java.lang.Object implements Drawable3D
Drawable3D interface.
This is not used directly in Orson Charts, since the Chart3D class
implements the Drawable3D interface itself. However, it is used
in testing to ensure that the com.orsoncharts.graphics3d
package can function on a stand-alone basis.| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_PROJ_DIST
The default projection distance.
|
| Constructor and Description |
|---|
DefaultDrawable3D(World world)
Creates a new instance to display the content of the specified
world. |
| Modifier and Type | Method and Description |
|---|---|
RenderingInfo |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D bounds)
Draws the current view to a
Graphics2D instance. |
Dimension3D |
getDimensions()
Returns the dimensions of the 3D object.
|
double |
getProjDistance()
Returns the projection distance.
|
Offset2D |
getTranslate2D()
Returns the 2D offset for the scene.
|
ViewPoint3D |
getViewPoint()
Returns the view point.
|
void |
setProjDistance(double dist)
Sets the projection distance.
|
void |
setTranslate2D(Offset2D offset)
Sets the translation offset.
|
void |
setViewPoint(ViewPoint3D viewPoint)
Sets the view point.
|
public static final double DEFAULT_PROJ_DIST
public DefaultDrawable3D(World world)
world.world - the world to view (null not permitted).public Dimension3D getDimensions()
getDimensions in interface Drawable3Dpublic ViewPoint3D getViewPoint()
getViewPoint in interface Drawable3Dnull).public void setViewPoint(ViewPoint3D viewPoint)
setViewPoint in interface Drawable3DviewPoint - the view point (null not permitted).public double getProjDistance()
DEFAULT_PROJ_DIST, higher numbers flatten out the perspective
and reduce distortion in the projected image.getProjDistance in interface Drawable3Dpublic void setProjDistance(double dist)
setProjDistance in interface Drawable3Ddist - the distance.public Offset2D getTranslate2D()
Drawable3D(0, 0).getTranslate2D in interface Drawable3Dnull).public void setTranslate2D(Offset2D offset)
Drawable3DsetTranslate2D in interface Drawable3Doffset - the translation offset (null not permitted).public RenderingInfo draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds)
Graphics2D instance.draw in interface Drawable3Dg2 - the graphics target (null not permitted).bounds - the bounds (null not permitted).