

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
public interface Volume
This interface represents three dimensional geometric objects having a volume.
Method Summary  

boolean 
boxContainsBoundary(BoundingBox box,
Tuple3d center,
double radius,
Variables temp)
Returns true if the specified box contains
(part of) the boundary surface of this volume. 
boolean 
computeIntersections(Line line,
int which,
IntersectionList list,
Intersection excludeStart,
Intersection excludeEnd)
Computes intersections between the boundary surface of this object and the specified line . 
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 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 uvcoordinates, see 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 uvcoordinates of an intersection point is which has been computed previously by the invocation
of 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. 
boolean 
contains(Tuple3d point,
boolean open)
Determines if the given point lies within this object. 
void 
getExtent(Tuple3d min,
Tuple3d max,
Variables temp)
Computes the extent of this volume, i.e., an axisaligned bounding box between min and max . 
int 
getId()
Returns the id which has been set by setId(int) . 
Volume 
operator$and(Volume v)
This operator method creates the intersection of this volume and v . 
Volume 
operator$com()
This operator method creates the complement of this volume. 
Volume 
operator$or(Volume v)
This operator method creates the union of this volume and v . 
Volume 
operator$sub(Volume v)
This operator method creates the difference between a and b . 
void 
setId(int id)
Sets a unique identifier for this volume. 
Method Detail 

boolean boxContainsBoundary(BoundingBox box, Tuple3d center, double radius, Variables temp)
true
if the specified box
contains
(part of) the boundary surface of this volume. Otherwise, if box and
boundary do not overlap, this method should return false
,
but may also return true
if an exact computation
would be too expensive or complicated.
Note that a box contains the boundary of a closed set S iff both have a nonempty intersection and the box is not contained in the open set of S.
box
 bounding boxcenter
 center coordinates of boxradius
 radius of enclosing spheretemp
 has to be provided by the invoker, may be used in implementations
true
if box contains (part of) the boundary of this volumeboolean computeIntersections(Line line, int which, IntersectionList list, Intersection excludeStart, Intersection excludeEnd)
line
. The intersections are added
to list
in ascending order of distance
(i.e., of Intersection.parameter
), where the
parameter
has to lie between line.start
and line.end
.
Implementations of this method must not
clear or modify the existing intersections in list
.
The parameter which
has to be one of
Intersection.ALL
, Intersection.CLOSEST
,
Intersection.ANY
. It determines if all intersections
have to be added to the list, only the closest (minimal
value of Intersection.parameter
), or an arbitrary
of the set of all intersections. Only in case of ALL
,
the return value of this method is precise.
If specific intersection points should be excluded from the list
of computed intersections, they have to be specified in
excludeStart
and excludeEnd
.
The intersection point of excludeStart
has to be the
starting point of line
, the intersection point of
excludeEnd
has to be the end point of line
.
The exclusion of intersections is a useful feature for
raytracing, e.g., when a ray is reemitted at an intersection point
in another direction.
line
 a linewhich
 one of Intersection.ALL
,
Intersection.CLOSEST
, Intersection.ANY
, this
determines which intersections have to be added to list
list
 the intersections are added to this listexcludeStart
 intersection at start point which shall be excluded, or null
excludeEnd
 intersection at end point which shall be excluded, or null
true
iff the beginning of the line lies
within the volume (i.e., if the line starts within the volume or
enters the volume at the starting point); however note that the returned
value is valid only if which == Intersection.ALL
void computeNormal(Intersection is, Vector3d normal)
is
which has been computed previously by the invocation
of 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.
is
 a previously computed intersectionnormal
 resulting unit vector is placed in herevoid computeTangents(Intersection is, Vector3d dpdu, Vector3d dpdv)
computeUV(de.grogra.vecmath.geom.Intersection, javax.vecmath.Vector2d)
)
with respect to u and v at the intersection point.
is
 a previously computed intersectiondpdu
 resulting derivative with respect to udpdv
 resulting derivative with respect to vvoid computeUV(Intersection is, Vector2d uv)
is
which has been computed previously by the invocation
of 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.
is
 a previously computed intersectionuv
 resulting uvcoordinates are placed in hereboolean contains(Tuple3d point, boolean open)
point
lies within this object.
If open
is true
, the interior of the volume
is considered (the largest open set contained in the volume,
i.e., excluding the boundary), otherwise the closure of the volume.
point
 a point in global world coordinatesopen
 consider open or closed set
true
iff point
is an element of the setvoid getExtent(Tuple3d min, Tuple3d max, Variables temp)
min
and max
.
min
 minimum coordinates of bounding box are placed in heremax
 maximum coordinates of bounding box are placed in heretemp
 has to be provided by the invoker, may be used in implementationsint getId()
setId(int)
. Identifiers
are nonnegative and should be consecutive starting at zero, so that
they can be used as indices into arrays which associate additional
information with the volumes. Small gaps in the set of used identifiers
are tolerable.
Volume operator$and(Volume v)
v
.
v
 a volume
a
and b
CSGIntersection
Volume operator$com()
CSGComplement
Volume operator$or(Volume v)
v
.
v
 a volume
v
CSGUnion
Volume operator$sub(Volume v)
a
and b
.
v
 the volume to be subtracted
b
CSGDifference
void setId(int id)
id
has to be
nonnegative, the id
s of all coexisting volumes should
be consecutive numbers starting at zero.
id
 id for this volumegetId()


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 