Package jmri.jmrix.rps
Class Region
- java.lang.Object
-
- jmri.jmrix.rps.Region
-
@Immutable public class Region extends java.lang.Object
Represent a region in space for the RPS system.The region is specified by a right-handed set of points.
Regions are immutable once created.
This initial implementation of a Region is inherently 2-dimensional, deferring use of the 3rd (Z) dimension to a later implementation. It uses a Java2D GeneralPath to handle the inside/outside calculations.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object ro)
java.awt.Shape
getPath()
Provide Java2D access to the shape of this region.int
hashCode()
(package private) void
initPath(javax.vecmath.Point3d[] points)
boolean
isInside(javax.vecmath.Point3d p)
java.lang.String
toString()
-
-
-
Method Detail
-
getPath
public java.awt.Shape getPath()
Provide Java2D access to the shape of this region.This should provide a copy of the GeneralPath path, to keep the underlying object immutable, but by returning a Shape type hopefully we achieve the same result with a little better performance. Please don't assume you can cast and modify this.
- Returns:
- the path.
-
initPath
void initPath(javax.vecmath.Point3d[] points)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isInside
public boolean isInside(javax.vecmath.Point3d p)
-
equals
public boolean equals(java.lang.Object ro)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-