MRPT logo

mrpt::opengl::CCylinder Class Reference

A cylinder or cone whose base lies in the XY plane. More...

#include <mrpt/opengl/CCylinder.h>

Inheritance diagram for mrpt::opengl::CCylinder:

mrpt::opengl::CRenderizable mrpt::utils::CSerializable

List of all members.

Public Member Functions

void render () const
 Render.
virtual bool traceRay (const mrpt::poses::CPose3D &o, double &dist) const
 Ray tracing.
void setHasBases (bool top=true, bool bottom=true)
 Configuration of the cylinder's bases display.
bool hasTopBase () const
 Check whether top base is displayed.
bool hasBottomBase () const
 Check whether bottom base is displayed.
void setRadius (float radius)
 Sets both radii to a single value, thus configuring the object as a cylinder.
void setRadii (float bottom, float top)
 Sets both radii independently.
void setHeight (float height)
 Chenges cylinder's height.
float getBottomRadius () const
 Gets the bottom radius.
float getTopRadius () const
 Gets the top radius.
float getHeight () const
 Gets the cylinder's height.
void setSlicesCount (uint32_t slices)
 Gets how many slices are used in the cylinder's lateral area and in its bases.
void setStacksCount (uint32_t stacks)
 Gets how many stacks are used in the cylinder's lateral area.
uint32_t getSlicesCount () const
 Sets the amount of slices used to display the object.
uint32_t getStacksCount () const
 Sets the amount of stacks used to display the object.

Static Public Member Functions

static CCylinderPtr Create (const float baseRadius, const float topRadius, const float height=1, const int slices=10, const int stacks=10)
 Constructor with two radii.
static CCylinderPtr Create (const float radius, const float height=1, const int slices=10, const int stacks=10)
 Basic constructor with only one radius.

Protected Attributes

float mBaseRadius
 Cylinder's radii.
float mTopRadius
float mHeight
 Cylinder's height.
uint32_t mSlices
 Implementation parameters on which depend the number of actually rendered polygons.
uint32_t mStacks
bool mHasTopBase
 Boolean parameters about including the bases in the object.
bool mHasBottomBase

Private Member Functions

 CCylinder ()
 Basic empty constructor.
 CCylinder (const float baseRadius, const float topRadius, const float height, const int slices, const int stacks)
 Complete constructor.
virtual ~CCylinder ()
 Destructor.
bool getRadius (float Z, float &r) const
 Gets the radius of the circunference located at certain height, returning false if the cylinder doesn't get that high.
bool reachesHeight (float Z) const
 Checks whether the cylinder exists at some height.


Detailed Description

A cylinder or cone whose base lies in the XY plane.

See also:
opengl::COpenGLScene,opengl::CDisk

Definition at line 41 of file CCylinder.h.


Constructor & Destructor Documentation

mrpt::opengl::CCylinder::CCylinder (  )  [inline, private]

Basic empty constructor.

Set all parameters to default.

Definition at line 170 of file CCylinder.h.

mrpt::opengl::CCylinder::CCylinder ( const float  baseRadius,
const float  topRadius,
const float  height,
const int  slices,
const int  stacks 
) [inline, private]

Complete constructor.

Allows the configuration of every parameter.

Definition at line 174 of file CCylinder.h.

virtual mrpt::opengl::CCylinder::~CCylinder (  )  [inline, private, virtual]

Destructor.

Definition at line 178 of file CCylinder.h.


Member Function Documentation

static CCylinderPtr mrpt::opengl::CCylinder::Create ( const float  radius,
const float  height = 1,
const int  slices = 10,
const int  stacks = 10 
) [inline, static]

Basic constructor with only one radius.

Can only create cylinders, not cones or truncated cones.

Definition at line 70 of file CCylinder.h.

References mrpt::opengl::CCylinder.

static CCylinderPtr mrpt::opengl::CCylinder::Create ( const float  baseRadius,
const float  topRadius,
const float  height = 1,
const int  slices = 10,
const int  stacks = 10 
) [inline, static]

Constructor with two radii.

Allows the construction of any cylinder.

Definition at line 64 of file CCylinder.h.

References mrpt::opengl::CCylinder.

float mrpt::opengl::CCylinder::getBottomRadius (  )  const [inline]

Gets the bottom radius.

Definition at line 127 of file CCylinder.h.

float mrpt::opengl::CCylinder::getHeight (  )  const [inline]

Gets the cylinder's height.

Definition at line 139 of file CCylinder.h.

bool mrpt::opengl::CCylinder::getRadius ( float  Z,
float &  r 
) const [inline, private]

Gets the radius of the circunference located at certain height, returning false if the cylinder doesn't get that high.

Definition at line 182 of file CCylinder.h.

uint32_t mrpt::opengl::CCylinder::getSlicesCount (  )  const [inline]

Sets the amount of slices used to display the object.

Definition at line 157 of file CCylinder.h.

uint32_t mrpt::opengl::CCylinder::getStacksCount (  )  const [inline]

Sets the amount of stacks used to display the object.

Definition at line 163 of file CCylinder.h.

float mrpt::opengl::CCylinder::getTopRadius (  )  const [inline]

Gets the top radius.

Definition at line 133 of file CCylinder.h.

bool mrpt::opengl::CCylinder::hasBottomBase (  )  const [inline]

Check whether bottom base is displayed.

See also:
hasTopBase

Definition at line 100 of file CCylinder.h.

bool mrpt::opengl::CCylinder::hasTopBase (  )  const [inline]

Check whether top base is displayed.

See also:
hasBottomBase

Definition at line 93 of file CCylinder.h.

bool mrpt::opengl::CCylinder::reachesHeight ( float  Z  )  const [inline, private]

Checks whether the cylinder exists at some height.

Definition at line 190 of file CCylinder.h.

void mrpt::opengl::CCylinder::render (  )  const [virtual]

void mrpt::opengl::CCylinder::setHasBases ( bool  top = true,
bool  bottom = true 
) [inline]

Configuration of the cylinder's bases display.

Definition at line 85 of file CCylinder.h.

void mrpt::opengl::CCylinder::setHeight ( float  height  )  [inline]

Chenges cylinder's height.

Definition at line 121 of file CCylinder.h.

void mrpt::opengl::CCylinder::setRadii ( float  bottom,
float  top 
) [inline]

Sets both radii independently.

See also:
setRadius

Definition at line 114 of file CCylinder.h.

void mrpt::opengl::CCylinder::setRadius ( float  radius  )  [inline]

Sets both radii to a single value, thus configuring the object as a cylinder.

See also:
setRadii

Definition at line 107 of file CCylinder.h.

void mrpt::opengl::CCylinder::setSlicesCount ( uint32_t  slices  )  [inline]

Gets how many slices are used in the cylinder's lateral area and in its bases.

Definition at line 145 of file CCylinder.h.

void mrpt::opengl::CCylinder::setStacksCount ( uint32_t  stacks  )  [inline]

Gets how many stacks are used in the cylinder's lateral area.

Definition at line 151 of file CCylinder.h.

virtual bool mrpt::opengl::CCylinder::traceRay ( const mrpt::poses::CPose3D o,
double &  dist 
) const [virtual]

Ray tracing.

See also:
mrpt::opengl::CRenderizable

Reimplemented from mrpt::opengl::CRenderizable.


Member Data Documentation

Cylinder's radii.

If mBaseRadius==mTopRadius, then the object is an actual cylinder. If both differ, it's a truncated cone. If one of the radii is zero, the object is a cone.

Definition at line 47 of file CCylinder.h.

Definition at line 59 of file CCylinder.h.

Boolean parameters about including the bases in the object.

If both mHasTopBase and mHasBottomBase are set to false, only the lateral area is displayed.

Definition at line 59 of file CCylinder.h.

Cylinder's height.

Definition at line 51 of file CCylinder.h.

uint32_t mrpt::opengl::CCylinder::mSlices [protected]

Implementation parameters on which depend the number of actually rendered polygons.

Definition at line 55 of file CCylinder.h.

uint32_t mrpt::opengl::CCylinder::mStacks [protected]

Definition at line 55 of file CCylinder.h.

Definition at line 47 of file CCylinder.h.




Page generated by Doxygen 1.5.9 for MRPT 0.7.1 SVN: at Mon Aug 17 22:27:43 EDT 2009