edu.stanford.rsl.konrad.geometry.shapes.compound
Class CompoundShape

java.lang.Object
  extended by edu.stanford.rsl.konrad.geometry.AbstractShape
      extended by edu.stanford.rsl.konrad.geometry.shapes.compound.CompoundShape
All Implemented Interfaces:
Transformable, java.io.Serializable, java.lang.Iterable<AbstractShape>, java.util.Collection<AbstractShape>
Direct Known Subclasses:
LinearOctree

public class CompoundShape
extends AbstractShape
implements java.util.Collection<AbstractShape>

See Also:
Serialized Form

Constructor Summary
CompoundShape()
           
 
Method Summary
 boolean add(AbstractShape shape)
           
 boolean addAll(java.util.Collection<? extends AbstractShape> c)
           
 void applyTransform(Transform t)
          Applies the Transform t to the object.
 void clear()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection<?> c)
           
 PointND evaluate(PointND u)
          Returns the point on the shape at the internal position u.
 AbstractShape get(int i)
           
 int getDimension()
          Returns the external dimension of the shape.
 java.util.ArrayList<PointND> getHitsOnBoundingBox(AbstractCurve curve)
           
 int getInternalDimension()
          returns the internal dimension of the shape, i.e.
 PointND getMax()
           
 PointND getMin()
           
 PointND[] getRasterPoints(int number)
          Rasters the shape with a given number of points or less.
 java.util.ArrayList<PointND> intersect(AbstractCurve other)
          Returns the intersection points between the curve and the shape.
 boolean isBounded()
          Returns true if the shape is of limited space
 boolean isEmpty()
           
 java.util.Iterator<AbstractShape> iterator()
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection<?> c)
           
 boolean retainAll(java.util.Collection<?> c)
           
 int size()
           
 java.lang.Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 java.lang.String toString()
           
 
Methods inherited from class edu.stanford.rsl.konrad.geometry.AbstractShape
getHitsOnBoundingBox_slow
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

CompoundShape

public CompoundShape()
Method Detail

getDimension

public int getDimension()
Description copied from class: AbstractShape
Returns the external dimension of the shape.

Specified by:
getDimension in class AbstractShape
Returns:
the dimension

get

public AbstractShape get(int i)

getHitsOnBoundingBox

public java.util.ArrayList<PointND> getHitsOnBoundingBox(AbstractCurve curve)
Overrides:
getHitsOnBoundingBox in class AbstractShape

intersect

public java.util.ArrayList<PointND> intersect(AbstractCurve other)
Description copied from class: AbstractShape
Returns the intersection points between the curve and the shape. Returns null, if the intersection is empty.

Specified by:
intersect in class AbstractShape
Returns:
the intersection points.

isBounded

public boolean isBounded()
Description copied from class: AbstractShape
Returns true if the shape is of limited space

Specified by:
isBounded in class AbstractShape
Returns:
Boundedness of this shape.

getMax

public PointND getMax()
Overrides:
getMax in class AbstractShape
Returns:
the maximal corner of the bounding box.

getMin

public PointND getMin()
Overrides:
getMin in class AbstractShape
Returns:
the minimal corner of the bounding box.

add

public boolean add(AbstractShape shape)
Specified by:
add in interface java.util.Collection<AbstractShape>

getRasterPoints

public PointND[] getRasterPoints(int number)
Description copied from class: AbstractShape
Rasters the shape with a given number of points or less. If the shape is not bounded null is returned.

Specified by:
getRasterPoints in class AbstractShape
Parameters:
number - the number of points
Returns:
the raster points

applyTransform

public void applyTransform(Transform t)
Description copied from interface: Transformable
Applies the Transform t to the object.

Specified by:
applyTransform in interface Transformable
Specified by:
applyTransform in class AbstractShape
Parameters:
t - the transform to apply to the object.

evaluate

public PointND evaluate(PointND u)
Description copied from class: AbstractShape
Returns the point on the shape at the internal position u. If the shape is a curve, u is of dimension 1, if the shape is a surface u is of dimension 2, etc.

Specified by:
evaluate in class AbstractShape
Parameters:
u - the point in the internal parameter dimension
Returns:
the point on the shape at the internal dimension

getInternalDimension

public int getInternalDimension()
Description copied from class: AbstractShape
returns the internal dimension of the shape, i.e. 1 if it is a curve, 2 if it is a surface, etc.

Specified by:
getInternalDimension in class AbstractShape
Returns:
the internal dimension

addAll

public boolean addAll(java.util.Collection<? extends AbstractShape> c)
Specified by:
addAll in interface java.util.Collection<AbstractShape>

clear

public void clear()
Specified by:
clear in interface java.util.Collection<AbstractShape>

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection<AbstractShape>

containsAll

public boolean containsAll(java.util.Collection<?> c)
Specified by:
containsAll in interface java.util.Collection<AbstractShape>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection<AbstractShape>

iterator

public java.util.Iterator<AbstractShape> iterator()
Specified by:
iterator in interface java.lang.Iterable<AbstractShape>
Specified by:
iterator in interface java.util.Collection<AbstractShape>

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection<AbstractShape>

removeAll

public boolean removeAll(java.util.Collection<?> c)
Specified by:
removeAll in interface java.util.Collection<AbstractShape>

retainAll

public boolean retainAll(java.util.Collection<?> c)
Specified by:
retainAll in interface java.util.Collection<AbstractShape>

size

public int size()
Specified by:
size in interface java.util.Collection<AbstractShape>

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection<AbstractShape>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface java.util.Collection<AbstractShape>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object