Go to the documentation of this file.
9 #ifndef opengl_CCylinder_H
10 #define opengl_CCylinder_H
51 static CCylinderPtr Create(
const float baseRadius,
const float topRadius,
const float height=1,
const int slices=10,
const int stacks=10);
64 inline
void setHasBases(
bool top=true,
bool bottom=true) {
66 mHasBottomBase=bottom;
81 return mHasBottomBase;
88 mBaseRadius=mTopRadius=radius;
158 CCylinder():mBaseRadius(1),mTopRadius(1),mHeight(1),mSlices(10),mStacks(10),mHasTopBase(true),mHasBottomBase(true) {};
162 CCylinder(
const float baseRadius,
const float topRadius,
const float height,
const int slices,
const int stacks):mBaseRadius(baseRadius),mTopRadius(topRadius),mHeight(height),mSlices(slices),mStacks(stacks),mHasTopBase(true),mHasBottomBase(true) {};
171 if (!reachesHeight(Z))
return false;
172 r=(Z/mHeight)*(mTopRadius-mBaseRadius)+mBaseRadius;
179 return (mHeight<0)?(Z>=mHeight&&Z<=0):(Z<=mHeight&&Z>=0);
uint32_t getStacksCount() const
Sets the amount of stacks used to display the object.
void setStacksCount(uint32_t stacks)
Gets how many stacks are used in the cylinder's lateral area.
CCylinder()
Basic empty constructor.
void setHeight(float height)
Chenges cylinder's height.
A renderizable object suitable for rendering with OpenGL's display lists.
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated)
A cylinder or cone whose base lies in the XY plane.
class OPENGL_IMPEXP CCylinder
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.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
float getTopRadius() const
Gets the top radius.
CCylinder(const float baseRadius, const float topRadius, const float height, const int slices, const int stacks)
Complete constructor.
float getHeight() const
Gets the cylinder's height.
bool getRadius(float Z, float &r) const
Gets the radius of the circunference located at certain height, returning false if the cylinder doesn...
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
bool reachesHeight(float Z) const
Checks whether the cylinder exists at some height.
void setSlicesCount(uint32_t slices)
Gets how many slices are used in the cylinder's lateral area and in its bases.
bool mHasTopBase
Boolean parameters about including the bases in the object.
#define DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
This declaration must be inserted in all CSerializable classes definition, before the class declarati...
float getBottomRadius() const
Gets the bottom radius.
bool hasTopBase() const
Check whether top base is displayed.
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
uint32_t getSlicesCount() const
Sets the amount of slices used to display the object.
bool BASE_IMPEXP traceRay(const vector< TPolygonWithPlane > &vec, const mrpt::poses::CPose3D &pose, double &dist)
Fast ray tracing method using polygons' properties.
virtual ~CCylinder()
Destructor.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
float mHeight
Cylinder's height.
Page generated by Doxygen 1.8.17 for MRPT 1.4.0 SVN: at Sat Jan 18 22:37:07 UTC 2020 | | |