Package org.meteoinfo.chart.plot3d
Class Projector
- java.lang.Object
-
- org.meteoinfo.chart.plot3d.Projector
-
public final class Projector extends java.lang.ObjectThe classProjectorprojects points in 3D space to 2D space.
-
-
Constructor Summary
Constructors Constructor Description Projector()The constructor ofProjector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intget2D_xTranslation()Gets the 2D x translation.intget2D_yTranslation()Gets the 2D y translation.java.awt.RectanglegetBounds()Get boundsjava.awt.RectanglegetBounds_noScale()Get bounds without scalefloatgetCosElevationAngle()Gets the cosine of elevation angle.floatgetCosRotationAngle()Gets the cosine of rotation angle.floatgetDistance()Gets the projector distance.floatgetElevationAngle()Gets current elevation angle.floatgetRotationAngle()Gets current rotation angle.floatgetSinElevationAngle()Gets the sine of elevation angle.floatgetSinRotationAngle()Gets the sine of rotation angle.floatgetX2DScaling()Gets the x 2D scaling factor.floatgetXScaling()Gets the scaling factor in x direction.floatgetY2DScaling()Gets the x 2D scaling factor.floatgetYScaling()Gets the scaling factor in y direction.floatgetZScaling()Gets the scaling factor in z direction.java.awt.Pointproject(float x, float y, float z)Projects 3D points.java.awt.Pointproject_noScale(float x, float y, float z)Projects 3D points without scaling.double[]projectAL(float x1, float y1, float z1, float x2, float y2, float z2)Project angle and length from two pointsvoidset2D_xTranslation(int x)Sets the 2D x translation.voidset2D_yTranslation(int y)Sets the 2D y translation.voidset2DScaling(float scaling)Sets the 2D scaling factor.voidset2DTranslation(int x, int y)Sets the 2D translation.voidsetDistance(float new_distance)Sets the projector distance.voidsetElevationAngle(float angle)Sets the elevation angle.voidsetProjectionArea(java.awt.Rectangle r)Sets the projection area.voidsetRotationAngle(float angle)Sets the rotation angle.voidsetScaling(float scaling)Sets the same scaling factor for all direction.voidsetScaling(float x, float y, float z)Sets the scaling factor in all direction.voidsetX2DScaling(float scaling)Sets the x 2D scaling factor.voidsetXScaling(float scaling)Sets the scaling factor in x direction.voidsetY2DScaling(float scaling)Sets the 2D scaling factor.voidsetYScaling(float scaling)Sets the scaling factor in y direction.voidsetZRange(float zmin, float zmax)voidsetZScaling(float scaling)Sets the scaling factor in z direction.voidupdate2DScaling()Update 2D scaling
-
-
-
Method Detail
-
setProjectionArea
public void setProjectionArea(java.awt.Rectangle r)
Sets the projection area.- Parameters:
r- the projection area
-
setRotationAngle
public void setRotationAngle(float angle)
Sets the rotation angle.- Parameters:
angle- the rotation angle in degrees
-
getRotationAngle
public float getRotationAngle()
Gets current rotation angle.- Returns:
- the rotation angle in degrees.
-
getSinRotationAngle
public float getSinRotationAngle()
Gets the sine of rotation angle.- Returns:
- the sine of rotation angle
-
getCosRotationAngle
public float getCosRotationAngle()
Gets the cosine of rotation angle.- Returns:
- the cosine of rotation angle
-
setElevationAngle
public void setElevationAngle(float angle)
Sets the elevation angle.- Parameters:
angle- the elevation angle in degrees
-
getElevationAngle
public float getElevationAngle()
Gets current elevation angle.- Returns:
- the elevation angle in degrees.
-
getSinElevationAngle
public float getSinElevationAngle()
Gets the sine of elevation angle.- Returns:
- the sine of elevation angle
-
getCosElevationAngle
public float getCosElevationAngle()
Gets the cosine of elevation angle.- Returns:
- the cosine of elevation angle
-
setDistance
public void setDistance(float new_distance)
Sets the projector distance.- Parameters:
new_distance- the new distance
-
getDistance
public float getDistance()
Gets the projector distance.- Returns:
- the projector distance
-
setXScaling
public void setXScaling(float scaling)
Sets the scaling factor in x direction.- Parameters:
scaling- the scaling factor
-
getXScaling
public float getXScaling()
Gets the scaling factor in x direction.- Returns:
- the scaling factor
-
setYScaling
public void setYScaling(float scaling)
Sets the scaling factor in y direction.- Parameters:
scaling- the scaling factor
-
getYScaling
public float getYScaling()
Gets the scaling factor in y direction.- Returns:
- the scaling factor
-
setZScaling
public void setZScaling(float scaling)
Sets the scaling factor in z direction.- Parameters:
scaling- the scaling factor
-
getZScaling
public float getZScaling()
Gets the scaling factor in z direction.- Returns:
- the scaling factor
-
setScaling
public void setScaling(float x, float y, float z)Sets the scaling factor in all direction.- Parameters:
x- the scaling factor in x directiony- the scaling factor in y directionz- the scaling factor in z direction
-
setScaling
public void setScaling(float scaling)
Sets the same scaling factor for all direction.- Parameters:
scaling- the scaling factor
-
set2DScaling
public void set2DScaling(float scaling)
Sets the 2D scaling factor.- Parameters:
scaling- the scaling factor
-
setX2DScaling
public void setX2DScaling(float scaling)
Sets the x 2D scaling factor.- Parameters:
scaling- the x scaling factor
-
setY2DScaling
public void setY2DScaling(float scaling)
Sets the 2D scaling factor.- Parameters:
scaling- the scaling factor
-
getX2DScaling
public float getX2DScaling()
Gets the x 2D scaling factor.- Returns:
- the x scaling factor
-
getY2DScaling
public float getY2DScaling()
Gets the x 2D scaling factor.- Returns:
- the x scaling factor
-
set2DTranslation
public void set2DTranslation(int x, int y)Sets the 2D translation.- Parameters:
x- the x translationy- the y translation
-
set2D_xTranslation
public void set2D_xTranslation(int x)
Sets the 2D x translation.- Parameters:
x- the x translation
-
get2D_xTranslation
public int get2D_xTranslation()
Gets the 2D x translation.- Returns:
- the x translation
-
set2D_yTranslation
public void set2D_yTranslation(int y)
Sets the 2D y translation.- Parameters:
y- the y translation
-
get2D_yTranslation
public int get2D_yTranslation()
Gets the 2D y translation.- Returns:
- the y translation
-
project
public final java.awt.Point project(float x, float y, float z)Projects 3D points.- Parameters:
x- the x coordinatey- the y coordinatez- the z coordinate- Returns:
- Projected point
-
projectAL
public double[] projectAL(float x1, float y1, float z1, float x2, float y2, float z2)Project angle and length from two points- Parameters:
x1- Point 1 xy1- Point 1 yz1- Point 1 zx2- Point 2 xy2- Point 2 yz2- Point 2 z- Returns:
- Angle and length
-
project_noScale
public final java.awt.Point project_noScale(float x, float y, float z)Projects 3D points without scaling.- Parameters:
x- the x coordinatey- the y coordinatez- the z coordinate- Returns:
- Projected point
-
setZRange
public void setZRange(float zmin, float zmax)
-
getBounds
public java.awt.Rectangle getBounds()
Get bounds- Returns:
- Bounds rectangle
-
getBounds_noScale
public java.awt.Rectangle getBounds_noScale()
Get bounds without scale- Returns:
- Bounds rectangle
-
update2DScaling
public void update2DScaling()
Update 2D scaling
-
-