Class CSetOfLines

Inheritance Relationships

Base Types

Class Documentation

class CSetOfLines : public virtual mrpt::viz::CVisualObject, public mrpt::viz::VisualObjectParams_Points, public mrpt::viz::VisualObjectParams_Lines

A set of independent lines (or segments), one line with its own start and end positions (X,Y,Z). Optionally, the vertices can be also shown as dots.

../../output_staging/generated/doxygen/xml/preview_CSetOfLines.png

See also

opengl::Scene

Public Types

using iterator = std::vector<mrpt::math::TSegment3D>::iterator
using reverse_iterator = std::vector<mrpt::math::TSegment3D>::reverse_iterator
using const_iterator = std::vector<mrpt::math::TSegment3D>::const_iterator
using const_reverse_iterator = std::vector<mrpt::math::TSegment3D>::const_reverse_iterator

Public Functions

inline void clear()

Clear the list of segments

inline float getVerticesPointSize() const
inline void setVerticesPointSize(const float size_points)

Enable showing vertices as dots if size_points>0

inline void appendLine(const mrpt::math::TSegment3D &sgm)

Appends a line to the set.

inline void appendLine(double x0, double y0, double z0, double x1, double y1, double z1)

Appends a line to the set, given the coordinates of its bounds.

inline 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_STRIP)

Throws:

std::exception – If there is no previous segment

template<class U>
inline void appendLineStrip(const U &point)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<class T>
inline void appendLines(const T &sgms)

Appends any iterable collection of lines to the set. Note that this includes another CSetOfLines.

See also

appendLine

template<class T_it>
inline void appendLines(const T_it &begin, const T_it &end)

Appends certain amount of lines, located between two iterators, into the set.

See also

appendLine

inline void resize(size_t nLines)

Resizes the set.

See also

reserve

inline void reserve(size_t r)

Reserves an amount of lines to the set. This method should be used when some known amount of lines is going to be inserted, so that only a memory allocation is needed.

See also

resize

template<class T, class U>
inline void appendLine(T p0, U p1)

Inserts a line, given its bounds. Works with any pair of objects with access to x, y and z members.

inline size_t size() const

Returns the total count of lines in this set.

inline bool empty() const

Returns true if there are no line segments.

void setLineByIndex(size_t index, const mrpt::math::TSegment3D &segm)

Sets a specific line in the set, given its index.

See also

appendLine

inline 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.

See also

appendLine

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.

See also

getLineByIndex

inline const_iterator begin() const

Beginning const iterator.

See also

end,rbegin,rend

inline iterator begin()
inline const_iterator end() const

Ending const iterator.

See also

begin,rend,rbegin

inline iterator end()
inline const_reverse_iterator rbegin() const

Beginning const reverse iterator (actually, accesses the end of the set).

See also

rend,begin,end

inline const_reverse_iterator rend() const

Ending const reverse iterator (actually, refers to the starting point of the set).

See also

rbegin,end,begin

virtual mrpt::math::TBoundingBoxf internalBoundingBoxLocal() const override

Evaluates the bounding box of this object (including possible children) in the coordinate frame of the object parent.

CSetOfLines()

Constructor

CSetOfLines(const std::vector<mrpt::math::TSegment3D> &sgms, bool antiAliasing = true)

Constructor with a initial set of lines.

~CSetOfLines() override = default

Private, virtual destructor: only can be deleted from smart pointers.

Protected Attributes

std::vector<mrpt::math::TSegment3D> m_Segments