QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
qwt3d_bar.h
1#ifndef QWT3D_BAR_H
2#define QWT3D_BAR_H
3
4#include "qwt3d_plotitem.h"
5#include "qwt3d_types.h"
6#include "qwt3d_color.h"
7
8#include <QVector>
9#include <vector>
10
11#include "qwt_point_3d.h"
12
47class QWT3D_EXPORT Qwt3DBar : public Qwt3DPlotItem
48{
49 QWT_DECLARE_PRIVATE(Qwt3DBar)
50
51public:
54 {
57 Wireframe
58 };
59
61 Qwt3DBar();
63 ~Qwt3DBar() override;
64
65 // 1D series — bars placed freely on the xy-plane
66
68 void setSamples(const QVector<QwtPoint3D>& samples);
70 void setSamples(const QVector<double>& x, const QVector<double>& heights);
71
72 // 2D grid — 3D histogram (bar3 style)
73
75 void setSamples(double** z, int columns, int rows,
76 double minX, double maxX, double minY, double maxY);
78 void setSamples(const Qwt3DFunctionData& data);
79
80 // Bar footprint and baseline
81
83 double barWidth() const;
85 void setBarWidth(double w);
87 double barDepth() const;
89 void setBarDepth(double d);
91 double baseline() const;
93 void setBaseline(double z);
94
95 // Style and color
96
98 BarStyle barStyle() const;
100 void setBarStyle(BarStyle style);
102 void setDataColor(Qwt3DColor* color);
104 const Qwt3DColor* dataColor() const;
106 void invalidateColors();
108 RGBA meshColor() const;
110 void setMeshColor(RGBA color);
112 double meshLineWidth() const;
114 void setMeshLineWidth(double width);
115
116 // Qwt3DPlotItem interface
117
118 int rtti() const override;
119 void draw() override;
120 ParallelEpiped hull() const override;
121 void populateLegendColors(ColorVector& colors) const override;
122
123 // Data accessors for serialization support
125 QVector<QwtPoint3D> samples() const;
127 bool isGridData() const;
129 int gridColumns() const;
131 int gridRows() const;
133 double gridMinX() const;
135 double gridMaxX() const;
137 double gridMinY() const;
139 double gridMaxY() const;
141 std::vector<std::vector<double>> gridZValues() const;
142
143private:
144 void buildVBO();
146 void recomputeBarSpecs();
148 void pushColorRange() const;
149};
150
151#endif // QWT3D_BAR_H
Definition qwt_clipper.h:41
3D bar chart item with VBO/VAO rendering
Definition qwt3d_bar.h:48
~Qwt3DBar() override
Destructor — releases GL resources and data.
BarStyle
Bar rendering style.
Definition qwt3d_bar.h:54
@ Filled
Filled bars, no edges.
Definition qwt3d_bar.h:55
@ FilledMesh
Filled bars with separately colored edge lines.
Definition qwt3d_bar.h:56
void setSamples(const QVector< QwtPoint3D > &samples)
Set bar positions and heights from 3D points (x,y = footprint center, z = height)
Abstract base class for color functors.
Definition qwt3d_color.h:25
Base class for all 3D plot items.
Definition qwt3d_plotitem.h:55
virtual ParallelEpiped hull() const =0
Get the bounding hull of the item in 3D space.
virtual int rtti() const
Runtime type information.
Definition qwt3d_plotitem.cpp:192
virtual void draw()=0
Draw the item using the current GL context.
virtual void populateLegendColors(ColorVector &colors) const
Populate the legend color vector from the item's color functor.
Definition qwt3d_plotitem.cpp:181
Parallelepiped spanned by 2 Triples.
Definition qwt3d_types.h:334
Result of evaluating a Qwt3DFunction over its grid.
Definition qwt3d_types.h:543
Red-Green-Blue-Alpha value.
Definition qwt3d_types.h:395