Skip to content

Class QAccelPlot::ErrorBarMaterial

ClassList > QAccelPlot > ErrorBarMaterial

Material that draws error bars from (x, y, low, high) data points in a data texture. More...

  • #include <ErrorBarMaterial.hpp>

Inherits the following classes: QAccelPlot::DataTextureMaterial

Inheritance diagram

flowchart TB
  classQAccelPlot_1_1ErrorBarMaterial["QAccelPlot::ErrorBarMaterial"]

  classQAccelPlot_1_1DataTextureMaterial["QAccelPlot::DataTextureMaterial"]
  classQAccelPlot_1_1DataTextureMaterial --> classQAccelPlot_1_1ErrorBarMaterial
  click classQAccelPlot_1_1DataTextureMaterial "../classQAccelPlot_1_1DataTextureMaterial/" "Open QAccelPlot::DataTextureMaterial"

  external_base_classQAccelPlot_1_1DataTextureMaterial_1["QSGMaterial"]
  external_base_classQAccelPlot_1_1DataTextureMaterial_1 --> classQAccelPlot_1_1DataTextureMaterial

Public Attributes

Type Name
float antialiasing = {1.0f}
1.0 to smooth the edges of the lines and caps.
float capLength = {8.0f}
Length of the caps in pixels; 0 draws none.
float errorBarCount = {0.0f}
Number of error bars drawn; vertices beyond them are culled.
float horizontal = {0.0f}
1.0 when the bounds lie on the X axis (float for std140 UBO compatibility).
QColor hoverColor = {Qt::transparent}
Color of the highlighted error bar.
float hoveredIndex = {-1.0f}
Index of the highlighted error bar, or -1 for none.
float lineWidth = {1.5f}
Width of the lines and caps in pixels.
float offset = {0.0f}
Shift of every error bar across its bounds, in data units.

Public Attributes inherited from QAccelPlot::DataTextureMaterial

See QAccelPlot::DataTextureMaterial

Type Name
QColor color = {Qt::blue}
Line/fill color uniform.
std::shared_ptr< DataTexture > dataTexture
Data texture sampled by the shader. Materials drawing the same samples may share one.
QVector2D domainMax = {1.0f, 1.0f}
Maximum data-space coordinate.
QVector2D domainMin = {0.0f, 0.0f}
Minimum data-space coordinate.
float logScaleX = {0.0f}
1.0 when the X axis uses log scale (float for std140 UBO compatibility).
float logScaleY = {0.0f}
1.0 when the Y axis uses log scale (float for std140 UBO compatibility).
float useVertexColor = {0.0f}
1.0 when per-vertex color overrides color (float for std140 UBO compatibility).
QVector2D viewportSize = {800.0f, 600.0f}
Viewport size in pixels.

Public Static Attributes

Type Name
constexpr int kVerticesPerErrorBar = {18}
Vertices per error bar: a quad of two triangles for the line and for each cap.

Public Functions

Type Name
ErrorBarMaterial ()
Constructs an ErrorBarMaterial with default uniform values.
QSGMaterialShader * createShader (QSGRendererInterface::RenderMode) override const
Creates and returns the error bar shader program.
QSGMaterialType * type () override const
Returns the unique material type identifier for this class.

Public Functions inherited from QAccelPlot::DataTextureMaterial

See QAccelPlot::DataTextureMaterial

Type Name
DataTextureMaterial ()
Constructs an empty DataTextureMaterial .
int compare (const QSGMaterial * other) override const
Compares shared uniform fields; delegates type-specific fields to compareExtra() .
QSGTexture * sampledTexture () const
Returns the texture the shader samples, or nullptr beforedataTexture holds an upload.
void uploadTexture (QQuickWindow * window, const float * data, int floatCount)
Uploads floatCount raw floats from__data intodataTexture , creating it when it isnullptr .
~DataTextureMaterial () override

Public Static Functions

Type Name
const QSGGeometry::AttributeSet & attributeSet ()
Returns the vertex attribute set: a 4-byte placeholder the shader ignores.

Public Static Functions inherited from QAccelPlot::DataTextureMaterial

See QAccelPlot::DataTextureMaterial

Type Name
const QSGGeometry::AttributeSet & attributeSet ()
Returns the shared vertex attribute set: {float id, float param, uchar4 color} (12 bytes).
void commitTexture (QSGMaterialShader::RenderState & state, int binding, QSGTexture ** texture, const DataTexture * data)
Commits the texture of data to sampler__binding (call fromupdateSampledImage ). Does nothing before an upload.
const QSGGeometry::AttributeSet & vertexIndexAttributeSet ()
Returns the attribute set of marker quads: one ignored uchar4 placeholder (4 bytes).
bool writeCommonUniforms (char * buf, int bufSize, const QMatrix4x4 & matrix, const DataTextureMaterial * mat)
Writes the shared UBO prefix (transform + color + domain + flags) into buf .

Protected Functions

Type Name
virtual int compareExtra (const QSGMaterial * other) override const
Compares the error-bar-specific uniforms after the base-class comparison succeeds.

Protected Functions inherited from QAccelPlot::DataTextureMaterial

See QAccelPlot::DataTextureMaterial

Type Name
virtual int compareExtra (const QSGMaterial * other) const
Subclass hook for compare() — called after the shared fields compare equal.

Detailed Description

Each error bar takes kVerticesPerErrorBar vertices: two triangles each for the line and the two caps. The shader derives the error bar, part, and corner from the vertex index.

Public Attributes Documentation

variable antialiasing

1.0 to smooth the edges of the lines and caps.

float QAccelPlot::ErrorBarMaterial::antialiasing;


variable capLength

Length of the caps in pixels; 0 draws none.

float QAccelPlot::ErrorBarMaterial::capLength;


variable errorBarCount

Number of error bars drawn; vertices beyond them are culled.

float QAccelPlot::ErrorBarMaterial::errorBarCount;


variable horizontal

1.0 when the bounds lie on the X axis (float for std140 UBO compatibility).

float QAccelPlot::ErrorBarMaterial::horizontal;


variable hoverColor

Color of the highlighted error bar.

QColor QAccelPlot::ErrorBarMaterial::hoverColor;


variable hoveredIndex

Index of the highlighted error bar, or -1 for none.

float QAccelPlot::ErrorBarMaterial::hoveredIndex;


variable lineWidth

Width of the lines and caps in pixels.

float QAccelPlot::ErrorBarMaterial::lineWidth;


variable offset

Shift of every error bar across its bounds, in data units.

float QAccelPlot::ErrorBarMaterial::offset;


Public Static Attributes Documentation

variable kVerticesPerErrorBar

Vertices per error bar: a quad of two triangles for the line and for each cap.

constexpr int QAccelPlot::ErrorBarMaterial::kVerticesPerErrorBar;


Public Functions Documentation

function ErrorBarMaterial

Constructs an ErrorBarMaterial with default uniform values.

QAccelPlot::ErrorBarMaterial::ErrorBarMaterial () 


function createShader

Creates and returns the error bar shader program.

QSGMaterialShader * QAccelPlot::ErrorBarMaterial::createShader (
    QSGRendererInterface::RenderMode
) override const


function type

Returns the unique material type identifier for this class.

QSGMaterialType * QAccelPlot::ErrorBarMaterial::type () override const


Public Static Functions Documentation

function attributeSet

Returns the vertex attribute set: a 4-byte placeholder the shader ignores.

static const QSGGeometry::AttributeSet & QAccelPlot::ErrorBarMaterial::attributeSet () 


Protected Functions Documentation

function compareExtra

Compares the error-bar-specific uniforms after the base-class comparison succeeds.

virtual int QAccelPlot::ErrorBarMaterial::compareExtra (
    const QSGMaterial * other
) override const

Implements QAccelPlot::DataTextureMaterial::compareExtra



The documentation for this class was generated from the following file QAccelPlot/src/QAccelPlot/materials/ErrorBarMaterial.hpp