public class QuadrilateralJ3D extends Object implements ScreenAnnotation
Modifier and Type | Field and Description |
---|---|
static int |
FILL
fill style FILL
|
static int |
LINE
fill style LINE
|
static int |
POINT
fill style POINT
|
Constructor and Description |
---|
QuadrilateralJ3D()
Simple constructor which makes a zero size "box" at (0, 0)
coloured white.
|
QuadrilateralJ3D(int style,
int[][] points,
float[] colour,
double zValue,
double thickness)
Constructor to make an arbitrary rectangle with the given
specifications; it should not be self intersecting.
|
QuadrilateralJ3D(int style,
int x,
int y,
int width,
int height,
float[] colour,
double zValue,
double thickness)
Constructor to make an upright "box" with the given specifications;
the box should not be self intesecting.
|
QuadrilateralJ3D(int style,
int x1,
int y1,
int x2,
int y2,
int x3,
int y3,
int x4,
int y4,
float[] colour,
double zValue,
double thickness)
Constructor to make an arbitrary rectangle with the given
specifications; it should not be self intersecting.
|
Modifier and Type | Method and Description |
---|---|
void |
setColour(float[] colour)
Set the colour for the quadrilateral.
|
void |
setLocation(int x,
int y)
Applies a shift to the quadrilateral to place the first point
on the given coordinates.
|
void |
setPoints(int[][] points)
Sets the points for an arbitrary quadrilateral; should not
be self intersecting.
|
void |
setPoints(int x,
int y,
int width,
int height)
Makes an upright "box".
|
void |
setPoints(int x1,
int y1,
int x2,
int y2,
int x3,
int y3,
int x4,
int y4)
Sets the 4 points for an arbitrary quadrilateral; should not
be self intersecting.
|
void |
setSize(int width,
int height)
Constructs a rectangular box using the existing first point
as the top left point and the input width and height.
|
void |
setStyle(int style)
Set the drawing style of the quadrilateral.
|
void |
setThickness(double thickness)
Set the thickness for the quadrilateral.
|
void |
setZValue(double zValue)
Set the Z value for the quadrilateral.
|
Object |
toDrawable(DisplayImpl display)
Make the QuadrilateralJ3D into a
Shape3D . |
public static final int POINT
public static final int LINE
public static final int FILL
public QuadrilateralJ3D()
public QuadrilateralJ3D(int style, int x, int y, int width, int height, float[] colour, double zValue, double thickness)
style
- one of x
- top left x value in screen coordinates.y
- top left y value in screen coordinates.width
- width, in pixels, of the "box".height
- height, in pixels, of the "box".colour
- red, green blue triple each in the range [0.0, 1.0].zValue
- Virtual world value - larger z is closer to eye.thickness
- used for outline thickness and point size.public QuadrilateralJ3D(int style, int[][] points, float[] colour, double zValue, double thickness)
style
- one of points
- 2 rows with each column containing a point
in screen coordinates; requires 4 points (columns).colour
- red, green blue triple each in the range [0.0, 1.0]zValue
- Virtual world value - larger z is closer to eye.thickness
- used for outline thickness and point size.public QuadrilateralJ3D(int style, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, float[] colour, double zValue, double thickness)
style
- one of 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.x4
- x screen coordinate of the fourth point.y4
- y screen coordinate of the fourth point.colour
- red, green blue triple each in the range [0.0, 1.0].zValue
- Virtual world value - larger z is closer to eye.thickness
- used for outline thickness and point size.public void setStyle(int style)
style
- one of public void setLocation(int x, int y)
Expects a "box" i.e. a vertically aligned rectangle with points enumerated clockwise. This sets top left to (x, y) with other points adjusted accordingly. If it is not a "box" then all points are shifted as though moving the first point to (x, y).
x
- new top left x pixel value.y
- new top left y pixel value.public void setSize(int width, int height)
width
- width, in pixels, of the "box".height
- height, in pixels, of the "box".public void setPoints(int[][] points)
points
- 2 rows with each column containing a point
in screen coordinates; requires 4 points (columns).public void setPoints(int x, int y, int width, int height)
x
- top left x value in screen coordinates.y
- top left y value in screen coordinates.width
- width, in pixels, of the "box".height
- height, in pixels, of the "box".public void setPoints(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
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.x4
- x screen coordinate of the fourth point.y4
- y screen coordinate of the fourth point.public void setColour(float[] colour)
colour
- red, green blue triple each in the range [0.0, 1.0]public void setZValue(double zValue)
zValue
- Virtual world value - larger z is closer to eye.public void setThickness(double thickness)
thickness
- used for outline thickness and point size.public Object toDrawable(DisplayImpl display)
Shape3D
.toDrawable
in interface ScreenAnnotation
display
- the VisAD display for this Quadrilateral.Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.