org.geotools.geometry.iso.primitive
Class OrientablePrimitiveImpl

java.lang.Object
  extended by org.geotools.geometry.iso.root.GeometryImpl
      extended by org.geotools.geometry.iso.primitive.PrimitiveImpl
          extended by org.geotools.geometry.iso.primitive.OrientablePrimitiveImpl
All Implemented Interfaces:
java.io.Serializable, org.opengis.geometry.Geometry, org.opengis.geometry.primitive.OrientablePrimitive, org.opengis.geometry.primitive.Primitive, org.opengis.geometry.TransfiniteSet
Direct Known Subclasses:
OrientableCurveImpl, OrientableSurfaceImpl

public abstract class OrientablePrimitiveImpl
extends PrimitiveImpl
implements org.opengis.geometry.primitive.OrientablePrimitive

Orientable primitives (ISO 19107 v5 figure 10) are those that can be mirrored into new geometric objects in terms of their internal local coordinate systems (manifold charts). For curves, the orientation reflects the direction in which the curve is traversed, that is, the sense of its parameterization. When used as boundary curves, the surface being bounded is to the "left" of the oriented curve. For surfaces, the orientation reflects from which direction the local coordinate system can be viewed as right handed, the "top" or the surface being the direction of a completing z-axis that would form a right-handed system. When used as a boundary surface, the bounded solid is "below" the surface. The orientation of points and solids has no immediate geometric interpretation in 3-dimensional space. OrientablePrimitive objects are essentially references to geometric primitives that carry an "orientation" reversal flag (either "+" or "-") that determines whether this primitive agrees or disagrees with the orientation of the referenced object. NOTE There are several reasons for subclassing the “positive” primitives under the orientable primitives. First is a matter of the semantics of subclassing. Subclassing is assumed to be a “is type of” hierarchy. In the view used, the “positive” primitive is simply the orientable one with the positive orientation. If the opposite view were taken, and orientable primitives were subclassed under the “positive” primitive, then by subclassing logic, the “negative” primitive would have to hold the same sort of geometric description that the “positive” primitive does. The only viable solution would be to separate “negative” primitives under the geometric root as being some sort of reference to their opposite. This adds a great deal of complexity to the subclassing tree. To minimize the number of objects and to bypass this logical complexity, positively oriented primitives are self-referential (are instances of the corresponding primitive subtype) while negatively oriented primitives are not.

Version:
Abstract Specification V5
Author:
Jackson Roehrig & Sanjay Jena
See Also:
Serialized Form

Field Summary
protected  org.opengis.geometry.primitive.OrientablePrimitive proxy
          Oriented Association (from Specification of OrientablePrimitive) Each Primitive of dimension 1 or 2 is associated to two OrientablePrimitives, one for each possible orientation.
 
Fields inherited from class org.geotools.geometry.iso.primitive.PrimitiveImpl
complex, containedPrimitive, containingPrimitive
 
Fields inherited from class org.geotools.geometry.iso.root.GeometryImpl
crs, percision
 
Constructor Summary
protected OrientablePrimitiveImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
          Constructor for empty Orientable Primitive
protected OrientablePrimitiveImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs, java.util.Set<org.opengis.geometry.primitive.Primitive> containedPrimitive, java.util.Set<org.opengis.geometry.primitive.Primitive> containingPrimitive, java.util.Set<org.opengis.geometry.complex.Complex> complex)
          Constructor
 
Method Summary
protected abstract  org.opengis.geometry.primitive.OrientablePrimitive createProxy()
           
 int getOrientation()
          Orientable primitives are often denoted by a sign (for the orientation) and a base geometry (curve or surface).
 org.opengis.geometry.primitive.Primitive getPrimitive()
           
 org.opengis.geometry.primitive.OrientablePrimitive[] getProxy()
          Returns an array with two orientable primitives, whereas the first one is "this" object and the second one the field proxy
 
Methods inherited from class org.geotools.geometry.iso.primitive.PrimitiveImpl
addComplex, addContainedPrimitive, addContainingPrimitive, getBoundary, getComplexes, getComposite, getContainedPrimitives, getContainingPrimitives, getMaximalComplex
 
Methods inherited from class org.geotools.geometry.iso.root.GeometryImpl
castToGeometryImpl, castToGeometryImpl, clone, contains, contains, cRelate, crosses, difference, disjoint, distance, equals, getBuffer, getCentroid, getClosure, getConvexHull, getCoordinateDimension, getCoordinateReferenceSystem, getDimension, getDistance, getEnvelope, getMbRegion, getPositionFactory, getPrecision, getRepresentativePoint, intersection, intersects, isCycle, isMutable, overlaps, relate, symmetricDifference, toImmutable, touches, transform, transform, union, within
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opengis.geometry.primitive.Primitive
getBoundary, getComplexes, getComposite, getContainedPrimitives, getContainingPrimitives
 
Methods inherited from interface org.opengis.geometry.Geometry
clone, distance, getBuffer, getCentroid, getClosure, getConvexHull, getCoordinateDimension, getCoordinateReferenceSystem, getDimension, getEnvelope, getMaximalComplex, getMbRegion, getPrecision, getRepresentativePoint, isCycle, isMutable, isSimple, toImmutable, transform, transform
 
Methods inherited from interface org.opengis.geometry.TransfiniteSet
contains, contains, difference, equals, intersection, intersects, symmetricDifference, union
 

Field Detail

proxy

protected org.opengis.geometry.primitive.OrientablePrimitive proxy
Oriented Association (from Specification of OrientablePrimitive) Each Primitive of dimension 1 or 2 is associated to two OrientablePrimitives, one for each possible orientation. Primitive::proxy [2] : Reference; OrientablePrimitive::primitive [1] : Reference; For curves and surfaces, there are exactly two orientable primitives for each geometric object. Primitive: (proxy ? notEmpty) = (dimension = 1 or dimension = 2); OrientablePrimitive: a, b :OrientablePrimitive ((a.primitive=b.primitive)and(a.orientation=b.orientation)) implies a=b; As the positive orientable primitive is self-referencing to the primitive, the field proxy has only one value, which is the opposite orientable primitive. See the method OrientablePrimitive[] getProxy()

Constructor Detail

OrientablePrimitiveImpl

protected OrientablePrimitiveImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Constructor for empty Orientable Primitive

Parameters:
crs -

OrientablePrimitiveImpl

protected OrientablePrimitiveImpl(org.opengis.referencing.crs.CoordinateReferenceSystem crs,
                                  java.util.Set<org.opengis.geometry.primitive.Primitive> containedPrimitive,
                                  java.util.Set<org.opengis.geometry.primitive.Primitive> containingPrimitive,
                                  java.util.Set<org.opengis.geometry.complex.Complex> complex)
Constructor

Parameters:
crs -
containedPrimitive -
containingPrimitive -
complex -
Method Detail

createProxy

protected abstract org.opengis.geometry.primitive.OrientablePrimitive createProxy()
Returns:
a new orientable primitive with negative orientation

getProxy

public org.opengis.geometry.primitive.OrientablePrimitive[] getProxy()
Returns an array with two orientable primitives, whereas the first one is "this" object and the second one the field proxy

Specified by:
getProxy in interface org.opengis.geometry.primitive.Primitive
Specified by:
getProxy in class PrimitiveImpl
Returns:
an array OrientablePrimitive[2] with the positive and the negative orientable primitive

getOrientation

public int getOrientation()
Orientable primitives are often denoted by a sign (for the orientation) and a base geometry (curve or surface). The sign datatype is defined in ISO 19103. If "c" is a curve, then "<+, c>" is its positive orientable curve and "<-, c>" is its negative orientable curve. In most cases, leaving out the syntax for record "< , >" does not lead to confusion, so "<+, c>" may be written as "+c" or simply "c", and "<-, c>" as "-c". Curve space arithmetic can be performed if the curves align properly, so that: For c, d : OrientableCurves such that c.endPoint = d.startPoint then ( c + d ) ==: CompositeCurve = < c, d >

Specified by:
getOrientation in interface org.opengis.geometry.primitive.OrientablePrimitive
Returns:
1 if positive and -1 if negative

getPrimitive

public org.opengis.geometry.primitive.Primitive getPrimitive()
Specified by:
getPrimitive in interface org.opengis.geometry.primitive.OrientablePrimitive


Copyright © 1996-2010 Geotools. All Rights Reserved.