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

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

public class LinearOctree
extends CompoundShape

See Also:
Serialized Form

Constructor Summary
LinearOctree(PointND center)
           
LinearOctree(PointND min, PointND max)
           
LinearOctree(PointND min, PointND max, double random)
           
LinearOctree(PointND min, PointND max, PointND center)
           
 
Method Summary
 boolean add(AbstractShape shape)
           
 boolean addAll(java.util.Collection<? extends AbstractShape> arg0)
           
 void applyTransform(Transform t)
          Applies the Transform t to the object.
 void clear()
           
 boolean contains(java.lang.Object arg0)
           
 boolean containsAll(java.util.Collection<?> arg0)
           
 PointND evaluate(PointND u)
          Returns the point on the shape at the internal position u.
 int getDimension()
          Returns the external dimension of the shape.
 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 arg0)
           
 boolean removeAll(java.util.Collection<?> arg0)
           
 boolean retainAll(java.util.Collection<?> arg0)
           
 int size()
           
 java.lang.Object[] toArray()
           
<T> T[]
toArray(T[] arg0)
           
 java.lang.String toString()
           
 
Methods inherited from class edu.stanford.rsl.konrad.geometry.shapes.compound.CompoundShape
get, getHitsOnBoundingBox
 
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

LinearOctree

public LinearOctree(PointND center)

LinearOctree

public LinearOctree(PointND min,
                    PointND max)

LinearOctree

public LinearOctree(PointND min,
                    PointND max,
                    double random)

LinearOctree

public LinearOctree(PointND min,
                    PointND max,
                    PointND center)
Method Detail

add

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

getMin

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

getMax

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

applyTransform

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

Specified by:
applyTransform in interface Transformable
Overrides:
applyTransform in class CompoundShape
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.

Overrides:
evaluate in class CompoundShape
Parameters:
u - the point in the internal parameter dimension
Returns:
the point on the shape at the internal dimension

getDimension

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

Overrides:
getDimension in class CompoundShape
Returns:
the 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.

Overrides:
getInternalDimension in class CompoundShape
Returns:
the internal dimension

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.

Overrides:
intersect in class CompoundShape
Returns:
the intersection points.

isBounded

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

Overrides:
isBounded in class CompoundShape
Returns:
Boundedness of this shape.

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.

Overrides:
getRasterPoints in class CompoundShape
Parameters:
number - the number of points
Returns:
the raster points

toString

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

size

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

addAll

public boolean addAll(java.util.Collection<? extends AbstractShape> arg0)
Specified by:
addAll in interface java.util.Collection<AbstractShape>
Overrides:
addAll in class CompoundShape

clear

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

contains

public boolean contains(java.lang.Object arg0)
Specified by:
contains in interface java.util.Collection<AbstractShape>
Overrides:
contains in class CompoundShape

containsAll

public boolean containsAll(java.util.Collection<?> arg0)
Specified by:
containsAll in interface java.util.Collection<AbstractShape>
Overrides:
containsAll in class CompoundShape

isEmpty

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

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>
Overrides:
iterator in class CompoundShape

remove

public boolean remove(java.lang.Object arg0)
Specified by:
remove in interface java.util.Collection<AbstractShape>
Overrides:
remove in class CompoundShape

removeAll

public boolean removeAll(java.util.Collection<?> arg0)
Specified by:
removeAll in interface java.util.Collection<AbstractShape>
Overrides:
removeAll in class CompoundShape

retainAll

public boolean retainAll(java.util.Collection<?> arg0)
Specified by:
retainAll in interface java.util.Collection<AbstractShape>
Overrides:
retainAll in class CompoundShape

toArray

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

toArray

public <T> T[] toArray(T[] arg0)
Specified by:
toArray in interface java.util.Collection<AbstractShape>
Overrides:
toArray in class CompoundShape