visad.bom.annotations
Class TriangleJ3D
- java.lang.Object
-
- visad.bom.annotations.TriangleJ3D
-
- All Implemented Interfaces:
- ScreenAnnotation
public class TriangleJ3D extends java.lang.Object implements ScreenAnnotation
Meant to encapsulate information representing a Triangle which is going to be rendered on a VisAD display without being subject to the usual VisAD transformations. Thus the label should stick in Screen Coordinates.
-
-
Field Summary
Fields Modifier and Type Field and Description static intFILLfill style FILLstatic intLINEfill style LINEstatic intPOINTfill style POINT
-
Constructor Summary
Constructors Constructor and Description TriangleJ3D()Simple constructor which makes a zero size triangle at (0, 0) coloured white.TriangleJ3D(int style, int[][] points, float[] colour, double zValue, double thickness)Constructs a TriangleJ3D from 3 points specified in screen coordinates.TriangleJ3D(int style, int x1, int y1, int x2, int y2, int x3, int y3, float[] colour, double zValue, double thickness)Constructs a TriangleJ3D from 3 points specified in screen coordinates.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidsetColour(float[] colour)Set the colour of the triangle.voidsetPoints(int[][] points)Sets TriangleJ3D from the given array of 3 points specified in screen coordinates.voidsetPoints(int x1, int y1, int x2, int y2, int x3, int y3)Sets TriangleJ3D from 3 points specified in screen coordinates.voidsetStyle(int style)Set the drawing style of the triangle.voidsetZValue(double zValue)Set the Z value of the triangle.java.lang.ObjecttoDrawable(DisplayImpl display)Make the TriangleJ3D into aShape3D.
-
-
-
Field Detail
-
POINT
public static final int POINT
fill style POINT- See Also:
- Constant Field Values
-
LINE
public static final int LINE
fill style LINE- See Also:
- Constant Field Values
-
FILL
public static final int FILL
fill style FILL- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TriangleJ3D
public TriangleJ3D()
Simple constructor which makes a zero size triangle at (0, 0) coloured white. Set more meaningful values after construction.
-
TriangleJ3D
public TriangleJ3D(int style, int x1, int y1, int x2, int y2, int x3, int y3, float[] colour, double zValue, double thickness)Constructs a TriangleJ3D from 3 points specified in screen coordinates.- Parameters:
style- one of- TriangleJ3D.FILL,
- TriangleJ3D.LINE,
- TriangleJ3D.POINT.
x1- x screen coordinate of the first point.y1- y screen coordinate of the first point.x2- x screen coordinate of the second point.y2- y screen coordinate of the second point.x3- x screen coordinate of the third point.y3- y screen coordinate of the third point.colour- red green blue triple; each value in [0.0, 1.0].zValue- Virtual world value; larger z is in front.thickness- used for outline thickness and point size.
-
TriangleJ3D
public TriangleJ3D(int style, int[][] points, float[] colour, double zValue, double thickness)Constructs a TriangleJ3D from 3 points specified in screen coordinates.- Parameters:
style- one of- TriangleJ3D.FILL,
- TriangleJ3D.LINE,
- TriangleJ3D.POINT.
points- 2 rows with each column containing a point in screen coordinates; requires 3 points (columns).colour- red green blue triple; each value in [0.0, 1.0].zValue- Virtual world value; larger z is in front.thickness- used for outline thickness and point size.
-
-
Method Detail
-
setPoints
public void setPoints(int x1, int y1, int x2, int y2, int x3, int y3)Sets TriangleJ3D from 3 points specified in screen coordinates.- Parameters:
x1- x screen coordinate of the first point.y1- y screen coordinate of the first point.x2- x screen coordinate of the second point.y2- y screen coordinate of the second point.x3- x screen coordinate of the third point.y3- y screen coordinate of the third point.
-
setPoints
public void setPoints(int[][] points)
Sets TriangleJ3D from the given array of 3 points specified in screen coordinates.- Parameters:
points- 2 rows with each column containing a point in screen coordinates; requires 3 points (columns).
-
setStyle
public void setStyle(int style)
Set the drawing style of the triangle.- Parameters:
style- one of- TriangleJ3D.FILL,
- TriangleJ3D.LINE,
- TriangleJ3D.POINT.
-
setColour
public void setColour(float[] colour)
Set the colour of the triangle.- Parameters:
colour- red green blue triple; each value in [0.0, 1.0].
-
setZValue
public void setZValue(double zValue)
Set the Z value of the triangle.- Parameters:
zValue- Virtual world value; larger zValue is in front.
-
toDrawable
public java.lang.Object toDrawable(DisplayImpl display)
Make the TriangleJ3D into aShape3D.- Specified by:
toDrawablein interfaceScreenAnnotation- Parameters:
display- the VisAD display for this Triangle.- Returns:
- the Triangle description as a Shape3D object.
-
-
DMelt 3.0 © DataMelt by jWork.ORG