v2.0.0
Loading...
Searching...
No Matches
DISP3DLIB::PolylineObject Class Reference

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

Detailed Description

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.

Constructor & Destructor Documentation

◆ PolylineObject()

DISP3DLIB::PolylineObject::PolylineObject ( )

Constructs a PolylineObject without any points.

Definition at line 45 of file polylineobject.cpp.

◆ ~PolylineObject()

DISP3DLIB::PolylineObject::~PolylineObject ( )
default

Destroys the PolylineObject.

Member Function Documentation

◆ clear()

void DISP3DLIB::PolylineObject::clear ( )

Clears all points.

Definition at line 80 of file polylineobject.cpp.

◆ hasData()

bool DISP3DLIB::PolylineObject::hasData ( ) const
inline
Returns
Whether there is at least one segment to draw.

Definition at line 200 of file polylineobject.h.

◆ indexBuffer()

QRhiBuffer * DISP3DLIB::PolylineObject::indexBuffer ( ) const
Returns
Index buffer of the unit segment mesh.

Definition at line 273 of file polylineobject.cpp.

◆ indexCount()

int DISP3DLIB::PolylineObject::indexCount ( ) const
inline
Returns
Number of indices in the unit segment mesh.

Definition at line 162 of file polylineobject.h.

◆ instanceBuffer()

QRhiBuffer * DISP3DLIB::PolylineObject::instanceBuffer ( ) const
Returns
Per-segment instance buffer.

Definition at line 280 of file polylineobject.cpp.

◆ instanceCount()

int DISP3DLIB::PolylineObject::instanceCount ( ) const
inline
Returns
Number of segment instances, one less than the number of points.

Definition at line 171 of file polylineobject.h.

◆ isVisible()

bool DISP3DLIB::PolylineObject::isVisible ( ) const
inline
Returns
Whether the polyline is drawn.

Definition at line 180 of file polylineobject.h.

◆ setGradient()

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.

Parameters
[in]startColorColour of the first segment.
[in]endColorColour of the last segment.

Definition at line 98 of file polylineobject.cpp.

◆ setPoints()

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.

Parameters
[in]vecPointsPoints in scene coordinates, in order.

Definition at line 65 of file polylineobject.cpp.

◆ setRadius()

void DISP3DLIB::PolylineObject::setRadius ( float fRadius)

Sets the radius of the drawn segments.

Parameters
[in]fRadiusSegment radius in scene units.

Definition at line 90 of file polylineobject.cpp.

◆ setVisible()

void DISP3DLIB::PolylineObject::setVisible ( bool bVisible)
inline

Sets whether the polyline is drawn.

Parameters
[in]bVisibleTrue to draw the polyline.

Definition at line 191 of file polylineobject.h.

◆ updateBuffers()

void DISP3DLIB::PolylineObject::updateBuffers ( QRhi * rhi,
QRhiResourceUpdateBatch * u )

Uploads or refreshes the GPU buffers.

Parameters
[in]rhiThe RHI to allocate through.
[in]uBatch collecting the resource updates.

Definition at line 228 of file polylineobject.cpp.

◆ vertexBuffer()

QRhiBuffer * DISP3DLIB::PolylineObject::vertexBuffer ( ) const
Returns
Vertex buffer of the unit segment mesh.

Definition at line 266 of file polylineobject.cpp.


The documentation for this class was generated from the following files: