ProGAL.geom3d.volumes
Class Cone

java.lang.Object
  extended by ProGAL.geom3d.volumes.Cone
All Implemented Interfaces:
Shape, Volume

public class Cone
extends java.lang.Object
implements Volume

A three-dimensional cone represented by two points on its central axis. The first point is the bottom and the second is the tip of the cone.


Field Summary
 Point p1
           
 Point p2
           
 double rad
           
 
Constructor Summary
Cone(Point p1, Point p2, double r)
           
 
Method Summary
 Cone clone()
          Make a deep clone this volume.
 Point getCenter()
          Get the geometric center of the shape.
 double getVolume()
          Get the volume.
 boolean overlaps(Volume vol)
          Determine if this volume overlaps vol.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

p1

public Point p1

p2

public Point p2

rad

public double rad
Constructor Detail

Cone

public Cone(Point p1,
            Point p2,
            double r)
Method Detail

getVolume

public double getVolume()
Description copied from interface: Volume
Get the volume.

Specified by:
getVolume in interface Volume

getCenter

public Point getCenter()
Description copied from interface: Shape
Get the geometric center of the shape. The center of a shape can be interpreted in many ways (center of mass, circumcenter, inscribed center etc.). No strict requirement is given here, but typically the circumcenter should be supplied. This method is most prominently used to find the average center-position of a collection of shapes such that scene-viewers can be centered on the scene.

Specified by:
getCenter in interface Shape

clone

public Cone clone()
Description copied from interface: Volume
Make a deep clone this volume.

Specified by:
clone in interface Volume
Overrides:
clone in class java.lang.Object

overlaps

public boolean overlaps(Volume vol)
Description copied from interface: Volume
Determine if this volume overlaps vol. Two volumes overlap if their surfaces touch or if the union of interiors is non-empty.

Specified by:
overlaps in interface Volume