Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions
mrpt::opengl::CCylinder Class Reference

Detailed Description

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

See also:
opengl::COpenGLScene,opengl::CDisk
mrpt::opengl::CCylinder
preview_CCylinder.png

#include <mrpt/opengl/CCylinder.h>

Inheritance diagram for mrpt::opengl::CCylinder:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void render_dl () 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.

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.

RTTI stuff

typedef CCylinderPtr SmartPtr
static mrpt::utils::CLASSINIT _init_CCylinder
static mrpt::utils::TRuntimeClassId classCCylinder
static const
mrpt::utils::TRuntimeClassId * 
classinfo
static const
mrpt::utils::TRuntimeClassId * 
_GetBaseClass ()
virtual const
mrpt::utils::TRuntimeClassId * 
GetRuntimeClass () const
 Returns information about the class of an object in runtime.
virtual mrpt::utils::CObject * duplicate () const
 Returns a copy of the object, indepently of its class.
static mrpt::utils::CObject * CreateObject ()
static CCylinderPtr Create ()

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 50 of file CCylinder.h.


Constructor & Destructor Documentation

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

Basic empty constructor.

Set all parameters to default.

Definition at line 178 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 182 of file CCylinder.h.

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

Destructor.

Definition at line 186 of file CCylinder.h.


Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::opengl::CCylinder::_GetBaseClass ( ) [static, protected]
static CCylinderPtr mrpt::opengl::CCylinder::Create ( ) [static]
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 72 of file CCylinder.h.

References mrpt::opengl::CCylinder.

static mrpt::utils::CObject* mrpt::opengl::CCylinder::CreateObject ( ) [static]
virtual mrpt::utils::CObject* mrpt::opengl::CCylinder::duplicate ( ) const [virtual]

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

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

Gets the bottom radius.

Definition at line 133 of file CCylinder.h.

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

Gets the cylinder's height.

Definition at line 145 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 190 of file CCylinder.h.

virtual const mrpt::utils::TRuntimeClassId* mrpt::opengl::CCylinder::GetRuntimeClass ( ) const [virtual]

Returns information about the class of an object in runtime.

Reimplemented from mrpt::opengl::CRenderizableDisplayList.

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

Sets the amount of slices used to display the object.

Definition at line 165 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 171 of file CCylinder.h.

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

Gets the top radius.

Definition at line 139 of file CCylinder.h.

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

Check whether bottom base is displayed.

See also:
hasTopBase

Definition at line 103 of file CCylinder.h.

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

Check whether top base is displayed.

See also:
hasBottomBase

Definition at line 96 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 198 of file CCylinder.h.

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

Configuration of the cylinder's bases display.

Definition at line 87 of file CCylinder.h.

References mrpt::opengl::CRenderizableDisplayList::notifyChange().

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

Chenges cylinder's height.

Definition at line 126 of file CCylinder.h.

References mrpt::opengl::CRenderizableDisplayList::notifyChange().

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

Sets both radii independently.

See also:
setRadius

Definition at line 118 of file CCylinder.h.

References mrpt::opengl::CRenderizableDisplayList::notifyChange().

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 110 of file CCylinder.h.

References mrpt::opengl::CRenderizableDisplayList::notifyChange().

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 151 of file CCylinder.h.

References mrpt::opengl::CRenderizableDisplayList::notifyChange().

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

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

Definition at line 158 of file CCylinder.h.

References mrpt::opengl::CRenderizableDisplayList::notifyChange().

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

Definition at line 50 of file CCylinder.h.

Definition at line 50 of file CCylinder.h.

Definition at line 50 of file CCylinder.h.

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 55 of file CCylinder.h.

Definition at line 67 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 67 of file CCylinder.h.

Cylinder's height.

Definition at line 59 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 63 of file CCylinder.h.

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

Definition at line 63 of file CCylinder.h.

Definition at line 55 of file CCylinder.h.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Sun Oct 16 12:16:33 UTC 2011