de.grogra.vecmath.geom
Class CompoundVolume

java.lang.Object
  extended by de.grogra.vecmath.geom.VolumeBase
      extended by de.grogra.vecmath.geom.CompoundVolume
All Implemented Interfaces:
Volume
Direct Known Subclasses:
CSGDifference, CSGIntersection, UnionBase

public abstract class CompoundVolume
extends VolumeBase

This abstract class can be used as base class for compound volumes whose geometry is defined in terms of a set of contained volumes.

Author:
Ole Kniemeyer

Field Summary
 java.util.ArrayList<Volume> volumes
          The list of volumes from which this compound volume is computed.
 
Constructor Summary
CompoundVolume()
           
 
Method Summary
 boolean boxContainsBoundary(BoundingBox box, Tuple3d center, double radius, Variables temp)
          This implementation of boxContainsBoundary returns true iff at least one of the invocations of this method on the volumes returns true.
 void computeNormal(Intersection is, Vector3d normal)
          This method computes the unit normal vector of an intersection is which has been computed previously by the invocation of Volume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection) on this volume.
 void computeTangents(Intersection is, Vector3d dpdu, Vector3d dpdv)
          This method computes the derivatives of the surface point (as function of the uv-coordinates, see Volume.computeUV(de.grogra.vecmath.geom.Intersection, javax.vecmath.Vector2d)) with respect to u and v at the intersection point.
 void computeUV(Intersection is, Vector2d uv)
          This method computes the uv-coordinates of an intersection point is which has been computed previously by the invocation of Volume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection) on this volume.
 
Methods inherited from class de.grogra.vecmath.geom.VolumeBase
addConvexIntersections, getId, operator$and, operator$com, operator$or, operator$sub, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.grogra.vecmath.geom.Volume
computeIntersections, contains, getExtent
 

Field Detail

volumes

public java.util.ArrayList<Volume> volumes
The list of volumes from which this compound volume is computed.

Constructor Detail

CompoundVolume

public CompoundVolume()
Method Detail

boxContainsBoundary

public boolean boxContainsBoundary(BoundingBox box,
                                   Tuple3d center,
                                   double radius,
                                   Variables temp)
This implementation of boxContainsBoundary returns true iff at least one of the invocations of this method on the volumes returns true.

Parameters:
box - bounding box
center - center coordinates of box
radius - radius of enclosing sphere
temp - has to be provided by the invoker, may be used in implementations
Returns:
true if box contains (part of) the boundary of this volume

computeNormal

public void computeNormal(Intersection is,
                          Vector3d normal)
Description copied from interface: Volume
This method computes the unit normal vector of an intersection is which has been computed previously by the invocation of Volume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection) on this volume.

Parameters:
is - a previously computed intersection
normal - resulting unit vector is placed in here

computeTangents

public void computeTangents(Intersection is,
                            Vector3d dpdu,
                            Vector3d dpdv)
Description copied from interface: Volume
This method computes the derivatives of the surface point (as function of the uv-coordinates, see Volume.computeUV(de.grogra.vecmath.geom.Intersection, javax.vecmath.Vector2d)) with respect to u and v at the intersection point.

Parameters:
is - a previously computed intersection
dpdu - resulting derivative with respect to u
dpdv - resulting derivative with respect to v

computeUV

public void computeUV(Intersection is,
                      Vector2d uv)
Description copied from interface: Volume
This method computes the uv-coordinates of an intersection point is which has been computed previously by the invocation of Volume.computeIntersections(de.grogra.vecmath.geom.Line, int, de.grogra.vecmath.geom.IntersectionList, de.grogra.vecmath.geom.Intersection, de.grogra.vecmath.geom.Intersection) on this volume.

Parameters:
is - a previously computed intersection
uv - resulting uv-coordinates are placed in here