Cylinder Class Reference

#include <Cylinder.h>

Inheritance diagram for Cylinder:

DrawableObject SimObject List of all members.

Public Member Functions

 Cylinder ()
virtual std::string getKind () const
virtual void draw (const Vector3d &pointOfView, const VisualizationParameterSet &visParams)
void setRadius (double radius)
void setHeight (double height)
void setClosed (bool closed)
virtual SimObjectclone () const
virtual double getMaxDistanceTo (Vector3d &base) const

Protected Member Functions

virtual bool intersectWithRay (const Vector3d &pos, const Vector3d &ray, Vector3d &intersectPos)

Protected Attributes

double radius
double height
bool closed

Detailed Description

A class representing a cylinder in 3D space.

Definition at line 20 of file Cylinder.h.


Constructor & Destructor Documentation

Cylinder::Cylinder (  ) 

Constructor

Definition at line 14 of file Cylinder.cpp.

References closed.

Referenced by clone().


Member Function Documentation

SimObject * Cylinder::clone (  )  const [virtual]

Clones the object and its child nodes

Returns:
A pointer to a copy of the object

Reimplemented from SimObject.

Definition at line 54 of file Cylinder.cpp.

References SimObject::addChildNode(), SimObject::childNodes, closed, Cylinder(), SimObject::fullName, height, SimObject::invisible, SimObject::name, SimObject::position, radius, SimObject::rotation, SimObject::setFullName(), SimObject::setName(), SimObject::setPosition(), and DrawableObject::surface.

void Cylinder::draw ( const Vector3d pointOfView,
const VisualizationParameterSet visParams 
) [virtual]

Draws the cylinder and its child nodes

Parameters:
pointOfView The point of view from which the scene is drawn
visParams Parameters for Visualization

Reimplemented from SimObject.

Definition at line 19 of file Cylinder.cpp.

References closed, SimObject::draw(), SimObject::drawForCamera, Surface::getColor(), Vector3d::getXRotation(), Vector3d::getYRotation(), height, DrawableObject::inverted, SimObject::invisible, M_PI, SimObject::position, radius, Vector3d::rotate(), Vector3d::rotateX(), SimObject::rotation, DrawableObject::surface, and Vector3d::v.

virtual std::string Cylinder::getKind (  )  const [inline, virtual]

Returns a string describing the kind of object

Returns:
The kind

Reimplemented from DrawableObject.

Definition at line 45 of file Cylinder.h.

double Cylinder::getMaxDistanceTo ( Vector3d base  )  const [virtual]

Returns the maximum distance of any point in the subtree to a given point

Parameters:
base The point to compute the distance to
Returns:
The distance

Reimplemented from SimObject.

Definition at line 76 of file Cylinder.cpp.

References SimObject::childNodes, dist(), Vector3d::getLength(), height, SimObject::position, and radius.

bool Cylinder::intersectWithRay ( const Vector3d pos,
const Vector3d ray,
Vector3d intersectPos 
) [protected, virtual]

Intersects the cylinder and its children with a ray

Parameters:
pos The starting position of the ray
ray The ray
intersectPos The intersection point nearest to pos (if found)
Returns:
true, if an intersection point has been found

Reimplemented from SimObject.

Definition at line 96 of file Cylinder.cpp.

void Cylinder::setClosed ( bool  closed  )  [inline]

Sets the closed flag

Parameters:
closed The closed flag

Definition at line 67 of file Cylinder.h.

Referenced by SAX2Handler::parseCylinderAttributes().

void Cylinder::setHeight ( double  height  )  [inline]

Sets the height of the cylinder

Parameters:
height The height

Definition at line 62 of file Cylinder.h.

Referenced by SAX2Handler::parseCylinderAttributes().

void Cylinder::setRadius ( double  radius  )  [inline]

Sets the radius of the cylinder

Parameters:
radius The radius

Definition at line 57 of file Cylinder.h.

Referenced by SAX2Handler::parseCylinderAttributes().


Member Data Documentation

bool Cylinder::closed [protected]

Flag: The cylinder is closed, if true

Definition at line 28 of file Cylinder.h.

Referenced by clone(), Cylinder(), and draw().

double Cylinder::height [protected]

The height of the cylinder

Definition at line 26 of file Cylinder.h.

Referenced by clone(), draw(), and getMaxDistanceTo().

double Cylinder::radius [protected]

The radius of the cylinder

Definition at line 24 of file Cylinder.h.

Referenced by clone(), draw(), and getMaxDistanceTo().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:27:30 2006 for DT2005.panorama by  doxygen 1.4.7