|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jwo.landserf.structure.VectorObject
Class for storing single vector objects (points, lines or areas). Stores (x,y) pairs and object type (POINT, LINE, AREA, FLOW and TIN) and the object's single attribute.
Field Summary | |
static int |
AREA
Area vector type. |
static int |
FLOW
Flow vector type. |
static int |
LINE
Line vector type. |
static int |
POINT
Point vector type. |
static int |
TIN
Triangulated Irregular Network vector type. |
Constructor Summary | |
VectorObject()
Constructs a minimal vector object. |
|
VectorObject(float[] x,
float[] y,
int n,
int type,
float attrib)
Constructs a vector object based on coordinate arrays. |
|
VectorObject(VectorObject oldVectorObject)
Constructs a copy of an existing vector object. |
Method Summary | |
float |
getAttribute()
Reports the attribute of the vector object. |
Vector |
getIntersections(VectorObject otherObject)
Reports whether this object intersects with the given object. |
Vector |
getIntersections(VectorObject otherObject,
boolean interior)
Reports the intersections beteen this and the given object. |
JWRectangle |
getMER()
Reports the minimum enclosing rectangle of a vector object. |
int |
getNumCoords()
Returns the number of coordinate in the vector object. |
int |
getType()
Reports the type of vector object (POINT, LINE etc.). |
float |
getVersion()
Reports the version of the object. |
float[] |
getX()
Returns the array of X coordinates making up the vector object. |
float[] |
getY()
Returns the array of Y coordinates making up the vector object. |
float[] |
getZ()
Returns the array of Z coordinates making up the vector object. |
void |
initZ()
Initialise the 'z' coordinates of the vector. |
boolean |
replaceFirstCoord(float xCoord,
float yCoord)
Replaces the first coordinate pair with the given pair of coordinates. |
boolean |
replaceLastCoord(float xCoord,
float yCoord)
Replaces the last coordinate pair with the given pair of coordinates. |
void |
reverse()
Reveses the order of coordinates making up the object. |
void |
setAttribute(float attribute)
Sets the attribute associated with the vector object. |
void |
setNumCoords(int numCoords)
Sets the number of coordinate in the vector object to a given value. |
void |
setType(int type)
Sets the type of vector object (POINT, LINE etc.). |
void |
setVersion(float version)
Sets the version number of the object. |
void |
setX(float[] x)
Stores an array of X coordinates making up the vector object. |
void |
setY(float[] y)
Stores an array of Y coordinates making up the vector object. |
void |
setZ(float[] z)
Stores an array of Z coordinates making up the vector object. |
Vector |
split(VectorObject otherObject)
Splits this object into two new ones around the given object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int POINT
public static final int LINE
public static final int AREA
public static final int FLOW
public static final int TIN
Constructor Detail |
public VectorObject()
public VectorObject(VectorObject oldVectorObject)
oldVectorObject
- Vector object to copy.public VectorObject(float[] x, float[] y, int n, int type, float attrib)
x
- x coordinate array.y
- y coordinate array.n
- Number of coordinates in object.type
- Type of vector object (POINT, LINE, etc.)attrib
- Attribute associated with vector object.Method Detail |
public void initZ()
public float[] getX()
public void setX(float[] x)
x
- X coordinate array.public float[] getY()
public void setY(float[] y)
y
- Y coordinate array.public float[] getZ()
public void setZ(float[] z)
z
- Z coordinate array.public int getNumCoords()
public void setNumCoords(int numCoords)
numCoords
- Number of coordinates in vector object.public int getType()
public void setType(int type)
type
- Vector object type.public float getAttribute()
public void setAttribute(float attribute)
attribute
- Vector object attribute.public JWRectangle getMER()
public Vector split(VectorObject otherObject)
otherObject
- Vector object (point) about which to split.
public void reverse()
public boolean replaceFirstCoord(float xCoord, float yCoord)
xCoord
- xCoordinate to replace existing one.yCoord
- yCoordinate to replace existing one.
public boolean replaceLastCoord(float xCoord, float yCoord)
xCoord
- xCoordinate to replace existing one.yCoord
- yCoordinate to replace existing one.
public Vector getIntersections(VectorObject otherObject)
otherObject
- Vector object with which to make comparison.
public Vector getIntersections(VectorObject otherObject, boolean interior)
otherObject
- Vector object with which to make comparison.interior
- Ignores endpoints of lines if true.
public float getVersion()
public void setVersion(float version)
version
- Version number of the vector object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |