geometry
Interface Geometry

All Known Implementing Classes:
AffineSpace, ImplicitGeometry, Point

public interface Geometry

A d-dimensional manifold embedded in n-dimensional euclidean space. This is used to define the geometry of a cell in a geometric complex. The geometry of a cell of dimension d contains all information necessary to embed this cell into n-dimensional space. The geometries of the boundary-cells will completely determine the shape of the cell.

Author:
karsten

Method Summary
 AffineSpace affineClosure()
          Computes the smallest affine space, which contains this geometry
 boolean canBeContainedIn(Geometry other)
          Tests, if this geometry knows how to test if is contained in another geometry.
 boolean canContain(Geometry other)
          Tests, if this geometry knows how to test if it contains another geometry.
 boolean canIntersect(Geometry other)
          Tests, if this geometry knows how to intersect itself with another geometry.
 boolean contains(Geometry other)
          Tests, if this geometry contains another geometry.
 int dim()
          Returns the dimension of this geometry.
 Vector getNormal(Point p)
          Returns a normal vector onto a hypersurface in a given point (only possible if dim()+1 == outerDim())
 Point getOrigin()
          The origin of the local coordinate system.
 Geometry getRandomRay(Point origin)
          Construct a random one-dimensional submanifold, containing a given point.
 Geometry intersection(Geometry other)
          Intersects this geometry with another.
 boolean isContainedIn(Geometry other)
          Tests, if this geometry is contained in another geometry.
 Point localization(Point p)
          Converts a point (which is contained in the geometry) to coordinates local to the geometry.
 int outerDim()
          Returns the dimension of the euclidean space containing this geometry.
 java.awt.Shape toShape(java.awt.geom.AffineTransform transform)
          Returns the cell as Shape (only possible for 2-dimensional Complexes).
 

Method Detail

dim

public int dim()
Returns the dimension of this geometry.


outerDim

public int outerDim()
Returns the dimension of the euclidean space containing this geometry.


affineClosure

public AffineSpace affineClosure()
Computes the smallest affine space, which contains this geometry

Returns:
the affine closure of this geometry

toShape

public java.awt.Shape toShape(java.awt.geom.AffineTransform transform)
Returns the cell as Shape (only possible for 2-dimensional Complexes).

Returns:
intersection as Shape

getNormal

public Vector getNormal(Point p)
Returns a normal vector onto a hypersurface in a given point (only possible if dim()+1 == outerDim())

Parameters:
p - the starting point of the normal vector
Returns:
a vector orthogonal to the space in the point p

canContain

public boolean canContain(Geometry other)
Tests, if this geometry knows how to test if it contains another geometry. If the other geometry is a point, this has to be true.

Parameters:
other - another geometry
Returns:
true if the method contains will work

contains

public boolean contains(Geometry other)
Tests, if this geometry contains another geometry. If this geometry doesn't know, how to test this, it will throw an UnsupportedOperationException. This will happen only if canContain returns false.

Parameters:
other - another geometry
Returns:
true iff other is contained in the geometry.

canBeContainedIn

public boolean canBeContainedIn(Geometry other)
Tests, if this geometry knows how to test if is contained in another geometry.

Parameters:
other - another geometry
Returns:
true if the method isContainedIn will work

isContainedIn

public boolean isContainedIn(Geometry other)
Tests, if this geometry is contained in another geometry. If this geometry doesn't know, how to test this, it will throw an UnsupportedOperationException. This will happen only if canBeContainedIn returns false.

Parameters:
other - another geometry
Returns:
true iff this geometry contains other.

canIntersect

public boolean canIntersect(Geometry other)
Tests, if this geometry knows how to intersect itself with another geometry.

Parameters:
other - another geometry, which is to be intersected
Returns:
true if the method intersection will work

intersection

public Geometry intersection(Geometry other)
Intersects this geometry with another. The intersection will be null, if the two geometries do not intersect. If this geometry doesn't know, how to intersect itself with the other geometry, it will throw an UnsupportedOperationException. This will happen only if canIntersect returns false.

Parameters:
other - another geometry, which is to be intersected
Returns:
the intersection of the two geometries

localization

public Point localization(Point p)
Converts a point (which is contained in the geometry) to coordinates local to the geometry. The result will be a point containing dim() coordinates. The dimension of this geometry has to be nonzero.

Parameters:
p - a point contained in this geometry
Returns:
local coordinates of this point

getOrigin

public Point getOrigin()
The origin of the local coordinate system.

Returns:
the point whose localization is zero.

getRandomRay

public Geometry getRandomRay(Point origin)
Construct a random one-dimensional submanifold, containing a given point. The point will become the origin of the compuded submanifold. The dimension of this geometry has to be nonzero.

Parameters:
origin - a point contained in this geometry
Returns:
a one-dimensional geometry, contained in this geometry, and containing the given origin