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

Definition at line 48 of file CCylinder.h.

#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::CObjectduplicate () const
 Returns a copy of the object, indepently of its class.
static mrpt::utils::CObjectCreateObject ()
static CCylinderPtr Create ()

Member Typedef Documentation

A typedef for the associated smart pointer

Definition at line 49 of file CCylinder.h.


Constructor & Destructor Documentation

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

Basic empty constructor.

Set all parameters to default.

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

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

Destructor.

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

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

Gets the cylinder's height.

Definition at line 144 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 189 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 164 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 170 of file CCylinder.h.

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

Gets the top radius.

Definition at line 138 of file CCylinder.h.

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

Check whether bottom base is displayed.

See also:
hasTopBase

Definition at line 102 of file CCylinder.h.

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

Check whether top base is displayed.

See also:
hasBottomBase

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

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

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

Chenges cylinder's height.

Definition at line 125 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 117 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 109 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 150 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 157 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 49 of file CCylinder.h.

Definition at line 49 of file CCylinder.h.

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

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

Cylinder's height.

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

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

Definition at line 62 of file CCylinder.h.

Definition at line 54 of file CCylinder.h.




Page generated by Doxygen 1.7.2 for MRPT 0.9.4 SVN: at Mon Jan 10 22:30:30 UTC 2011