Go to the documentation of this file.
10 #ifndef opengl_CSetOfLines_H
11 #define opengl_CSetOfLines_H
66 mSegments.push_back(sgm);
72 inline void appendLine(
float x0,
float y0,
float z0,
float x1,
float y1,
float z1) {
87 this->appendLine(this->rbegin()->point2,point);
95 mSegments.insert(mSegments.end(),sgms.begin(),sgms.end());
103 mSegments.reserve(mSegments.size()+(
end-
begin));
104 mSegments.insert(mSegments.end(),
begin,
end);
112 mSegments.resize(nLines);
120 mSegments.reserve(r);
126 template<
class T,
class U>
inline void appendLine(T p0,U p1) {
127 appendLine(p0.x,p0.y,p0.z,p1.x,p1.y,p1.z);
133 inline size_t size()
const {
return mSegments.size(); }
135 inline bool empty()
const {
return mSegments.empty(); }
145 inline void setLineByIndex(
size_t index,
double x0,
double y0,
double z0,
double x1,
double y1,
double z1) {
153 void getLineByIndex(
size_t index,
double &x0,
double &y0,
double &z0,
double &x1,
double &y1,
double &z1)
const;
156 static CSetOfLinesPtr
Create(
const std::vector<mrpt::math::TSegment3D> &sgms,
const bool antiAliasing =
true);
178 return mSegments.begin();
186 return mSegments.end();
194 return mSegments.rbegin();
201 return mSegments.rend();
214 CSetOfLines(
const std::vector<mrpt::math::TSegment3D> &sgms,
bool antiAliasing=
true);
222 template<class T> inline CSetOfLinesPtr &operator<<(CSetOfLinesPtr &l,const T &s) {
223 l->appendLines(s.begin(),s.end());
void setLineByIndex(size_t index, const mrpt::math::TSegment3D &segm)
Sets a specific line in the set, given its index.
void clear()
Clear the list of segments.
CSetOfLines()
Constructor.
EIGEN_STRONG_INLINE iterator begin()
bool empty() const
Returns true if there are no line segments.
void enableAntiAliasing(bool enable=true)
A set of independent lines (or segments), one line with its own start and end positions (X,...
std::vector< mrpt::math::TSegment3D >::const_reverse_iterator const_reverse_iterator
Const reverse iterator to the set.
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)
void getLineByIndex(size_t index, double &x0, double &y0, double &z0, double &x1, double &y1, double &z1) const
Gets a specific line in the set, given its index.
EIGEN_STRONG_INLINE iterator end()
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::vector< mrpt::math::TSegment3D >::const_iterator const_iterator
Const iterator to the set.
void reserve(size_t r)
Reserves an amount of lines to the set.
size_t getLineCount() const
Returns the total count of lines in this set.
void appendLine(const mrpt::math::TSegment3D &sgm)
Appends a line to the set.
void appendLineStrip(float x, float y, float z)
Appends a line whose starting point is the end point of the last line (similar to OpenGL's GL_LINE_ST...
size_t size() const
Returns the total count of lines in this set.
void appendLine(T p0, U p1)
Inserts a line, given its bounds.
void setLineByIndex(size_t index, double x0, double y0, double z0, double x1, double y1, double z1)
Sets a specific line in the set, given its index.
std::vector< mrpt::math::TSegment3D > mSegments
void resize(size_t nLines)
Resizes the set.
#define DEFINE_SERIALIZABLE_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
CSetOfLines(const std::vector< mrpt::math::TSegment3D > &sgms, bool antiAliasing=true)
Constructor with a initial set of lines.
const_reverse_iterator rend() const
Ending const reverse iterator (actually, refers to the starting point of the set).
static CSetOfLinesPtr Create(const std::vector< mrpt::math::TSegment3D > &sgms, const bool antiAliasing=true)
Class factory.
3D segment, consisting of two points.
void setLineWidth(float w)
Sets the width with which lines will be drawn.
void render_dl() const MRPT_OVERRIDE
Render.
struct BASE_IMPEXP TSegment3D
bool isAntiAliasingEnabled() const
const_reverse_iterator rbegin() const
Beginning const reverse iterator (actually, accesses the end of the set).
OPENGL_IMPEXP mrpt::utils::CStream & operator<<(mrpt::utils::CStream &out, const mrpt::opengl::CLight &o)
#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...
void appendLine(float x0, float y0, float z0, float x1, float y1, float z1)
Appends a line to the set, given the coordinates of its bounds.
void appendLineStrip(const U &point)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void appendLines(const T &sgms)
Appends any iterable collection of lines to the set.
void getBoundingBox(mrpt::math::TPoint3D &bb_min, mrpt::math::TPoint3D &bb_max) const MRPT_OVERRIDE
Evaluates the bounding box of this object (including possible children) in the coordinate frame of th...
#define DEFINE_SERIALIZABLE(class_name)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
void appendLines(const T_it &begin, const T_it &end)
Appends certain amount of lines, located between two iterators, into the set.
float getLineWidth() const
Gets the width with which lines are drawn.
EIGEN_STRONG_INLINE bool empty() const
const_iterator end() const
Ending const iterator.
std::vector< mrpt::math::TSegment3D >::reverse_iterator reverse_iterator
Iterator to the set.
virtual ~CSetOfLines()
Private, virtual destructor: only can be deleted from smart pointers.
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
std::vector< mrpt::math::TSegment3D >::iterator iterator
Iterator to the set.
Page generated by Doxygen 1.8.20 for MRPT 1.4.0 SVN: at Thu Aug 27 02:40:23 UTC 2020 | | |