version 3.3

VRS::Cone Class Reference

Shape for a cone or a part of a cone. More...

#include <vrs/cone.h>

Inheritance diagram for VRS::Cone:

VRS::Shape VRS::RenderObj VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 Cone (const Vector &top=Vector(0, 1, 0), const Vector &bottom=Vector(0, 0, 0), double topRadius=0.0, double bottomRadius=0.5, double theta=360.0)
 Constructs a cone (part) by its top and bottom point and radius and a theta value.
 Cone (double height, double radius, double theta=360.0)
 Constructs a cone along the y axis by a height, the radius at the bottom and a theta value.
void setTopPoint (const Vector &)
 Sets the top point of the cone.
Vector getTopPoint () const
 Returns the top point of the cone.
void setBottomPoint (const Vector &)
 Sets the bottom point of the cone.
Vector getBottomPoint () const
 Returns the bottom point of the cone.
double height () const
 Returns the distance between top- and bottom-point.
void setTopRadius (double)
 Sets the radius at the top-point.
double getTopRadius () const
 Returns the radius at the top-point.
void setBottomRadius (double)
 Sets the radius at the bottom-point.
double getBottomRadius () const
 Returns the radius at the bottom-point.
void setTheta (double)
 Sets the theta value, see thetaTransform.
double getTheta () const
 Returns the theta value, see thetaTransform.
Matrix thetaTransform () const
virtual Bounds boundingBox () const
 Returns the bounding box the cone.
 VRS_TYPEINFO (Cone, Shape)
 VRS_SERIALIZABLE (Cone)


Detailed Description

Shape for a cone or a part of a cone.

Constructor & Destructor Documentation

VRS::Cone::Cone ( const Vector top = Vector(0, 1, 0),
const Vector bottom = Vector(0, 0, 0),
double  topRadius = 0.0,
double  bottomRadius = 0.5,
double  theta = 360.0 
)

Constructs a cone (part) by its top and bottom point and radius and a theta value.

See thetaTransform for how to interpret theta.

VRS::Cone::Cone ( double  height,
double  radius,
double  theta = 360.0 
)

Constructs a cone along the y axis by a height, the radius at the bottom and a theta value.

See thetaTransform for how to interpret theta.


Member Function Documentation

void VRS::Cone::setTopPoint ( const Vector  ) 

Sets the top point of the cone.

Vector VRS::Cone::getTopPoint (  )  const [inline]

Returns the top point of the cone.

void VRS::Cone::setBottomPoint ( const Vector  ) 

Sets the bottom point of the cone.

Vector VRS::Cone::getBottomPoint (  )  const [inline]

Returns the bottom point of the cone.

double VRS::Cone::height (  )  const [inline]

Returns the distance between top- and bottom-point.

void VRS::Cone::setTopRadius ( double   ) 

Sets the radius at the top-point.

double VRS::Cone::getTopRadius (  )  const [inline]

Returns the radius at the top-point.

void VRS::Cone::setBottomRadius ( double   ) 

Sets the radius at the bottom-point.

double VRS::Cone::getBottomRadius (  )  const [inline]

Returns the radius at the bottom-point.

void VRS::Cone::setTheta ( double   ) 

Sets the theta value, see thetaTransform.

double VRS::Cone::getTheta (  )  const [inline]

Returns the theta value, see thetaTransform.

Matrix VRS::Cone::thetaTransform (  )  const

Theta is an angle measured in degree, i.e. ranging 0-360. Interpretation of theta: If the cone's axis is parallel to the y-axis and it's bottom is below the top, angle 0 corresponds to the direction of the positive x-axis, angle 90 to the positive z-axis and so on. If the cone's axis isn't parallel to the y-axis: The cone is considered to be rotated around the y-axis originally anyway, but rotated to its given position afterwards. There's an infinited number of such rotations, but the one with the least absolute angle is assumed to be used. (This is the canonical rotation, and hopefully the first one that comes to your mind). Thus, this rotation implies how theta is interpreted. Example: Top=(1,0,0), Bottom=(0,0,0). In this context, the cone is considered to be a cone with Top=(0,1,0) and Bottom=(0,0,0), rotated so that the top actually is (1,0,0). This is done by rotatins it around the z-axis around 90 degrees. As a consequence, regarding theta, angle 0 corresponts to the negative y-axis, angle 90 still points towards positive z and so on. The rotation-matrix may be inquired by thetaTransform. It is useful for simplifiers, ray-intersectors and the like.

virtual Bounds VRS::Cone::boundingBox (  )  const [virtual]

Returns the bounding box the cone.

Implements VRS::Shape.

VRS::Cone::VRS_TYPEINFO ( Cone  ,
Shape   
)

VRS::Cone::VRS_SERIALIZABLE ( Cone   ) 


The documentation for this class was generated from the following file:

Generated on Mon May 21 06:00:16 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact