QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
qwt3d_surface.h
1#ifndef QWT3D_SURFACE_H
2#define QWT3D_SURFACE_H
3
4#include "qwt3d_plotitem.h"
5#include "qwt3d_types.h"
6#include "qwt3d_color.h"
7#include "qwt3d_enrichment.h"
8
9#include <list>
10
11struct SurfaceVertex;
12
13class Qwt3DGridData;
14class Qwt3DCellData;
15
38class QWT3D_EXPORT Qwt3DSurface : public Qwt3DPlotItem
39{
40 QWT_DECLARE_PRIVATE(Qwt3DSurface)
41
42public:
46 ~Qwt3DSurface() override;
47
48 // Data loading — grid data
49
51 void loadFromData(Triple** data, unsigned int columns, unsigned int rows,
52 bool uperiodic = false, bool vperiodic = false);
54 void loadFromData(double** data, unsigned int columns, unsigned int rows,
55 double minx, double maxx, double miny, double maxy);
57 void loadFromData(const Qwt3DFunctionData& data);
59 void loadFromData(const Qwt3DParametricData& data);
60
61 // Data loading — cell data
62
64 void loadFromData(TripleField const& nodes, CellField const& poly);
65
66 // Resolution
67
69 int resolution() const;
70
71 // Floor style
72
74 FLOORSTYLE floorStyle() const;
76 void setFloorStyle(FLOORSTYLE style);
77
78 // Normals
79
81 bool normals() const;
83 void showNormals(bool b);
85 double normalLength() const;
87 void setNormalLength(double val);
89 int normalQuality() const;
91 void setNormalQuality(int val);
92
94 std::pair<int, int> facets() const;
95
97 void updateNormals();
98
99 // Style (moved from Plot3D)
100
102 PLOTSTYLE plotStyle() const;
104 void setPlotStyle(PLOTSTYLE style);
106 void setDataColor(Qwt3DColor* color);
108 const Qwt3DColor* dataColor() const;
110 void invalidateColors();
112 RGBA meshColor() const;
114 void setMeshColor(RGBA color);
116 double meshLineWidth() const;
118 void setMeshLineWidth(double width);
120 int isolines() const;
122 void setIsolines(int n);
124 bool smoothMesh() const;
126 void setSmoothMesh(bool smooth);
128 double polygonOffset() const;
130 void setPolygonOffset(double offset);
131
132 // Shading
134 SHADINGSTYLE shading() const;
136 void setShading(SHADINGSTYLE style);
137
138 // Enrichments (moved from Plot3D)
139
141 Qwt3DEnrichment* addEnrichment(Qwt3DEnrichment const& enrichment);
143 bool degrade(Qwt3DEnrichment* enrichment);
144
145 // Qwt3DPlotItem interface
146
147 int rtti() const override;
148 void draw() override;
149 ParallelEpiped hull() const override;
150 void populateLegendColors(ColorVector& colors) const override;
151
152 // Data accessors (public for serialization support)
154 Qwt3DGridData* gridData() const;
156 Qwt3DCellData* cellData() const;
158 bool isGridData() const;
160 void setResolution(int res);
161
162private:
164 bool buildGeometry(QVector< SurfaceVertex >& vertices,
165 QVector< unsigned int >& triIndices,
166 QVector< unsigned int >& lineIndices);
167
169 void drawForVectorExport();
170
171 void buildVBO();
173 void pushColorRange() const;
174};
175
176#endif // QWT3D_SURFACE_H
Definition qwt_clipper.h:41
Implements a graph-like cell structure with limit access functions.
Definition qwt3d_types.h:481
Abstract base class for color functors.
Definition qwt3d_color.h:25
Abstract base class for data dependent visible user objects.
Definition qwt3d_enrichment.h:15
Implements a matrix of z-Values with limit access functions.
Definition qwt3d_types.h:448
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
3D surface plot item with VBO/VAO rendering
Definition qwt3d_surface.h:39
void loadFromData(Triple **data, unsigned int columns, unsigned int rows, bool uperiodic=false, bool vperiodic=false)
Load grid data from Triple array (x, y, z per vertex)
~Qwt3DSurface() override
Destructor — releases GL resources and data.
Parallelepiped spanned by 2 Triples.
Definition qwt3d_types.h:334
Result of evaluating a Qwt3DFunction over its grid.
Definition qwt3d_types.h:543
Result of evaluating a Qwt3DParametricSurface over its grid.
Definition qwt3d_types.h:560
Red-Green-Blue-Alpha value.
Definition qwt3d_types.h:395
Vertex structure for VBO upload.
Definition qwt3d_surface_p.h:24
Triple [x,y,z].
Definition qwt3d_types.h:201