public class PirolPoint extends Sortable
Modifier and Type | Field and Description |
---|---|
protected double[] |
coordinates |
protected int |
dimension |
protected int |
index |
protected boolean |
marked |
static PirolPoint |
NULLPUNKT |
protected boolean |
scaled |
protected ScaleChanger |
scaler |
Constructor and Description |
---|
PirolPoint()
For classLoaders
|
PirolPoint(double[] coords) |
PirolPoint(double[] coords,
int index) |
PirolPoint(double[] coords,
int index,
ScaleChanger scaler) |
PirolPoint(double[] coords,
int index,
ScaleChanger scaler,
boolean prescaled) |
Modifier and Type | Method and Description |
---|---|
static PirolPoint |
clone(PirolPoint pkt)
Method to create a deep copy of the given punkt object, that doesn't share any references with the original
|
PirolPoint |
clonePunkt()
Method to create a deep copy of the calling punkt object, that doesn't share any references with the original
|
int |
compareTo(java.lang.Object arg0) |
static PirolPoint |
createVector(PirolPoint from,
PirolPoint to)
creates a punkt object that represents a vector (x,y(,z)) that shows the direction
that leads from point "from" to point "to".
|
static double |
distanceBetween(PirolPoint p1,
PirolPoint p2)
calculates the distance of point p1 to the other point p2.
|
double |
distanceTo(PirolPoint p)
calculates the distance of
this point to the other point. |
boolean |
equals(java.lang.Object obj) |
double |
getCoordinate(int nr)
get the
nr -th coordinate. |
double[] |
getCoordinates() |
int |
getDimension() |
int |
getIndex() |
int |
getSortFor() |
double |
getX()
get 0-th coordinate
|
double |
getY()
get 1-st coordinate
|
double |
getZ()
get 2-nd coordinate
|
boolean |
isMarked()
check if
marked was set or not |
boolean |
liegtAuf(PirolPoint p) |
void |
scale() |
void |
setCoordinate(double newCoord,
int nr)
set the
nr -th coordinate. |
void |
setCoordinates(double[] coordinates) |
void |
setIndex(int index) |
void |
setMarked(boolean marked)
set boolean flag of the object, to e.g. mark if this point was already passed or whatever.
|
void |
setScaler(ScaleChanger scaler) |
void |
setSortFor(int sortFor) |
void |
setX(double val)
set the 0-th coordinate
|
void |
setY(double val)
set the 1-st coordinate
|
void |
setZ(double val)
set the 2-nd coordinate
|
com.vividsolutions.jts.geom.Coordinate |
toCoordinate() |
static com.vividsolutions.jts.geom.Coordinate |
toCoordinate(PirolPoint p) |
java.lang.String |
toString() |
void |
unScale() |
protected double[] coordinates
protected int dimension
protected int index
public static final PirolPoint NULLPUNKT
protected ScaleChanger scaler
protected boolean scaled
protected boolean marked
public PirolPoint()
public PirolPoint(double[] coords)
public PirolPoint(double[] coords, int index)
public PirolPoint(double[] coords, int index, ScaleChanger scaler, boolean prescaled)
public PirolPoint(double[] coords, int index, ScaleChanger scaler)
public static PirolPoint createVector(PirolPoint from, PirolPoint to)
from
- source points of the vectorto
- destination point of the vectorpublic static PirolPoint clone(PirolPoint pkt)
pkt
- the punkt object to clonepublic PirolPoint clonePunkt()
public boolean isMarked()
marked
was set or notmarked
is truepublic void setMarked(boolean marked)
marked
- boolean value to set the internal flag topublic boolean liegtAuf(PirolPoint p)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int getSortFor()
getSortFor
in class Sortable
public void setSortFor(int sortFor)
setSortFor
in class Sortable
public void setScaler(ScaleChanger scaler)
public void scale() throws java.lang.RuntimeException
java.lang.RuntimeException
public void unScale() throws java.lang.RuntimeException
java.lang.RuntimeException
public double[] getCoordinates()
public void setCoordinates(double[] coordinates)
public int getIndex()
public void setIndex(int index)
public int getDimension()
public double getCoordinate(int nr) throws java.lang.RuntimeException
nr
-th coordinate. This method is used within getX(), getY(), getZ().nr
-th coordinatejava.lang.RuntimeException
- if the point has less coordniates than nr
or if nr
is less than zeropublic void setCoordinate(double newCoord, int nr)
nr
-th coordinate. This method is used within setX(), setY(), setZ().newCoord
- new Coordinatenr
- number of coordinate to setpublic double getX() throws java.lang.RuntimeException
java.lang.RuntimeException
public double getY() throws java.lang.RuntimeException
java.lang.RuntimeException
public double getZ() throws java.lang.RuntimeException
java.lang.RuntimeException
public void setX(double val)
val
- 0-th coordinatepublic void setY(double val)
val
- 1-st coordinatepublic void setZ(double val)
val
- 2-nd coordinatepublic double distanceTo(PirolPoint p) throws java.lang.RuntimeException
this
point to the other point.
The distance will be calculated in as many dimensions as both points have.
If the two points have a different amount of coordinates, this will happen: int checkDim = Math.min(this.dimension, p.getDimension());
p
- the other pointjava.lang.RuntimeException
public static double distanceBetween(PirolPoint p1, PirolPoint p2) throws java.lang.RuntimeException
int checkDim = Math.min(this.dimension, p.getDimension());
p1
- one pointp2
- the other pointjava.lang.RuntimeException
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(java.lang.Object arg0)
public com.vividsolutions.jts.geom.Coordinate toCoordinate() throws java.lang.RuntimeException
java.lang.RuntimeException
public static com.vividsolutions.jts.geom.Coordinate toCoordinate(PirolPoint p) throws java.lang.RuntimeException
java.lang.RuntimeException