Class QAccelPlot::BarMaterial¶
ClassList > QAccelPlot > BarMaterial
QSGMaterial for bar series rendering, extending RectMaterial with the bar geometry and colormap uniforms.More...
#include <BarMaterial.hpp>
Inherits the following classes: QAccelPlot::RectMaterial
Inheritance diagram¶
flowchart TB
classQAccelPlot_1_1BarMaterial["QAccelPlot::BarMaterial"]
classQAccelPlot_1_1RectMaterial["QAccelPlot::RectMaterial"]
classQAccelPlot_1_1RectMaterial --> classQAccelPlot_1_1BarMaterial
click classQAccelPlot_1_1RectMaterial "../classQAccelPlot_1_1RectMaterial/" "Open QAccelPlot::RectMaterial"
classQAccelPlot_1_1DataTextureMaterial["QAccelPlot::DataTextureMaterial"]
classQAccelPlot_1_1DataTextureMaterial --> classQAccelPlot_1_1RectMaterial
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 | barOffset = {0.0f}Shift of every bar along the position axis in data units. |
| float | barWidth = {0.8f}Bar width in position-axis data units. |
| float | baseline = {0.0f}Value the bars start from, relative to the value-axis render origin. |
| GradientTexture | colorMap Colormap lookup texture sampled at binding 2. |
| float | colorSource = {0.0f}What colorMap maps: 0 nothing (the rectangle colors apply), 1 the value, 2 the position. |
| float | horizontal = {0.0f}1.0 when positions lie on the Y axis (float for std140 UBO compatibility). |
| float | ranged = {0.0f}1.0 when each bar holds its own extent along the position axis. |
| float | valueLogScale = {0.0f}1.0 to place values on the colormap in log10. |
| float | valueMax = {1.0f}Value at colormap position 1, shifted like valueMin . |
| float | valueMin = {0.0f}Value at colormap position 0, shifted like the data unless valueLogScale is set. |
| float | valueOrigin = {0.0f}Added to the mapped data before a log normalization, which needs the absolute value. |
Public Attributes inherited from QAccelPlot::RectMaterial¶
| Type | Name |
|---|---|
| float | antialiasing = {0.0f}1.0 to smooth the rectangle and outline edges. |
| QColor | borderColor = {Qt::black}Outline color. |
| float | borderWidth = {0.0f}Outline width in pixels, drawn inside each rectangle. |
| QColor | hoverColor = {Qt::transparent}Fill color of the highlighted rectangle. |
| float | hoveredIndex = {-1.0f}Index of the highlighted rectangle, or -1 for none. |
| QVector2D | minimumSize = {0.0f, 0.0f}Minimum drawn rectangle width and height in pixels. |
| float | rectCount = {0.0f}Number of rectangles in the data texture (used to index the sampler). |
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 Functions¶
| Type | Name |
|---|---|
| BarMaterial () Constructs a BarMaterial with default uniform values. |
|
| QSGMaterialShader * | createShader (QSGRendererInterface::RenderMode) override const Creates and returns the bar shader program. |
| QSGMaterialType * | type () override const Returns the unique material type identifier for this class. |
Public Functions inherited from QAccelPlot::RectMaterial¶
| Type | Name |
|---|---|
| RectMaterial () Constructs a RectMaterial with default uniform values. |
|
| QSGMaterialShader * | createShader (QSGRendererInterface::RenderMode) override const Creates and returns the rectangle 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 into dataTexture , creating it when it isnullptr . |
| ~DataTextureMaterial () override |
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 from updateSampledImage ). 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 bar-specific uniforms and the colormap texture after the rectangle uniforms compare equal. |
Protected Functions inherited from QAccelPlot::RectMaterial¶
| Type | Name |
|---|---|
| virtual int | compareExtra (const QSGMaterial * other) override const Compares the rectangle-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¶
The data texture holds (position, value) pairs, or (from, to, value) triples when ranged is set; the shader turns each into a rectangle. When colorSource is set, the vertex shader colors each bar from colorMap.
Public Attributes Documentation¶
variable barOffset¶
Shift of every bar along the position axis in data units.
variable barWidth¶
Bar width in position-axis data units.
variable baseline¶
Value the bars start from, relative to the value-axis render origin.
variable colorMap¶
Colormap lookup texture sampled at binding 2.
variable colorSource¶
What colorMap maps: 0 nothing (the rectangle colors apply), 1 the value, 2 the position.
variable horizontal¶
1.0 when positions lie on the Y axis (float for std140 UBO compatibility).
variable ranged¶
1.0 when each bar holds its own extent along the position axis.
variable valueLogScale¶
1.0 to place values on the colormap in log10.
variable valueMax¶
Value at colormap position 1, shifted like valueMin .
variable valueMin¶
Value at colormap position 0, shifted like the data unless valueLogScale is set.
variable valueOrigin¶
Added to the mapped data before a log normalization, which needs the absolute value.
Public Functions Documentation¶
function BarMaterial¶
Constructs a BarMaterial with default uniform values.
function createShader¶
Creates and returns the bar shader program.
QSGMaterialShader * QAccelPlot::BarMaterial::createShader (
QSGRendererInterface::RenderMode
) override const
function type¶
Returns the unique material type identifier for this class.
Protected Functions Documentation¶
function compareExtra¶
Compares the bar-specific uniforms and the colormap texture after the rectangle uniforms compare equal.
Implements QAccelPlot::DataTextureMaterial::compareExtra
The documentation for this class was generated from the following file QAccelPlot/src/QAccelPlot/materials/BarMaterial.hpp