Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Shape Class Reference

Define a basic geometrical shape, defined by the inside() and distanceTo... More...

#include <Shape.h>

Inheritance diagram for Shape:

GeomObject Volume Cone Hexahedron Hype Sphe Tube Cons Box Trap Trd1 Trd2 Tubs List of all members.

Public Methods

virtual double distanceToLeave ( const Ray& r, double maxStep = FLT_MAX ) const = 0
 return the distance along the Ray to leave (if inside ), or enter (if outside). More...

virtual double distanceToEnter ( const Ray& r, double maxStep = FLT_MAX ) const = 0
virtual int inside ( const Point& x ) const = 0
 is the point inside the volume?

void printOn (std::ostream&) const
 print info about this object. More...

const Pointcenter () const
 access to center data member. More...

GeomObjecttransform (const CoordTransform&)
 virtual method to perform transformations that must be implemented by subclasses. More...

virtual Shape& copy () const
 non-virtual subclasses figure out how to return a copy. More...

virtual int getBoundaryIndex (const Point& ) const
 allows client using distanceToLeave to associate an index with a boundary, identified by the point. More...

virtual int lastBoundaryIndex () const
 distanceToLeave sets index of left boundary: client can use. More...

virtual double getMaxDimension () const
 should be calculated by a subclass which is meant to be the maximum distance from the center. More...


Protected Methods

 Shape ()

Private Methods

 Shape (const Shape& )

Private Attributes

Point _center

Detailed Description

Define a basic geometrical shape, defined by the inside() and distanceTo...

methods This class is abstract

Definition at line 19 of file Shape.h.


Constructor & Destructor Documentation

Shape::Shape ( ) [protected]
 

Definition at line 9 of file Shape.cxx.

Shape::Shape ( const Shape & ) [inline, private]
 

Definition at line 58 of file Shape.h.


Member Function Documentation

const Point & Shape::center ( ) const [inline]
 

access to center data member.

Definition at line 65 of file Shape.h.

Referenced by Cone::Cone(), Cons::Cons(), Hype::Hype(), Sphe::Sphe(), Tubs::Tubs(), Hexahedron::addPlane(), Tube::calculateSurfaces(), and Volume::distanceToEnter().

Shape & Shape::copy ( ) const [virtual]
 

non-virtual subclasses figure out how to return a copy.

Definition at line 13 of file Shape.cxx.

virtual double Shape::distanceToEnter ( const Ray & r,
double maxStep = FLT_MAX ) const [pure virtual]
 

Reimplemented in Volume.

double Shape::distanceToLeave ( const Ray & r,
double maxStep = FLT_MAX ) const [pure virtual]
 

return the distance along the Ray to leave (if inside ), or enter (if outside).

Can be negative if the origin of the Ray is close to the surface. maxStep is the largest distance required. returns FLT_MAX if no intersection

Reimplemented in Volume.

int Shape::getBoundaryIndex ( const Point & p ) const [inline, virtual]
 

allows client using distanceToLeave to associate an index with a boundary, identified by the point.

Reimplemented in Volume.

Definition at line 45 of file Shape.h.

double Shape::getMaxDimension ( ) const [inline, virtual]
 

should be calculated by a subclass which is meant to be the maximum distance from the center.

Reimplemented in Volume.

Definition at line 51 of file Shape.h.

int Shape::inside ( const Point & x ) const [pure virtual]
 

is the point inside the volume?

Reimplemented in Volume.

int Shape::lastBoundaryIndex ( ) const [inline, virtual]
 

distanceToLeave sets index of left boundary: client can use.

Reimplemented in Volume.

Definition at line 48 of file Shape.h.

void Shape::printOn ( std::ostream & os ) const [virtual]
 

print info about this object.

Reimplemented from GeomObject.

Reimplemented in Cone, Cons, Hype, Sphe, Trap, Trd1, Trd2, Tube, Tubs, and Volume.

Definition at line 25 of file Shape.cxx.

Referenced by Volume::printOn(), and Sphe::printOn().

GeomObject & Shape::transform ( const CoordTransform & T ) [virtual]
 

virtual method to perform transformations that must be implemented by subclasses.

Reimplemented from GeomObject.

Reimplemented in Volume.

Definition at line 32 of file Shape.cxx.

Referenced by Volume::transform().


Member Data Documentation

Point Shape::_center [private]
 

Definition at line 61 of file Shape.h.


The documentation for this class was generated from the following files:
Generated at Mon Nov 26 18:18:25 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000