QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
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
11class Qwt3DGridData;
12class Qwt3DCellData;
13
36class QWT3D_EXPORT Qwt3DSurface : public Qwt3DPlotItem
37{
38 QWT_DECLARE_PRIVATE(Qwt3DSurface)
39
40public:
44 ~Qwt3DSurface() override;
45
46 // Data loading — grid data
47
49 void loadFromData(Triple** data, unsigned int columns, unsigned int rows,
50 bool uperiodic = false, bool vperiodic = false);
52 void loadFromData(double** data, unsigned int columns, unsigned int rows,
53 double minx, double maxx, double miny, double maxy);
55 void loadFromData(const Qwt3DFunctionData& data);
57 void loadFromData(const Qwt3DParametricData& data);
58
59 // Data loading — cell data
60
62 void loadFromData(TripleField const& nodes, CellField const& poly);
63
64 // Resolution
65
67 int resolution() const;
68
69 // Floor style
70
72 FLOORSTYLE floorStyle() const;
74 void setFloorStyle(FLOORSTYLE style);
75
76 // Normals
77
79 bool normals() const;
81 void showNormals(bool b);
83 double normalLength() const;
85 void setNormalLength(double val);
87 int normalQuality() const;
89 void setNormalQuality(int val);
90
92 std::pair<int, int> facets() const;
93
95 void updateNormals();
96
97 // Style (moved from Plot3D)
98
100 PLOTSTYLE plotStyle() const;
102 void setPlotStyle(PLOTSTYLE style);
104 void setDataColor(Qwt3DColor* color);
106 const Qwt3DColor* dataColor() const;
108 void invalidateColors();
110 RGBA meshColor() const;
112 void setMeshColor(RGBA color);
114 double meshLineWidth() const;
116 void setMeshLineWidth(double width);
118 int isolines() const;
120 void setIsolines(int n);
122 bool smoothMesh() const;
124 void setSmoothMesh(bool smooth);
126 double polygonOffset() const;
128 void setPolygonOffset(double offset);
129
130 // Shading
132 SHADINGSTYLE shading() const;
134 void setShading(SHADINGSTYLE style);
135
136 // Enrichments (moved from Plot3D)
137
139 Qwt3DEnrichment* addEnrichment(Qwt3DEnrichment const& enrichment);
141 bool degrade(Qwt3DEnrichment* enrichment);
142
143 // Qwt3DPlotItem interface
144
145 int rtti() const override;
146 void draw() override;
147 ParallelEpiped hull() const override;
148 void populateLegendColors(ColorVector& colors) const override;
149
150 // Data accessors (public for serialization support)
152 Qwt3DGridData* gridData() const;
154 Qwt3DCellData* cellData() const;
156 bool isGridData() const;
158 void setResolution(int res);
159
160private:
161 void buildVBO();
163 void pushColorRange() const;
164};
165
166#endif // QWT3D_SURFACE_H
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:37
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
Triple [x,y,z]
Definition qwt3d_types.h:201