This object represents any figure obtained by extruding any profile along a given axis. More...
#include <mrpt/opengl/CGeneralizedCylinder.h>
Classes | |
struct | TQuadrilateral |
Auxiliary struct holding any quadrilateral, represented by foour points. More... | |
Public Member Functions | |
void | render () 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. |
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 46 of file CGeneralizedCylinder.h.
mrpt::opengl::CGeneralizedCylinder::CGeneralizedCylinder | ( | ) | [inline, private] |
Basic constructor with default initialization.
Definition at line 362 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 366 of file CGeneralizedCylinder.h.
virtual mrpt::opengl::CGeneralizedCylinder::~CGeneralizedCylinder | ( | ) | [inline, private, virtual] |
Destructor.
Definition at line 372 of file CGeneralizedCylinder.h.
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 310 of file CGeneralizedCylinder.h.
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 301 of file CGeneralizedCylinder.h.
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 155 of file CGeneralizedCylinder.h.
References mrpt::opengl::CGeneralizedCylinder.
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< CPose3D > & | a | ) | const [inline] |
Get axis, including angular coordinates.
Definition at line 184 of file CGeneralizedCylinder.h.
void mrpt::opengl::CGeneralizedCylinder::getAxis | ( | std::vector< TPoint3D > & | a | ) | const [inline] |
Get axis's spatial coordinates.
Definition at line 171 of file CGeneralizedCylinder.h.
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 245 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::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 198 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 251 of file CGeneralizedCylinder.h.
void mrpt::opengl::CGeneralizedCylinder::getOrigin | ( | CPolyhedronPtr & | poly | ) | const |
Get a polyhedron containing the starting point of the cylinder (its "base").
void mrpt::opengl::CGeneralizedCylinder::getVisibleSections | ( | size_t & | first, | |
size_t & | last | |||
) | const [inline] |
Gets the cylinder's visible sections.
Definition at line 263 of file CGeneralizedCylinder.h.
size_t mrpt::opengl::CGeneralizedCylinder::getVisibleSections | ( | ) | const [inline] |
Get how many visible sections are in the cylinder.
Definition at line 257 of file CGeneralizedCylinder.h.
bool mrpt::opengl::CGeneralizedCylinder::isClosed | ( | ) | const [inline] |
Returns true if each section is a closed polygon.
Definition at line 211 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 | ( | ) | const [virtual] |
void mrpt::opengl::CGeneralizedCylinder::setAllSectionsInvisible | ( | size_t | pointer = 0 |
) | [inline] |
Hides all sections.
Definition at line 281 of file CGeneralizedCylinder.h.
void mrpt::opengl::CGeneralizedCylinder::setAllSectionsVisible | ( | ) | [inline] |
Sets all sections visible.
Definition at line 275 of file CGeneralizedCylinder.h.
void mrpt::opengl::CGeneralizedCylinder::setAxis | ( | const std::vector< TPoint3D > & | a | ) | [inline] |
Set the axis points.
Definition at line 190 of file CGeneralizedCylinder.h.
void mrpt::opengl::CGeneralizedCylinder::setClosed | ( | bool | c = true |
) | [inline] |
Set whether each section is a closed polygon or not.
Definition at line 217 of file CGeneralizedCylinder.h.
void mrpt::opengl::CGeneralizedCylinder::setGeneratrix | ( | const std::vector< TPoint3D > | g | ) | [inline] |
Set cylinder's profile.
Definition at line 204 of file CGeneralizedCylinder.h.
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 290 of file CGeneralizedCylinder.h.
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.
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 107 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 136 of file CGeneralizedCylinder.h.
size_t mrpt::opengl::CGeneralizedCylinder::firstSection [protected] |
First visible section, if fullyVisible is set to false.
Definition at line 145 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 140 of file CGeneralizedCylinder.h.
vector<TPoint3D> mrpt::opengl::CGeneralizedCylinder::generatrix [protected] |
Object's generatrix, that is, profile which will be extruded.
Definition at line 111 of file CGeneralizedCylinder.h.
size_t mrpt::opengl::CGeneralizedCylinder::lastSection [protected] |
Last visible section, if fullyVisible is set to false.
Definition at line 150 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 115 of file CGeneralizedCylinder.h.
bool mrpt::opengl::CGeneralizedCylinder::meshUpToDate [mutable, protected] |
Mutable flag which tells if recalculations are needed.
Definition at line 123 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 119 of file CGeneralizedCylinder.h.
vector<TPolygonWithPlane> mrpt::opengl::CGeneralizedCylinder::polys [mutable, protected] |
Mutable set of data used in ray tracing.
Definition at line 128 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 132 of file CGeneralizedCylinder.h.
Page generated by Doxygen 1.6.1 for MRPT 0.7.1 SVN: at Tue Dec 22 08:29:35 CET 2009 |