|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openjump.core.apitools.comparisonandsorting.Sortable
org.openjump.core.graph.pirolProject.PirolPoint
public class PirolPoint
Base class for objects that describe an n-dimensional point. There are derived classes e.g. to suit the requirements of a triangulation or an interpolation. Offers methods e.g. to determine distances between different punkt objects or to mark and unmark punkt objects. punkt objects implement Sortable and have a choseable natural order (implement Comparable), so they can be sorted with the tools from the Java Collection Framework.
de.fhOsnabrueck.jump.pirol.utilities.PirolEdge,
modified: [sstein]: 16.Feb.2009 changed logger-entries to comments| Field Summary | |
|---|---|
protected double[] |
coordinates
|
protected int |
dimension
|
protected int |
index
|
protected boolean |
marked
|
static PirolPoint |
NULLPUNKT
|
protected boolean |
scaled
|
protected ScaleChanger |
scaler
|
| Fields inherited from class org.openjump.core.apitools.comparisonandsorting.Sortable |
|---|
sortFor |
| Constructor Summary | |
|---|---|
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)
|
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double[] coordinates
protected int dimension
protected int index
public static final PirolPoint NULLPUNKT
protected ScaleChanger scaler
protected boolean scaled
protected boolean marked
| Constructor Detail |
|---|
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)
| Method Detail |
|---|
public static PirolPoint createVector(PirolPoint from,
PirolPoint to)
from - source points of the vectorto - destination point of the vector
public static PirolPoint clone(PirolPoint pkt)
pkt - the punkt object to clone
public PirolPoint clonePunkt()
public boolean isMarked()
marked was set or not
marked 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.Objectpublic int getSortFor()
getSortFor in class Sortablepublic void setSortFor(int sortFor)
setSortFor in class Sortablepublic void setScaler(ScaleChanger scaler)
public void scale()
throws java.lang.RuntimeException
java.lang.RuntimeException
public void unScale()
throws java.lang.RuntimeException
java.lang.RuntimeExceptionpublic 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 coordinate
java.lang.RuntimeException - if the point has less coordniates than nr or if nr is less than zero
public void setCoordinate(double newCoord,
int nr)
nr-th coordinate. This method is used within setX(), setY(), setZ().
newCoord - new Coordinatenr - number of coordinate to set
public 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.RuntimeExceptionpublic void setX(double val)
val - 0-th coordinatepublic void setY(double val)
val - 1-st coordinatepublic void setZ(double val)
val - 2-nd coordinate
public 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 point
java.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 point
java.lang.RuntimeExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(java.lang.Object arg0)
compareTo in interface java.lang.ComparablecompareTo in class Sortable
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||