bool
Class BooleanModeller

java.lang.Object
  |
  +--bool.BooleanModeller
All Implemented Interfaces:
java.lang.Cloneable

public class BooleanModeller
extends java.lang.Object
implements java.lang.Cloneable

Class used to apply boolean operations on solids.

Two 'Solid' objects are submitted to this class constructor. There is a methods for each boolean operation. Each of these return a 'Solid' resulting from the application of its operation into the submitted solids.

See: D. H. Laidlaw, W. B. Trumbore, and J. F. Hughes. "Constructive Solid Geometry for Polyhedral Objects" SIGGRAPH Proceedings, 1986, p.161.

Author:
Danilo Balby Silva Castanheira (danbalby@yahoo.com)

Constructor Summary
BooleanModeller(bool.Solid solid1, bool.Solid solid2)
          Constructs a BooleanModeller object to apply boolean operation in two solids.
 
Method Summary
 java.lang.Object clone()
          Clones the BooleanModeller object
 bool.Solid getDifference()
          Gets the solid generated by the difference of the two solids submitted to the constructor.
 bool.Solid getIntersection()
          Gets the solid generated by the intersection of the two solids submitted to the constructor
 bool.Solid getUnion()
          Gets the solid generated by the union of the two solids submitted to the constructor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanModeller

public BooleanModeller(bool.Solid solid1,
                       bool.Solid solid2)
Constructs a BooleanModeller object to apply boolean operation in two solids. Makes preliminary calculations

Parameters:
solid1 - first solid where boolean operations will be applied
solid2 - second solid where boolean operations will be applied
Method Detail

clone

public java.lang.Object clone()
Clones the BooleanModeller object

Overrides:
clone in class java.lang.Object
Returns:
cloned BooleanModeller object

getUnion

public bool.Solid getUnion()
Gets the solid generated by the union of the two solids submitted to the constructor

Returns:
solid generated by the union of the two solids submitted to the constructor

getIntersection

public bool.Solid getIntersection()
Gets the solid generated by the intersection of the two solids submitted to the constructor

Returns:
solid generated by the intersection of the two solids submitted to the constructor. The generated solid may be empty depending on the solids. In this case, it can't be used on a scene graph. To check this, use the Solid.isEmpty() method.

getDifference

public bool.Solid getDifference()
Gets the solid generated by the difference of the two solids submitted to the constructor. The fist solid is substracted by the second.

Returns:
solid generated by the difference of the two solids submitted to the constructor