edu.stanford.rsl.konrad.geometry.shapes
Class ArbitrarySurface

java.lang.Object
  extended by edu.stanford.rsl.konrad.geometry.AbstractShape
      extended by edu.stanford.rsl.konrad.geometry.AbstractSurface
          extended by edu.stanford.rsl.konrad.geometry.shapes.simple.SimpleSurface
              extended by edu.stanford.rsl.konrad.geometry.shapes.ArbitrarySurface
All Implemented Interfaces:
Transformable, java.io.Serializable

public class ArbitrarySurface
extends SimpleSurface

Models an arbitrary shape centered at the origin using a base shape and bounding conditions An affine transform class is used to translate and orient shapes from object space in world space The affine transform of an arbitrary shape is always the same as that of its base shape;

Author:
Rotimi X Ojo
See Also:
Serialized Form

Constructor Summary
ArbitrarySurface(SimpleSurface baseSurface, java.util.Collection<? extends AbstractBoundingCondition> clipSurfaces)
           
 
Method Summary
 void applyTransform(Transform t)
          Applies the Transform t to the object.
 PointND evaluate(double u, double v)
          Returns a point on the surface at position (u, v).
 PointND evaluate(PointND u)
          Returns the point on the shape at the internal position u.
 int getDimension()
          Returns the external dimension of the shape.
 java.util.ArrayList<PointND> getHits(AbstractCurve other)
           
 int getInternalDimension()
          returns the internal dimension of the shape, i.e.
 Axis getPrincipalAxis()
           
 PointND[] getRasterPoints(int number)
          Rasters the shape with a given number of points or less.
 boolean isBounded()
          Returns true if the shape is of limited space
 boolean isMember(PointND hit)
          Determines if the given point in within the bounds of shape;
 
Methods inherited from class edu.stanford.rsl.konrad.geometry.shapes.simple.SimpleSurface
addAllBoundingConditions, addBoundingCondition, getChangeOfAxisMatrix, getTransform, intersect
 
Methods inherited from class edu.stanford.rsl.konrad.geometry.AbstractShape
getHitsOnBoundingBox_slow, getHitsOnBoundingBox, getMax, getMin
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArbitrarySurface

public ArbitrarySurface(SimpleSurface baseSurface,
                        java.util.Collection<? extends AbstractBoundingCondition> clipSurfaces)
Method Detail

isMember

public boolean isMember(PointND hit)
Description copied from class: SimpleSurface
Determines if the given point in within the bounds of shape;

Specified by:
isMember in class SimpleSurface
Returns:
true if the point is within the surface

getHits

public java.util.ArrayList<PointND> getHits(AbstractCurve other)
Specified by:
getHits in class SimpleSurface

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.

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 SimpleSurface
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.

Specified by:
getDimension in class AbstractShape
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 SimpleSurface
Returns:
the internal dimension

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.

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

getPrincipalAxis

public Axis getPrincipalAxis()
Specified by:
getPrincipalAxis in class SimpleSurface

evaluate

public PointND evaluate(double u,
                        double v)
Description copied from class: AbstractSurface
Returns a point on the surface at position (u, v). u, v in [0, 1];

Specified by:
evaluate in class AbstractSurface
Parameters:
u - the internal position in u dimension
v - the internal position in v dimension
Returns:
the surface point