Connected line segments through an ordered list of points. More...
#include <polylineobject.h>
Classes | |
| struct | GpuResources |
Public Member Functions | |
| PolylineObject () | |
| ~PolylineObject () | |
| void | setPoints (const QVector< Eigen::Vector3f > &vecPoints) |
| void | clear () |
| void | setRadius (float fRadius) |
| void | setGradient (const QColor &startColor, const QColor &endColor) |
| void | updateBuffers (QRhi *rhi, QRhiResourceUpdateBatch *u) |
| QRhiBuffer * | vertexBuffer () const |
| QRhiBuffer * | indexBuffer () const |
| QRhiBuffer * | instanceBuffer () const |
| int | indexCount () const |
| int | instanceCount () const |
| bool | isVisible () const |
| void | setVisible (bool bVisible) |
| bool | hasData () const |
Connected line segments through an ordered list of points.
Renders an ordered sequence of points as connected line segments.
Each segment is one instance of a unit cylinder, using the same instance layout as DipoleObject and NetworkObject so the existing Dipole pipeline can draw it without a dedicated shader.
Definition at line 79 of file polylineobject.h.
| DISP3DLIB::PolylineObject::PolylineObject | ( | ) |
Constructs a PolylineObject without any points.
Definition at line 45 of file polylineobject.cpp.
|
default |
Destroys the PolylineObject.
| void DISP3DLIB::PolylineObject::clear | ( | ) |
Clears all points.
Definition at line 80 of file polylineobject.cpp.
|
inline |
Definition at line 200 of file polylineobject.h.
| QRhiBuffer * DISP3DLIB::PolylineObject::indexBuffer | ( | ) | const |
Definition at line 273 of file polylineobject.cpp.
|
inline |
Definition at line 162 of file polylineobject.h.
| QRhiBuffer * DISP3DLIB::PolylineObject::instanceBuffer | ( | ) | const |
Definition at line 280 of file polylineobject.cpp.
|
inline |
Definition at line 171 of file polylineobject.h.
|
inline |
Definition at line 180 of file polylineobject.h.
| void DISP3DLIB::PolylineObject::setGradient | ( | const QColor & | startColor, |
| const QColor & | endColor ) |
Sets the colours the segments are graded between from start to end.
Grading the line makes the direction of travel readable without any extra decoration.
| [in] | startColor | Colour of the first segment. |
| [in] | endColor | Colour of the last segment. |
Definition at line 98 of file polylineobject.cpp.
| void DISP3DLIB::PolylineObject::setPoints | ( | const QVector< Eigen::Vector3f > & | vecPoints | ) |
Sets the points of the polyline.
Fewer than two points clears the object, since a single point has no segment to draw.
| [in] | vecPoints | Points in scene coordinates, in order. |
Definition at line 65 of file polylineobject.cpp.
| void DISP3DLIB::PolylineObject::setRadius | ( | float | fRadius | ) |
Sets the radius of the drawn segments.
| [in] | fRadius | Segment radius in scene units. |
Definition at line 90 of file polylineobject.cpp.
|
inline |
Sets whether the polyline is drawn.
| [in] | bVisible | True to draw the polyline. |
Definition at line 191 of file polylineobject.h.
| void DISP3DLIB::PolylineObject::updateBuffers | ( | QRhi * | rhi, |
| QRhiResourceUpdateBatch * | u ) |
Uploads or refreshes the GPU buffers.
| [in] | rhi | The RHI to allocate through. |
| [in] | u | Batch collecting the resource updates. |
Definition at line 228 of file polylineobject.cpp.
| QRhiBuffer * DISP3DLIB::PolylineObject::vertexBuffer | ( | ) | const |
Definition at line 266 of file polylineobject.cpp.