Package jmri.jmrix.rps
Class Region
java.lang.Object
jmri.jmrix.rps.Region
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.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) GeneralPath(package private) final javax.vecmath.Point3d[] -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
path
-
points
-
-
Constructor Details
-
Region
-
Region
Ctor from a string like "(0,0,0);(1,0,0);(1,1,0);(0,1,0)" .- Parameters:
s- construction string.
-
-
Method Details
-
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
-
toString
-
isInside
-
equals
-
hashCode
-