org.geotools.geometry.iso.primitive
Class PrimitiveImpl

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

public abstract class PrimitiveImpl
extends GeometryImpl
implements org.opengis.geometry.primitive.Primitive

Primitive is the abstract root class of the geometric primitives. Its main purpose is to define the basic "boundary" operation that ties the primitives in each dimension together. A geometric primitive is a geometric object that is not decomposed further into other primitives in the system. This includes curves and surfaces, even though they are composed of curve segments and surface patches, respectively. This composition is a strong aggregation: curve segments and surface patches cannot exist outside the context of a primitive. NOTE Most geometric primitives are decomposable infinitely many times. Adding a centre point to a line may split that line into two separate lines. A new curve drawn across a surface may divide that surface into two parts, each of which is a surface. This is the reason that the normal definition of primitive as "non-decomposable" is not plausible in a geometry model - the only non-decomposable object in geometry is a point. Any geometric object that is used to describe a feature is a collection of geometric primitives. A collection of geometric primitives may or may not be a geometric complex. Geometric complexes have additional properties such as closure by boundary operations and mutually exclusive component parts. Primitive and Complex share most semantics, in the meaning of operations, attributes and associations. There is an exception in that a Primitive shall not contain its boundary (except in the trivial case of Point where the boundary is empty), while a Complex shall contain its boundary in all cases. This means that if an instantiated object implements Object operations both as Primitive and as a Complex, the semantics of each set theoretic operation is determined by the its name resolution. Specifically, for a particular object such as CompositeCurve, Primitive::contains (returns FALSE for end points) is different from Complex::contains (returns TRUE for end points). Further, if that object is cast as a Primitive value and as a Complex value, then the two values need not be equal as Objects.

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

Field Summary
protected  java.util.Set<org.opengis.geometry.complex.Complex> complex
          A Primitive may be in several Complexes.
protected  java.util.Set<org.opengis.geometry.primitive.Primitive> containedPrimitive
          The "Interior to" association associates Primitives which are by definition coincident with one another.
protected  java.util.Set<org.opengis.geometry.primitive.Primitive> containingPrimitive
          See containedPrimitive
 
Fields inherited from class org.geotools.geometry.iso.root.GeometryImpl
crs, percision
 
Constructor Summary
  PrimitiveImpl(org.opengis.referencing.crs.CoordinateReferenceSystem coordinateReferenceSystem)
           
protected PrimitiveImpl(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)
           
 
Method Summary
 void addComplex(ComplexImpl newComplex)
          Adds a new complex to the set of complexes containing this primitive
 void addContainedPrimitive(PrimitiveImpl newSuperelement)
          Adds a the super element where this object in contained in
 void addContainingPrimitive(PrimitiveImpl newSubelement)
          Adds a new subelement of same or lower dimension then this object.
abstract  org.opengis.geometry.primitive.PrimitiveBoundary getBoundary()
           
 java.util.Set<org.opengis.geometry.complex.Complex> getComplexes()
           
 org.opengis.geometry.complex.Composite getComposite()
           
 java.util.Set<org.opengis.geometry.primitive.Primitive> getContainedPrimitives()
           
 java.util.Set<org.opengis.geometry.primitive.Primitive> getContainingPrimitives()
           
 java.util.Set<org.opengis.geometry.complex.Complex> getMaximalComplex()
          As a set of primitives, a Complex may be contained as a set in another larger Complex, referred to as a "super complex" of the original.
abstract  org.opengis.geometry.primitive.OrientablePrimitive[] getProxy()
           
 
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.Geometry
clone, distance, getBuffer, getCentroid, getClosure, getConvexHull, getCoordinateDimension, getCoordinateReferenceSystem, getDimension, getEnvelope, 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

containedPrimitive

protected java.util.Set<org.opengis.geometry.primitive.Primitive> containedPrimitive
The "Interior to" association associates Primitives which are by definition coincident with one another. This allows applications to override the Set interpretation and its associated computational geometry, and declare one Primitive to be "interior to" another. This association should normally be empty when the Primitives are within a Complex, since in that case the boundary information is sufficient for most cases. Primitive::coincidentSubelement [0..n] : Reference Primitive::superElement [0..n] : Reference This association is constrained by the set theory operators and dimension operators defined at Object. Primitive: superElement=>includes(p: Primitive) = Object::contains (p) dimension() >= coincidentSubelement. dimension() NOTE This association should not be used when the two Primitives are not close to one another. The intent is to allow applications to compensate for inherent and unavoidable round off, truncation, and other mathematical problems indigenous to computer calculations. The fields containedPrimitive and containingPrimitive are unset per default


containingPrimitive

protected java.util.Set<org.opengis.geometry.primitive.Primitive> containingPrimitive
See containedPrimitive


complex

protected java.util.Set<org.opengis.geometry.complex.Complex> complex
A Primitive may be in several Complexes. This association may not be navigable in this direction (from primitive to complex), depending on the application schema. Primitive::complex [0..n] : Reference The field complex is unset per default

Constructor Detail

PrimitiveImpl

protected PrimitiveImpl(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)
Parameters:
crs -
containedPrimitive -
containingPrimitive -
complex -

PrimitiveImpl

public PrimitiveImpl(org.opengis.referencing.crs.CoordinateReferenceSystem coordinateReferenceSystem)
Method Detail

getContainingPrimitives

public java.util.Set<org.opengis.geometry.primitive.Primitive> getContainingPrimitives()
Specified by:
getContainingPrimitives in interface org.opengis.geometry.primitive.Primitive

getContainedPrimitives

public java.util.Set<org.opengis.geometry.primitive.Primitive> getContainedPrimitives()
Specified by:
getContainedPrimitives in interface org.opengis.geometry.primitive.Primitive

getComplexes

public java.util.Set<org.opengis.geometry.complex.Complex> getComplexes()
Specified by:
getComplexes in interface org.opengis.geometry.primitive.Primitive

getComposite

public org.opengis.geometry.complex.Composite getComposite()
Specified by:
getComposite in interface org.opengis.geometry.primitive.Primitive

addContainingPrimitive

public void addContainingPrimitive(PrimitiveImpl newSubelement)
Adds a new subelement of same or lower dimension then this object. This object contains the given subelement

Parameters:
newSubelement -

addContainedPrimitive

public void addContainedPrimitive(PrimitiveImpl newSuperelement)
Adds a the super element where this object in contained in

Parameters:
newSuperelement -

addComplex

public void addComplex(ComplexImpl newComplex)
Adds a new complex to the set of complexes containing this primitive

Parameters:
newComplex -

getMaximalComplex

public java.util.Set<org.opengis.geometry.complex.Complex> getMaximalComplex()
As a set of primitives, a Complex may be contained as a set in another larger Complex, referred to as a "super complex" of the original. A Complex is maximal if there is no such larger super complex. The operation "maximalComplex" shall return the set of maximal Complexes within which this Object is contained. Object::maximalComplex() : Set If the application schema used does not include Complex, then this operation shall return a NULL value. NOTE The usual semantics of maximal complexes does not allow any Primitive to be in more than one maximal complex, making it a strong aggregation. This is not an absolute, and depending on the semantics of the implementation, the association between Primitives and maximal Complexes could be many to many. From a programming point of view, this would be a difficult (but not impossible) dynamic structure to maintain, but as a static query-only structure, it could be quite useful in minimizing redundant data inherent in two representations of the same primitive geometric object.

Specified by:
getMaximalComplex in interface org.opengis.geometry.Geometry
Returns:
the set of maximal complexes or null

getBoundary

public abstract org.opengis.geometry.primitive.PrimitiveBoundary getBoundary()
Specified by:
getBoundary in interface org.opengis.geometry.Geometry
Specified by:
getBoundary in interface org.opengis.geometry.primitive.Primitive
Specified by:
getBoundary in class GeometryImpl

getProxy

public abstract org.opengis.geometry.primitive.OrientablePrimitive[] getProxy()
Specified by:
getProxy in interface org.opengis.geometry.primitive.Primitive


Copyright © 1996-2010 Geotools. All Rights Reserved.