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 booleanequals(java.lang.Object ro)java.awt.ShapegetPath()Provide Java2D access to the shape of this region.inthashCode()(package private) voidinitPath(javax.vecmath.Point3d[] points)booleanisInside(javax.vecmath.Point3d p)java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
isInside
public boolean isInside(javax.vecmath.Point3d p)
-
equals
public boolean equals(java.lang.Object ro)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-