

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object de.grogra.vecmath.geom.VolumeBase de.grogra.vecmath.geom.CompoundVolume de.grogra.vecmath.geom.CSGDifference
public class CSGDifference
An instance of this class represents the difference of a list of volumes.
The difference consists of all points which are contained in the first
volume of CompoundVolume.volumes
, but not in one or more of
the remaining volumes.
Field Summary 

Fields inherited from class de.grogra.vecmath.geom.CompoundVolume 

volumes 
Constructor Summary  

CSGDifference()
Creates a new CSGDifference whose list of volumes
is empty. 

CSGDifference(Volume a,
Volume b)
Creates a new CSGDifference whose list of volumes
is set to [a, b] . 
Method Summary  

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 . 
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 . 
Volume 
operator$sub(Volume v)
This operator method creates the difference between a and b . 
Methods inherited from class de.grogra.vecmath.geom.CompoundVolume 

boxContainsBoundary, computeNormal, computeTangents, computeUV 
Methods inherited from class de.grogra.vecmath.geom.VolumeBase 

addConvexIntersections, getId, operator$and, operator$com, operator$or, setId 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 

public CSGDifference()
CSGDifference
whose list of volumes
is empty.
public CSGDifference(Volume a, Volume b)
CSGDifference
whose list of volumes
is set to [a, b]
.
Method Detail 

public boolean computeIntersections(Line line, int which, IntersectionList list, Intersection excludeStart, Intersection excludeEnd)
Volume
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
public boolean contains(Tuple3d point, boolean open)
Volume
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 setpublic void getExtent(Tuple3d min, Tuple3d max, Variables temp)
Volume
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 implementationspublic Volume operator$sub(Volume v)
Volume
a
and b
.
operator$sub
in interface Volume
operator$sub
in class VolumeBase
v
 the volume to be subtracted
b
CSGDifference


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