lt.monarch.chart.chart3D.engine
Class SimpleProjector3D

java.lang.Object
  extended by lt.monarch.chart.chart3D.engine.Projector3D
      extended by lt.monarch.chart.chart3D.engine.SimpleProjector3D
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Projector

public class SimpleProjector3D
extends Projector3D
implements java.io.Serializable

3D projector maps Point3D objects into the specified projection area.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  Rectangle2D area
          An area to project in.
protected  double chartScaleX
          A scaling values for chart.
protected  double chartScaleY
          A scaling values for chart.
protected  double chartScaleZ
          A scaling values for chart.
protected  double transX
          Viewing translate coordinates.
protected  double transY
          Viewing translate coordinates.
protected  double viewScaleX
          A scaling values for viewing.
protected  double viewScaleY
          A scaling values for viewing.
protected  double viewScaleZ
          A scaling values for viewing.
 
Fields inherited from class lt.monarch.chart.chart3D.engine.Projector3D
elevation, rotation
 
Constructor Summary
Constructor and Description
SimpleProjector3D()
          Constructor.
 
Method Summary
Modifier and Type Method and Description
 java.lang.Object clone()
          Returns a copy o the projector.
 Point2D get2DTranslation()
          Retrieves a translation vector.
 Point3D getCenter()
          Retrieves a center position.
 double getChartScaleX()
          Retrieves chart x axis scaling.
 double getChartScaleY()
          Retrieves chart y axis scaling.
 double getChartScaleZ()
          Retrieves chart z axis scaling.
 Rectangle2D getProjectionArea()
          Retrieves a projection area.
 Rectangle2D getProjectionAreaReference()
          Retrieves a projection area reference.
 double getViewScaleX()
          Retrieves view x axis scaling.
 double getViewScaleY()
          Retrieves view y axis scaling.
 double getViewScaleZ()
          Retrieves view z axis scaling.
 void prepare()
          Builds the projection matrix.
 GeneralPoint project(GeneralPoint point)
          Projects a point.
 GeneralPoint project(GeneralPoint point, GeneralPoint pt)
          Projects a point.
 Polygon2D project(Rectangle2D r)
          Projects a rectangle.
 void set2DTranslation(double transX, double transY)
          Sets a translation.
 void setChartXScaling(double scaleX)
          Sets chart x scale.
 void setChartYScaling(double scaleY)
          Sets chart y scale.
 void setChartZScaling(double scaleZ)
          Sets chart z scale.
 void setProjectionArea(Rectangle2D r)
          Sets a projection area.
 void setRotateAndFlip(boolean rotateAndFlip)
          Indicates whether to use auxiliary rotation and flipping transformations.
 void setViewScaling(double scaleX, double scaleY, double scaleZ)
          Sets a scaling for view.
 
Methods inherited from class lt.monarch.chart.chart3D.engine.Projector3D
getElevationAngle, getRotationAngle, setElevationAngle, setRotationAngle
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

area

protected Rectangle2D area
An area to project in.


viewScaleX

protected double viewScaleX
A scaling values for viewing.


viewScaleY

protected double viewScaleY
A scaling values for viewing.


viewScaleZ

protected double viewScaleZ
A scaling values for viewing.


chartScaleX

protected double chartScaleX
A scaling values for chart.


chartScaleY

protected double chartScaleY
A scaling values for chart.


chartScaleZ

protected double chartScaleZ
A scaling values for chart.


transX

protected double transX
Viewing translate coordinates.


transY

protected double transY
Viewing translate coordinates.

Constructor Detail

SimpleProjector3D

public SimpleProjector3D()
Constructor.

Method Detail

setProjectionArea

public void setProjectionArea(Rectangle2D r)
Sets a projection area.

Specified by:
setProjectionArea in interface Projector
Parameters:
r - projection area

getProjectionAreaReference

public Rectangle2D getProjectionAreaReference()
Retrieves a projection area reference.

Specified by:
getProjectionAreaReference in interface Projector
Returns:
the projection area

getProjectionArea

public Rectangle2D getProjectionArea()
Retrieves a projection area.

Specified by:
getProjectionArea in interface Projector
Returns:
the projection area

project

public GeneralPoint project(GeneralPoint point)
Projects a point.

Specified by:
project in interface Projector
Parameters:
point - a point to project
Returns:
creates and returns a 2D Point

project

public GeneralPoint project(GeneralPoint point,
                            GeneralPoint pt)
Projects a point.

Specified by:
project in interface Projector
Parameters:
point - a point to project
pt - a template for projected point
Returns:
template value

project

public Polygon2D project(Rectangle2D r)
Projects a rectangle.

Specified by:
project in interface Projector
Parameters:
r - 2D rectangle
Returns:
projected polygon

prepare

public void prepare()
Builds the projection matrix.

Specified by:
prepare in interface Projector

getChartScaleX

public double getChartScaleX()
Retrieves chart x axis scaling.

Returns:
chart x scaling

getViewScaleX

public double getViewScaleX()
Retrieves view x axis scaling.

Returns:
view x scaling

getChartScaleY

public double getChartScaleY()
Retrieves chart y axis scaling.

Returns:
chart y scaling

getViewScaleY

public double getViewScaleY()
Retrieves view y axis scaling.

Returns:
view y scaling

getChartScaleZ

public double getChartScaleZ()
Retrieves chart z axis scaling.

Returns:
chart z scaling

getViewScaleZ

public double getViewScaleZ()
Retrieves view z axis scaling.

Returns:
view z scaling

setChartXScaling

public void setChartXScaling(double scaleX)
Sets chart x scale.

Parameters:
scaleX - x scale

setChartYScaling

public void setChartYScaling(double scaleY)
Sets chart y scale.

Parameters:
scaleY - y scale

setChartZScaling

public void setChartZScaling(double scaleZ)
Sets chart z scale.

Parameters:
scaleZ - z scale

setViewScaling

public void setViewScaling(double scaleX,
                           double scaleY,
                           double scaleZ)
Sets a scaling for view.

Parameters:
scaleX - scaling in x axis
scaleY - scaling in y axis
scaleZ - scaling in z axis

setRotateAndFlip

public void setRotateAndFlip(boolean rotateAndFlip)
Indicates whether to use auxiliary rotation and flipping transformations.

Parameters:
rotateAndFlip - add auxiliary transformations

get2DTranslation

public Point2D get2DTranslation()
Retrieves a translation vector.

Returns:
the translation vector

set2DTranslation

public void set2DTranslation(double transX,
                             double transY)
Sets a translation.

Parameters:
transX - translation along x axis
transY - translation along y axis

getCenter

public Point3D getCenter()
Retrieves a center position.

Returns:
the center position

clone

public java.lang.Object clone()
Returns a copy o the projector.

Specified by:
clone in interface Projector
Overrides:
clone in class Projector3D
Returns:
a copy o the projector