Main MRPT website > C++ reference for MRPT 1.9.9
CGeneralizedCylinder.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #ifndef opengl_CGeneralizedCylinder_H
10 #define opengl_CGeneralizedCylinder_H
11 
15 #include <mrpt/math/geometry.h>
18 
19 namespace mrpt
20 {
21 namespace opengl
22 {
23 class CGeneralizedCylinder;
24 /**
25  * This object represents any figure obtained by extruding any profile along a
26  * given axis. The profile should lie over a x=0 plane, and the axis must be
27  * roughly perpendicular to this plane. In particular, it should be almost
28  * perpendicular to the Z axis.
29  * \ingroup mrpt_opengl_grp
30  */
32 {
34  public:
35  /**
36  * Auxiliary struct holding any quadrilateral, represented by foour points.
37  */
39  {
40  private:
41  /**
42  * Automatically compute a vector normal to this quadrilateral.
43  */
44  void calculateNormal();
45 
46  public:
47  /**
48  * Quadrilateral`'s points.
49  */
51  /**
52  * Normal vector.
53  */
54  double normal[3];
55  /**
56  * Given a polygon with 4 already positions allocated, this method
57  * fills it with the quadrilateral points.
58  * \sa mrpt::math::TPolygon3D
59  */
61  {
62  vec[0] = points[0];
63  vec[1] = points[1];
64  vec[2] = points[2];
65  vec[3] = points[3];
66  }
67  /**
68  * Constructor from 4 points.
69  */
71  const mrpt::math::TPoint3D& p1, const mrpt::math::TPoint3D& p2,
72  const mrpt::math::TPoint3D& p3, const mrpt::math::TPoint3D& p4)
73  {
74  points[0] = p1;
75  points[1] = p2;
76  points[2] = p3;
77  points[3] = p4;
79  }
80  /**
81  * Construction from any array of four compatible objects.
82  */
83  template <class T>
84  TQuadrilateral(const T (&p)[4])
85  {
86  for (int i = 0; i < 4; i++) points[i] = p[i];
88  }
89  /**
90  * Empty constructor. Initializes to garbage.
91  */
93  /**
94  * Destructor.
95  */
97  };
98 
99  protected:
100  /** Cylinder's axis. It's represented as a pose because it holds the angle
101  * to get to the next pose. */
103  /** Object's generatrix, that is, profile which will be extruded. */
104  std::vector<mrpt::math::TPoint3D> generatrix;
105  /** Mutable object with mesh information, used to avoid repeated
106  * computations. */
107  mutable std::vector<TQuadrilateral> mesh;
108  /** Mutable object with the cylinder's points, used to avoid repeated
109  * computations. */
111  /** Mutable flag which tells if recalculations are needed. */
112  mutable bool meshUpToDate;
113  /**
114  * Mutable set of data used in ray tracing.
115  * \sa mrpt::math::TPolygonWithPlane
116  */
117  mutable std::vector<mrpt::math::TPolygonWithPlane> polys;
118  /** Mutable flag telling whether ray tracing temporary data must be
119  * recalculated or not. */
120  mutable bool polysUpToDate;
121  /** Boolean variable which determines if the profile is closed at each
122  * section. */
123  bool closed;
124  /** Flag to determine whether the object is fully visible or only some
125  * sections are. */
127  /**
128  * First visible section, if fullyVisible is set to false.
129  * \sa fullyVisible,lastSection
130  */
131  size_t firstSection;
132  /**
133  * Last visible section, if fullyVisible is set to false.
134  * \sa fullyVisible,firstSection
135  */
136  size_t lastSection;
137 
138  public:
139  /**
140  * Creation of generalized cylinder from axis and generatrix
141  */
143  const std::vector<mrpt::math::TPoint3D>& axis,
144  const std::vector<mrpt::math::TPoint3D>& generatrix);
145  /**
146  * Render.
147  * \sa mrpt::opengl::CRenderizable
148  */
149  void render_dl() const override;
150  /**
151  * Ray tracing.
152  * \sa mrpt::opengl::CRenderizable.
153  */
154  bool traceRay(const mrpt::poses::CPose3D& o, double& dist) const override;
155  /**
156  * Get axis's spatial coordinates.
157  */
158  inline void getAxis(std::vector<mrpt::math::TPoint3D>& a) const
159  {
160  // a=axis;
161  size_t N = axis.size();
162  a.resize(N);
163  for (size_t i = 0; i < N; i++)
164  {
165  a[i].x = axis[i].x();
166  a[i].y = axis[i].y();
167  a[i].z = axis[i].z();
168  }
169  }
170  /**
171  * Get axis, including angular coordinates.
172  */
174  {
175  a = axis;
176  }
177  /**
178  * Set the axis points.
179  */
180  inline void setAxis(const std::vector<mrpt::math::TPoint3D>& a)
181  {
182  generatePoses(a, axis);
183  meshUpToDate = false;
184  fullyVisible = true;
186  }
187  /**
188  * Get cylinder's profile.
189  */
190  inline void getGeneratrix(std::vector<mrpt::math::TPoint3D>& g) const
191  {
192  g = generatrix;
193  }
194  /**
195  * Set cylinder's profile.
196  */
197  inline void setGeneratrix(const std::vector<mrpt::math::TPoint3D>& g)
198  {
199  generatrix = g;
200  meshUpToDate = false;
202  }
203  /**
204  * Returns true if each section is a closed polygon.
205  */
206  inline bool isClosed() const { return closed; }
207  /**
208  * Set whether each section is a closed polygon or not.
209  */
210  inline void setClosed(bool c = true)
211  {
212  closed = c;
213  meshUpToDate = false;
215  }
216  /**
217  * Get a polyhedron containing the starting point of the cylinder (its
218  * "base").
219  * \sa getEnd,mrpt::opengl::CPolyhedron
220  */
221  void getOrigin(CPolyhedron::Ptr& poly) const;
222  /**
223  * Get a polyhedron containing the ending point of the cylinder (its
224  * "base").
225  * \sa getOrigin,mrpt::opengl::CPolyhedron
226  */
227  void getEnd(CPolyhedron::Ptr& poly) const;
228  /**
229  * Get the cylinder as a set of polygons in 3D.
230  * \sa mrpt::math::TPolygon3D
231  */
232  void generateSetOfPolygons(std::vector<mrpt::math::TPolygon3D>& res) const;
233  /**
234  * Get a polyhedron consisting of a set of closed sections of the cylinder.
235  * \sa mrpt::opengl::CPolyhedron
236  */
237  void getClosedSection(
238  size_t index1, size_t index2, CPolyhedron::Ptr& poly) const;
239  /**
240  * Get a polyhedron consisting of a single section of the cylinder.
241  * \sa mrpt::opengl::CPolyhedron
242  */
243  inline void getClosedSection(size_t index, CPolyhedron::Ptr& poly) const
244  {
245  getClosedSection(index, index, poly);
246  }
247  /**
248  * Get the number of sections in this cylinder.
249  */
250  inline size_t getNumberOfSections() const
251  {
252  return axis.size() ? (axis.size() - 1) : 0;
253  }
254  /**
255  * Get how many visible sections are in the cylinder.
256  */
257  inline size_t getVisibleSections() const
258  {
261  }
262  /**
263  * Gets the cylinder's visible sections.
264  */
265  void getVisibleSections(size_t& first, size_t& last) const
266  {
267  if (fullyVisible)
268  {
269  first = 0;
270  last = getNumberOfSections();
271  }
272  else
273  {
275  last = lastSection;
276  }
277  }
278  /**
279  * Sets all sections visible.
280  */
281  inline void setAllSectionsVisible()
282  {
283  fullyVisible = true;
285  }
286  /**
287  * Hides all sections.
288  */
289  inline void setAllSectionsInvisible(size_t pointer = 0)
290  {
291  fullyVisible = false;
295  }
296  /**
297  * Sets which sections are visible.
298  * \throw std::logic_error on wrongly defined bounds.
299  */
300  inline void setVisibleSections(size_t first, size_t last)
301  {
302  fullyVisible = false;
303  if (first > last || last > getNumberOfSections())
304  throw std::logic_error("Wrong bound definition");
306  lastSection = last;
308  }
309  /**
310  * Adds another visible section at the start of the cylinder. The cylinder
311  * must have an invisble section to display.
312  * \throw std::logic_error if there is no section to add to the displaying
313  * set.
314  * \sa
315  * addVisibleSectionAtEnd,removeVisibleSectionAtStart,removeVisibleSectionAtEnd
316  */
318  {
319  if (fullyVisible || firstSection == 0)
320  throw std::logic_error("No more sections");
321  firstSection--;
323  }
324  /**
325  * Adds another visible section at the end of the cylinder. The cylinder
326  * must have an invisible section to display.
327  * \throw std::logic_error if there is no section to add to the displaying
328  * set.
329  * \sa
330  * addVisibleSectionAtStart,removeVisibleSectionAtStart,removeVisibleSectionAtEnd
331  */
333  {
335  throw std::logic_error("No more sections");
336  lastSection++;
338  }
339  /**
340  * Removes a visible section from the start of the currently visible set.
341  * \throw std::logic_error if there are no visible sections.
342  * \sa
343  * addVisibleSectionAtStart,addVisibleSectionAtEnd,removeVisibleSectionAtEnd
344  */
346  /**
347  * Removes a visible section from the ending of the currently visible set.
348  * \throw std::logic_error when there is no such section.
349  * \sa
350  * addVisibleSectionAtStart,addVisibleSectionAtEnd,removeVisibleSectionAtStart
351  */
353  /**
354  * Gets the axis pose of the first section, returning false if there is no
355  * such pose.
356  */
358  /**
359  * Gets the axis pose of the last section, returning false if there is no
360  * such pose.
361  */
363  /**
364  * Gets the axis pose of the first visible section, returning false if
365  * there is no such pose.
366  */
368  /**
369  * Gets the axis pose of the last section, returning false if there is no
370  * such pose.
371  */
373  /**
374  * Updates the mutable set of polygons used in ray tracing.
375  */
376  void updatePolys() const;
377 
378  /** Evaluates the bounding box of this object (including possible children)
379  * in the coordinate frame of the object parent. */
380  void getBoundingBox(
381  mrpt::math::TPoint3D& bb_min,
382  mrpt::math::TPoint3D& bb_max) const override;
383 
384  private:
385  /**
386  * Updates the axis, transforming each point into a pose pointing to the
387  * next section.
388  */
389  void generatePoses(
390  const std::vector<mrpt::math::TPoint3D>& pIn,
392  /**
393  * Updates the mutable mesh.
394  */
395  void updateMesh() const;
396  /**
397  * Given a vector of polyhedrons, gets the starting and ending iterators to
398  * the section to be actually rendered.
399  */
400  void getMeshIterators(
401  const std::vector<TQuadrilateral>& m,
404 
405  public:
406  /**
407  * Basic constructor with default initialization.
408  */
410  : axis(),
411  generatrix(),
412  mesh(),
413  meshUpToDate(false),
414  polysUpToDate(false),
415  closed(false),
416  fullyVisible(true)
417  {
418  }
419  /**
420  * Constructor with axis and generatrix.
421  */
423  const std::vector<mrpt::math::TPoint3D>& a,
424  const std::vector<mrpt::math::TPoint3D>& g)
425  : generatrix(g),
426  mesh(),
427  meshUpToDate(false),
428  polysUpToDate(false),
429  closed(false),
430  fullyVisible(true)
431  {
432  generatePoses(a, axis);
433  }
434  /**
435  * Destructor.
436  */
438 };
439 } // namespace opengl
440 } // namespace mrpt
441 #endif
begin
EIGEN_STRONG_INLINE iterator begin()
Definition: eigen_plugins.h:29
const_iterator
const Scalar * const_iterator
Definition: eigen_plugins.h:27
mrpt::opengl::CGeneralizedCylinder::fullyVisible
bool fullyVisible
Flag to determine whether the object is fully visible or only some sections are.
Definition: CGeneralizedCylinder.h:126
geometry.h
mrpt::opengl::CGeneralizedCylinder::Create
static Ptr Create(Args &&... args)
Definition: CGeneralizedCylinder.h:33
mrpt::opengl::CGeneralizedCylinder::render_dl
void render_dl() const override
Render.
Definition: CGeneralizedCylinder.cpp:84
mrpt::opengl::CGeneralizedCylinder::getAxis
void getAxis(mrpt::aligned_std_vector< mrpt::poses::CPose3D > &a) const
Get axis, including angular coordinates.
Definition: CGeneralizedCylinder.h:173
mrpt::opengl::CGeneralizedCylinder::getLastVisibleSectionPose
bool getLastVisibleSectionPose(mrpt::poses::CPose3D &p)
Gets the axis pose of the last section, returning false if there is no such pose.
Definition: CGeneralizedCylinder.cpp:376
CRenderizableDisplayList.h
c
const GLubyte * c
Definition: glext.h:6313
mrpt::opengl::CGeneralizedCylinder::meshUpToDate
bool meshUpToDate
Mutable flag which tells if recalculations are needed.
Definition: CGeneralizedCylinder.h:112
mrpt::opengl::CGeneralizedCylinder::getEnd
void getEnd(CPolyhedron::Ptr &poly) const
Get a polyhedron containing the ending point of the cylinder (its "base").
Definition: CGeneralizedCylinder.cpp:216
end
GLuint GLuint end
Definition: glext.h:3528
mrpt::math::CMatrixTemplate< mrpt::math::TPoint3D >
mrpt::opengl::CRenderizableDisplayList
A renderizable object suitable for rendering with OpenGL's display lists.
Definition: CRenderizableDisplayList.h:39
points
GLsizei const GLfloat * points
Definition: glext.h:5339
mrpt::opengl::CGeneralizedCylinder::removeVisibleSectionAtEnd
void removeVisibleSectionAtEnd()
Removes a visible section from the ending of the currently visible set.
Definition: CGeneralizedCylinder.cpp:292
mrpt::opengl::CRenderizableDisplayList::notifyChange
EIGEN_STRONG_INLINE void notifyChange() const
Must be called to notify that the object has changed (so, the display list must be updated)
Definition: CRenderizableDisplayList.h:57
CSetOfTriangles.h
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
g
GLubyte g
Definition: glext.h:6279
mrpt::opengl::CGeneralizedCylinder::polysUpToDate
bool polysUpToDate
Mutable flag telling whether ray tracing temporary data must be recalculated or not.
Definition: CGeneralizedCylinder.h:120
mrpt::opengl::CGeneralizedCylinder::addVisibleSectionAtStart
void addVisibleSectionAtStart()
Adds another visible section at the start of the cylinder.
Definition: CGeneralizedCylinder.h:317
mrpt::opengl::CGeneralizedCylinder::setAxis
void setAxis(const std::vector< mrpt::math::TPoint3D > &a)
Set the axis points.
Definition: CGeneralizedCylinder.h:180
p
GLfloat GLfloat p
Definition: glext.h:6305
mrpt::opengl::CGeneralizedCylinder::lastSection
size_t lastSection
Last visible section, if fullyVisible is set to false.
Definition: CGeneralizedCylinder.h:136
mrpt::opengl::CGeneralizedCylinder::setGeneratrix
void setGeneratrix(const std::vector< mrpt::math::TPoint3D > &g)
Set cylinder's profile.
Definition: CGeneralizedCylinder.h:197
mrpt::opengl::CGeneralizedCylinder::getClosedSection
void getClosedSection(size_t index, CPolyhedron::Ptr &poly) const
Get a polyhedron consisting of a single section of the cylinder.
Definition: CGeneralizedCylinder.h:243
mrpt::opengl::CGeneralizedCylinder::CGeneralizedCylinder
CGeneralizedCylinder(const std::vector< mrpt::math::TPoint3D > &a, const std::vector< mrpt::math::TPoint3D > &g)
Constructor with axis and generatrix.
Definition: CGeneralizedCylinder.h:422
mrpt::opengl::CGeneralizedCylinder::getFirstSectionPose
bool getFirstSectionPose(mrpt::poses::CPose3D &p)
Gets the axis pose of the first section, returning false if there is no such pose.
Definition: CGeneralizedCylinder.cpp:354
mrpt::opengl::CGeneralizedCylinder::setClosed
void setClosed(bool c=true)
Set whether each section is a closed polygon or not.
Definition: CGeneralizedCylinder.h:210
mrpt::opengl::CGeneralizedCylinder::~CGeneralizedCylinder
virtual ~CGeneralizedCylinder()
Destructor.
Definition: CGeneralizedCylinder.h:437
mrpt::opengl::CGeneralizedCylinder::TQuadrilateral::getAsPolygonUnsafe
void getAsPolygonUnsafe(mrpt::math::TPolygon3D &vec) const
Given a polygon with 4 already positions allocated, this method fills it with the quadrilateral point...
Definition: CGeneralizedCylinder.h:60
mrpt::aligned_std_vector
std::vector< T, mrpt::aligned_allocator_cpp11< T > > aligned_std_vector
Definition: aligned_std_vector.h:15
mrpt::opengl::CGeneralizedCylinder::TQuadrilateral::~TQuadrilateral
~TQuadrilateral()
Destructor.
Definition: CGeneralizedCylinder.h:96
mrpt::opengl::CGeneralizedCylinder::axis
mrpt::aligned_std_vector< mrpt::poses::CPose3D > axis
Cylinder's axis.
Definition: CGeneralizedCylinder.h:102
mrpt::opengl::CGeneralizedCylinder::closed
bool closed
Boolean variable which determines if the profile is closed at each section.
Definition: CGeneralizedCylinder.h:123
mrpt::opengl::CGeneralizedCylinder::TQuadrilateral
Auxiliary struct holding any quadrilateral, represented by foour points.
Definition: CGeneralizedCylinder.h:38
mrpt::opengl::CGeneralizedCylinder::TQuadrilateral::calculateNormal
void calculateNormal()
Automatically compute a vector normal to this quadrilateral.
mrpt::opengl::CGeneralizedCylinder::getBoundingBox
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const override
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
Definition: CGeneralizedCylinder.cpp:384
mrpt::opengl::CPolyhedron::Ptr
std::shared_ptr< CPolyhedron > Ptr
Definition: CPolyhedron.h:46
mrpt::opengl::CGeneralizedCylinder::TQuadrilateral::TQuadrilateral
TQuadrilateral(const T(&p)[4])
Construction from any array of four compatible objects.
Definition: CGeneralizedCylinder.h:84
mrpt::opengl::CGeneralizedCylinder::getGeneratrix
void getGeneratrix(std::vector< mrpt::math::TPoint3D > &g) const
Get cylinder's profile.
Definition: CGeneralizedCylinder.h:190
mrpt::opengl::CGeneralizedCylinder::mesh
std::vector< TQuadrilateral > mesh
Mutable object with mesh information, used to avoid repeated computations.
Definition: CGeneralizedCylinder.h:107
mrpt::opengl::CGeneralizedCylinder::CGeneralizedCylinder
CGeneralizedCylinder()
Basic constructor with default initialization.
Definition: CGeneralizedCylinder.h:409
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
index
GLuint index
Definition: glext.h:4054
res
GLuint res
Definition: glext.h:7268
mrpt::opengl::CGeneralizedCylinder
This object represents any figure obtained by extruding any profile along a given axis.
Definition: CGeneralizedCylinder.h:31
mrpt::opengl::CGeneralizedCylinder::getLastSectionPose
bool getLastSectionPose(mrpt::poses::CPose3D &p)
Gets the axis pose of the last section, returning false if there is no such pose.
Definition: CGeneralizedCylinder.cpp:361
aligned_std_vector.h
mrpt::opengl::CGeneralizedCylinder::setAllSectionsInvisible
void setAllSectionsInvisible(size_t pointer=0)
Hides all sections.
Definition: CGeneralizedCylinder.h:289
mrpt::opengl::CGeneralizedCylinder::getVisibleSections
void getVisibleSections(size_t &first, size_t &last) const
Gets the cylinder's visible sections.
Definition: CGeneralizedCylinder.h:265
mrpt::math::TPolygon3D
3D polygon, inheriting from std::vector<TPoint3D>
Definition: lightweight_geom_data.h:1458
mrpt::opengl::CGeneralizedCylinder::generatrix
std::vector< mrpt::math::TPoint3D > generatrix
Object's generatrix, that is, profile which will be extruded.
Definition: CGeneralizedCylinder.h:104
mrpt::opengl::CGeneralizedCylinder::updatePolys
void updatePolys() const
Updates the mutable set of polygons used in ray tracing.
Definition: CGeneralizedCylinder.cpp:308
mrpt::opengl::CGeneralizedCylinder::setVisibleSections
void setVisibleSections(size_t first, size_t last)
Sets which sections are visible.
Definition: CGeneralizedCylinder.h:300
mrpt::math::TPoint3D
Lightweight 3D point.
Definition: lightweight_geom_data.h:378
mrpt::opengl::CGeneralizedCylinder::traceRay
bool traceRay(const mrpt::poses::CPose3D &o, double &dist) const override
Ray tracing.
Definition: CGeneralizedCylinder.cpp:128
mrpt::opengl::CGeneralizedCylinder::getClosedSection
void getClosedSection(size_t index1, size_t index2, CPolyhedron::Ptr &poly) const
Get a polyhedron consisting of a set of closed sections of the cylinder.
Definition: CGeneralizedCylinder.cpp:236
mrpt::opengl::CGeneralizedCylinder::generateSetOfPolygons
void generateSetOfPolygons(std::vector< mrpt::math::TPolygon3D > &res) const
Get the cylinder as a set of polygons in 3D.
Definition: CGeneralizedCylinder.cpp:227
mrpt::opengl::CGeneralizedCylinder::TQuadrilateral::TQuadrilateral
TQuadrilateral(const mrpt::math::TPoint3D &p1, const mrpt::math::TPoint3D &p2, const mrpt::math::TPoint3D &p3, const mrpt::math::TPoint3D &p4)
Constructor from 4 points.
Definition: CGeneralizedCylinder.h:70
mrpt::opengl::CGeneralizedCylinder::generatePoses
void generatePoses(const std::vector< mrpt::math::TPoint3D > &pIn, mrpt::aligned_std_vector< mrpt::poses::CPose3D > &pOut)
Updates the axis, transforming each point into a pose pointing to the next section.
Definition: CGeneralizedCylinder.cpp:324
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:102
mrpt::opengl::CGeneralizedCylinder::updateMesh
void updateMesh() const
Updates the mutable mesh.
Definition: CGeneralizedCylinder.cpp:134
mrpt::opengl::CGeneralizedCylinder::getVisibleSections
size_t getVisibleSections() const
Get how many visible sections are in the cylinder.
Definition: CGeneralizedCylinder.h:257
pointer
GLsizei const GLvoid * pointer
Definition: glext.h:3825
mrpt::opengl::CGeneralizedCylinder::getOrigin
void getOrigin(CPolyhedron::Ptr &poly) const
Get a polyhedron containing the starting point of the cylinder (its "base").
Definition: CGeneralizedCylinder.cpp:205
mrpt::opengl::CGeneralizedCylinder::addVisibleSectionAtEnd
void addVisibleSectionAtEnd()
Adds another visible section at the end of the cylinder.
Definition: CGeneralizedCylinder.h:332
mrpt::opengl::CGeneralizedCylinder::getFirstVisibleSectionPose
bool getFirstVisibleSectionPose(mrpt::poses::CPose3D &p)
Gets the axis pose of the first visible section, returning false if there is no such pose.
Definition: CGeneralizedCylinder.cpp:368
mrpt::opengl::CGeneralizedCylinder::pointsMesh
mrpt::math::CMatrixTemplate< mrpt::math::TPoint3D > pointsMesh
Mutable object with the cylinder's points, used to avoid repeated computations.
Definition: CGeneralizedCylinder.h:110
mrpt::opengl::CGeneralizedCylinder::polys
std::vector< mrpt::math::TPolygonWithPlane > polys
Mutable set of data used in ray tracing.
Definition: CGeneralizedCylinder.h:117
mrpt::opengl::CGeneralizedCylinder::Ptr
std::shared_ptr< CGeneralizedCylinder > Ptr
Definition: CGeneralizedCylinder.h:33
mrpt::opengl::CGeneralizedCylinder::TQuadrilateral::TQuadrilateral
TQuadrilateral()
Empty constructor.
Definition: CGeneralizedCylinder.h:92
CMatrixTemplate.h
mrpt::opengl::CGeneralizedCylinder::getNumberOfSections
size_t getNumberOfSections() const
Get the number of sections in this cylinder.
Definition: CGeneralizedCylinder.h:250
mrpt::opengl::CGeneralizedCylinder::removeVisibleSectionAtStart
void removeVisibleSectionAtStart()
Removes a visible section from the start of the currently visible set.
Definition: CGeneralizedCylinder.cpp:277
mrpt::opengl::CGeneralizedCylinder::firstSection
size_t firstSection
First visible section, if fullyVisible is set to false.
Definition: CGeneralizedCylinder.h:131
mrpt::opengl::CGeneralizedCylinder::isClosed
bool isClosed() const
Returns true if each section is a closed polygon.
Definition: CGeneralizedCylinder.h:206
mrpt::opengl::CGeneralizedCylinder::getAxis
void getAxis(std::vector< mrpt::math::TPoint3D > &a) const
Get axis's spatial coordinates.
Definition: CGeneralizedCylinder.h:158
mrpt::opengl::CGeneralizedCylinder::TQuadrilateral::normal
double normal[3]
Normal vector.
Definition: CGeneralizedCylinder.h:54
CPolyhedron.h
first
GLint * first
Definition: glext.h:3827
mrpt::opengl::CGeneralizedCylinder::setAllSectionsVisible
void setAllSectionsVisible()
Sets all sections visible.
Definition: CGeneralizedCylinder.h:281
a
GLubyte GLubyte GLubyte a
Definition: glext.h:6279
mrpt::opengl::CGeneralizedCylinder::getMeshIterators
void getMeshIterators(const std::vector< TQuadrilateral > &m, std::vector< TQuadrilateral >::const_iterator &begin, std::vector< TQuadrilateral >::const_iterator &end) const
Given a vector of polyhedrons, gets the starting and ending iterators to the section to be actually r...
Definition: CGeneralizedCylinder.cpp:65



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST