This object represents any figure obtained by extruding any profile along a given axis.
The profile should lie over a x=0 plane, and the axis must be roughly perpendicular to this plane. In particular, it should be almost perpendicular to the Z axis.
Definition at line 47 of file CGeneralizedCylinder.h.
#include <mrpt/opengl/CGeneralizedCylinder.h>
Classes | |
struct | TQuadrilateral |
Auxiliary struct holding any quadrilateral, represented by foour points. More... | |
Public Member Functions | |
void | render_dl () const |
Render. | |
virtual bool | traceRay (const mrpt::poses::CPose3D &o, double &dist) const |
Ray tracing. | |
void | getAxis (std::vector< TPoint3D > &a) const |
Get axis's spatial coordinates. | |
void | getAxis (std::vector< CPose3D > &a) const |
Get axis, including angular coordinates. | |
void | setAxis (const std::vector< TPoint3D > &a) |
Set the axis points. | |
void | getGeneratrix (std::vector< TPoint3D > &g) const |
Get cylinder's profile. | |
void | setGeneratrix (const std::vector< TPoint3D > g) |
Set cylinder's profile. | |
bool | isClosed () const |
Returns true if each section is a closed polygon. | |
void | setClosed (bool c=true) |
Set whether each section is a closed polygon or not. | |
void | getOrigin (CPolyhedronPtr &poly) const |
Get a polyhedron containing the starting point of the cylinder (its "base"). | |
void | getEnd (CPolyhedronPtr &poly) const |
Get a polyhedron containing the ending point of the cylinder (its "base"). | |
void | generateSetOfPolygons (std::vector< TPolygon3D > &res) const |
Get the cylinder as a set of polygons in 3D. | |
void | getClosedSection (size_t index1, size_t index2, CPolyhedronPtr &poly) const |
Get a polyhedron consisting of a set of closed sections of the cylinder. | |
void | getClosedSection (size_t index, CPolyhedronPtr &poly) const |
Get a polyhedron consisting of a single section of the cylinder. | |
size_t | getNumberOfSections () const |
Get the number of sections in this cylinder. | |
size_t | getVisibleSections () const |
Get how many visible sections are in the cylinder. | |
void | getVisibleSections (size_t &first, size_t &last) const |
Gets the cylinder's visible sections. | |
void | setAllSectionsVisible () |
Sets all sections visible. | |
void | setAllSectionsInvisible (size_t pointer=0) |
Hides all sections. | |
void | setVisibleSections (size_t first, size_t last) |
Sets which sections are visible. | |
void | addVisibleSectionAtStart () |
Adds another visible section at the start of the cylinder. | |
void | addVisibleSectionAtEnd () |
Adds another visible section at the end of the cylinder. | |
void | removeVisibleSectionAtStart () |
Removes a visible section from the start of the currently visible set. | |
void | removeVisibleSectionAtEnd () |
Removes a visible section from the ending of the currently visible set. | |
bool | getFirstSectionPose (mrpt::poses::CPose3D &p) |
Gets the axis pose of the first section, returning false if there is no such pose. | |
bool | getLastSectionPose (mrpt::poses::CPose3D &p) |
Gets the axis pose of the last section, returning false if there is no such pose. | |
bool | getFirstVisibleSectionPose (mrpt::poses::CPose3D &p) |
Gets the axis pose of the first visible section, returning false if there is no such pose. | |
bool | getLastVisibleSectionPose (mrpt::poses::CPose3D &p) |
Gets the axis pose of the last section, returning false if there is no such pose. | |
void | updatePolys () const |
Updates the mutable set of polygons used in ray tracing. | |
Static Public Member Functions | |
static CGeneralizedCylinderPtr | Create (const std::vector< TPoint3D > &axis, const std::vector< TPoint3D > &generatrix) |
Creation of generalized cylinder from axis and generatrix. | |
Protected Attributes | |
vector< CPose3D > | axis |
Cylinder's axis. | |
vector< TPoint3D > | generatrix |
Object's generatrix, that is, profile which will be extruded. | |
std::vector< TQuadrilateral > | mesh |
Mutable object with mesh information, used to avoid repeated computations. | |
CMatrixTemplate< TPoint3D > | pointsMesh |
Mutable object with the cylinder's points, used to avoid repeated computations. | |
bool | meshUpToDate |
Mutable flag which tells if recalculations are needed. | |
vector< TPolygonWithPlane > | polys |
Mutable set of data used in ray tracing. | |
bool | polysUpToDate |
Mutable flag telling whether ray tracing temporary data must be recalculated or not. | |
bool | closed |
Boolean variable which determines if the profile is closed at each section. | |
bool | fullyVisible |
Flag to determine whether the object is fully visible or only some sections are. | |
size_t | firstSection |
First visible section, if fullyVisible is set to false. | |
size_t | lastSection |
Last visible section, if fullyVisible is set to false. | |
Private Member Functions | |
void | generatePoses (const std::vector< TPoint3D > &pIn, std::vector< CPose3D > &pOut) |
Updates the axis, transforming each point into a pose pointing to the next section. | |
void | updateMesh () const |
Updates the mutable mesh. | |
void | getMeshIterators (const vector< TQuadrilateral > &m, vector< TQuadrilateral >::const_iterator &begin, vector< TQuadrilateral >::const_iterator &end) const |
Given a vector of polyhedrons, gets the starting and ending iterators to the section to be actually rendered. | |
CGeneralizedCylinder () | |
Basic constructor with default initialization. | |
CGeneralizedCylinder (const std::vector< TPoint3D > &a, const std::vector< TPoint3D > &g) | |
Constructor with axis and generatrix. | |
virtual | ~CGeneralizedCylinder () |
Destructor. | |
RTTI stuff | |
typedef CGeneralizedCylinderPtr | SmartPtr |
static mrpt::utils::CLASSINIT | _init_CGeneralizedCylinder |
static mrpt::utils::TRuntimeClassId | classCGeneralizedCylinder |
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 CGeneralizedCylinderPtr | Create () |
A typedef for the associated smart pointer
Definition at line 48 of file CGeneralizedCylinder.h.
mrpt::opengl::CGeneralizedCylinder::CGeneralizedCylinder | ( | ) | [inline, private] |
Basic constructor with default initialization.
Definition at line 371 of file CGeneralizedCylinder.h.
mrpt::opengl::CGeneralizedCylinder::CGeneralizedCylinder | ( | const std::vector< TPoint3D > & | a, |
const std::vector< TPoint3D > & | g | ||
) | [inline, private] |
Constructor with axis and generatrix.
Definition at line 375 of file CGeneralizedCylinder.h.
virtual mrpt::opengl::CGeneralizedCylinder::~CGeneralizedCylinder | ( | ) | [inline, private, virtual] |
Destructor.
Definition at line 381 of file CGeneralizedCylinder.h.
static const mrpt::utils::TRuntimeClassId* mrpt::opengl::CGeneralizedCylinder::_GetBaseClass | ( | ) | [static, protected] |
Reimplemented from mrpt::opengl::CRenderizableDisplayList.
void mrpt::opengl::CGeneralizedCylinder::addVisibleSectionAtEnd | ( | ) | [inline] |
Adds another visible section at the end of the cylinder.
The cylinder must have an invisible section to display.
std::logic_error | if there is no section to add to the displaying set. |
Definition at line 318 of file CGeneralizedCylinder.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CGeneralizedCylinder::addVisibleSectionAtStart | ( | ) | [inline] |
Adds another visible section at the start of the cylinder.
The cylinder must have an invisble section to display.
std::logic_error | if there is no section to add to the displaying set. |
Definition at line 308 of file CGeneralizedCylinder.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
static CGeneralizedCylinderPtr mrpt::opengl::CGeneralizedCylinder::Create | ( | ) | [static] |
static CGeneralizedCylinderPtr mrpt::opengl::CGeneralizedCylinder::Create | ( | const std::vector< TPoint3D > & | axis, |
const std::vector< TPoint3D > & | generatrix | ||
) | [inline, static] |
Creation of generalized cylinder from axis and generatrix.
Definition at line 156 of file CGeneralizedCylinder.h.
References mrpt::opengl::CGeneralizedCylinder.
static mrpt::utils::CObject* mrpt::opengl::CGeneralizedCylinder::CreateObject | ( | ) | [static] |
virtual mrpt::utils::CObject* mrpt::opengl::CGeneralizedCylinder::duplicate | ( | ) | const [virtual] |
Returns a copy of the object, indepently of its class.
Implements mrpt::utils::CObject.
void mrpt::opengl::CGeneralizedCylinder::generatePoses | ( | const std::vector< TPoint3D > & | pIn, |
std::vector< CPose3D > & | pOut | ||
) | [private] |
Updates the axis, transforming each point into a pose pointing to the next section.
void mrpt::opengl::CGeneralizedCylinder::generateSetOfPolygons | ( | std::vector< TPolygon3D > & | res | ) | const |
Get the cylinder as a set of polygons in 3D.
void mrpt::opengl::CGeneralizedCylinder::getAxis | ( | std::vector< TPoint3D > & | a | ) | const [inline] |
Get axis's spatial coordinates.
Definition at line 172 of file CGeneralizedCylinder.h.
void mrpt::opengl::CGeneralizedCylinder::getAxis | ( | std::vector< CPose3D > & | a | ) | const [inline] |
Get axis, including angular coordinates.
Definition at line 185 of file CGeneralizedCylinder.h.
void mrpt::opengl::CGeneralizedCylinder::getClosedSection | ( | size_t | index1, |
size_t | index2, | ||
CPolyhedronPtr & | poly | ||
) | const |
Get a polyhedron consisting of a set of closed sections of the cylinder.
void mrpt::opengl::CGeneralizedCylinder::getClosedSection | ( | size_t | index, |
CPolyhedronPtr & | poly | ||
) | const [inline] |
Get a polyhedron consisting of a single section of the cylinder.
Definition at line 249 of file CGeneralizedCylinder.h.
void mrpt::opengl::CGeneralizedCylinder::getEnd | ( | CPolyhedronPtr & | poly | ) | const |
Get a polyhedron containing the ending point of the cylinder (its "base").
bool mrpt::opengl::CGeneralizedCylinder::getFirstSectionPose | ( | mrpt::poses::CPose3D & | p | ) |
Gets the axis pose of the first section, returning false if there is no such pose.
bool mrpt::opengl::CGeneralizedCylinder::getFirstVisibleSectionPose | ( | mrpt::poses::CPose3D & | p | ) |
Gets the axis pose of the first visible section, returning false if there is no such pose.
void mrpt::opengl::CGeneralizedCylinder::getGeneratrix | ( | std::vector< TPoint3D > & | g | ) | const [inline] |
Get cylinder's profile.
Definition at line 200 of file CGeneralizedCylinder.h.
bool mrpt::opengl::CGeneralizedCylinder::getLastSectionPose | ( | mrpt::poses::CPose3D & | p | ) |
Gets the axis pose of the last section, returning false if there is no such pose.
bool mrpt::opengl::CGeneralizedCylinder::getLastVisibleSectionPose | ( | mrpt::poses::CPose3D & | p | ) |
Gets the axis pose of the last section, returning false if there is no such pose.
void mrpt::opengl::CGeneralizedCylinder::getMeshIterators | ( | const vector< TQuadrilateral > & | m, |
vector< TQuadrilateral >::const_iterator & | begin, | ||
vector< TQuadrilateral >::const_iterator & | end | ||
) | const [private] |
Given a vector of polyhedrons, gets the starting and ending iterators to the section to be actually rendered.
size_t mrpt::opengl::CGeneralizedCylinder::getNumberOfSections | ( | ) | const [inline] |
Get the number of sections in this cylinder.
Definition at line 255 of file CGeneralizedCylinder.h.
void mrpt::opengl::CGeneralizedCylinder::getOrigin | ( | CPolyhedronPtr & | poly | ) | const |
Get a polyhedron containing the starting point of the cylinder (its "base").
virtual const mrpt::utils::TRuntimeClassId* mrpt::opengl::CGeneralizedCylinder::GetRuntimeClass | ( | ) | const [virtual] |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::opengl::CRenderizableDisplayList.
size_t mrpt::opengl::CGeneralizedCylinder::getVisibleSections | ( | ) | const [inline] |
Get how many visible sections are in the cylinder.
Definition at line 261 of file CGeneralizedCylinder.h.
void mrpt::opengl::CGeneralizedCylinder::getVisibleSections | ( | size_t & | first, |
size_t & | last | ||
) | const [inline] |
Gets the cylinder's visible sections.
Definition at line 267 of file CGeneralizedCylinder.h.
bool mrpt::opengl::CGeneralizedCylinder::isClosed | ( | ) | const [inline] |
Returns true if each section is a closed polygon.
Definition at line 214 of file CGeneralizedCylinder.h.
void mrpt::opengl::CGeneralizedCylinder::removeVisibleSectionAtEnd | ( | ) |
Removes a visible section from the ending of the currently visible set.
std::logic_error | when there is no such section. |
void mrpt::opengl::CGeneralizedCylinder::removeVisibleSectionAtStart | ( | ) |
Removes a visible section from the start of the currently visible set.
std::logic_error | if there are no visible sections. |
void mrpt::opengl::CGeneralizedCylinder::render_dl | ( | ) | const [virtual] |
void mrpt::opengl::CGeneralizedCylinder::setAllSectionsInvisible | ( | size_t | pointer = 0 | ) | [inline] |
Hides all sections.
Definition at line 286 of file CGeneralizedCylinder.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CGeneralizedCylinder::setAllSectionsVisible | ( | ) | [inline] |
Sets all sections visible.
Definition at line 279 of file CGeneralizedCylinder.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CGeneralizedCylinder::setAxis | ( | const std::vector< TPoint3D > & | a | ) | [inline] |
Set the axis points.
Definition at line 191 of file CGeneralizedCylinder.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CGeneralizedCylinder::setClosed | ( | bool | c = true | ) | [inline] |
Set whether each section is a closed polygon or not.
Definition at line 220 of file CGeneralizedCylinder.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CGeneralizedCylinder::setGeneratrix | ( | const std::vector< TPoint3D > | g | ) | [inline] |
Set cylinder's profile.
Definition at line 206 of file CGeneralizedCylinder.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
void mrpt::opengl::CGeneralizedCylinder::setVisibleSections | ( | size_t | first, |
size_t | last | ||
) | [inline] |
Sets which sections are visible.
std::logic_error | on wrongly defined bounds. |
Definition at line 296 of file CGeneralizedCylinder.h.
References mrpt::opengl::CRenderizableDisplayList::notifyChange().
virtual bool mrpt::opengl::CGeneralizedCylinder::traceRay | ( | const mrpt::poses::CPose3D & | o, |
double & | dist | ||
) | const [virtual] |
void mrpt::opengl::CGeneralizedCylinder::updateMesh | ( | ) | const [private] |
Updates the mutable mesh.
void mrpt::opengl::CGeneralizedCylinder::updatePolys | ( | ) | const |
Updates the mutable set of polygons used in ray tracing.
mrpt::utils::CLASSINIT mrpt::opengl::CGeneralizedCylinder::_init_CGeneralizedCylinder [static, protected] |
Definition at line 48 of file CGeneralizedCylinder.h.
vector<CPose3D> mrpt::opengl::CGeneralizedCylinder::axis [protected] |
Cylinder's axis.
It's represented as a pose because it holds the angle to get to the next pose.
Definition at line 108 of file CGeneralizedCylinder.h.
Definition at line 48 of file CGeneralizedCylinder.h.
Definition at line 48 of file CGeneralizedCylinder.h.
bool mrpt::opengl::CGeneralizedCylinder::closed [protected] |
Boolean variable which determines if the profile is closed at each section.
Definition at line 137 of file CGeneralizedCylinder.h.
size_t mrpt::opengl::CGeneralizedCylinder::firstSection [protected] |
First visible section, if fullyVisible is set to false.
Definition at line 146 of file CGeneralizedCylinder.h.
bool mrpt::opengl::CGeneralizedCylinder::fullyVisible [protected] |
Flag to determine whether the object is fully visible or only some sections are.
Definition at line 141 of file CGeneralizedCylinder.h.
vector<TPoint3D> mrpt::opengl::CGeneralizedCylinder::generatrix [protected] |
Object's generatrix, that is, profile which will be extruded.
Definition at line 112 of file CGeneralizedCylinder.h.
size_t mrpt::opengl::CGeneralizedCylinder::lastSection [protected] |
Last visible section, if fullyVisible is set to false.
Definition at line 151 of file CGeneralizedCylinder.h.
std::vector<TQuadrilateral> mrpt::opengl::CGeneralizedCylinder::mesh [mutable, protected] |
Mutable object with mesh information, used to avoid repeated computations.
Definition at line 116 of file CGeneralizedCylinder.h.
bool mrpt::opengl::CGeneralizedCylinder::meshUpToDate [mutable, protected] |
Mutable flag which tells if recalculations are needed.
Definition at line 124 of file CGeneralizedCylinder.h.
CMatrixTemplate<TPoint3D> mrpt::opengl::CGeneralizedCylinder::pointsMesh [mutable, protected] |
Mutable object with the cylinder's points, used to avoid repeated computations.
Definition at line 120 of file CGeneralizedCylinder.h.
vector<TPolygonWithPlane> mrpt::opengl::CGeneralizedCylinder::polys [mutable, protected] |
Mutable set of data used in ray tracing.
Definition at line 129 of file CGeneralizedCylinder.h.
bool mrpt::opengl::CGeneralizedCylinder::polysUpToDate [mutable, protected] |
Mutable flag telling whether ray tracing temporary data must be recalculated or not.
Definition at line 133 of file CGeneralizedCylinder.h.
Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011 |