QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt3d_surfaceplot.h
1#ifndef QWT3D_SURFACEPLOT_H
2#define QWT3D_SURFACEPLOT_H
3
4#include "qwt3d_plot.h"
5
6namespace Qwt3D
7{
8
15class QWT3D_EXPORT SurfacePlot : public Plot3D
16{
17 Q_OBJECT
18
19public:
20 SurfacePlot(QWidget* parent = nullptr);
21 ~SurfacePlot() override;
22 // Recalculates surface normals
23 void updateNormals();
24 // Returns data resolution (1 means all data)
25 int resolution() const;
26 // Returns the number of mesh cells for the ORIGINAL data
27 std::pair< int, int > facets() const;
28 bool loadFromData(Qwt3D::Triple** data, unsigned int columns, unsigned int rows, bool uperiodic = false, bool vperiodic = false);
29 bool loadFromData(double** data, unsigned int columns, unsigned int rows, double minx, double maxx, double miny, double maxy);
30 bool loadFromData(Qwt3D::TripleField const& data, Qwt3D::CellField const& poly);
31
32 // Deprecated - Use loadFromData instead
33 bool createDataRepresentation(Qwt3D::Triple** data,
34 unsigned int columns,
35 unsigned int rows,
36 bool uperiodic = false,
37 bool vperiodic = false)
38 {
39 return loadFromData(data, columns, rows, uperiodic, vperiodic);
40 }
41 // Deprecated - Use loadFromData instead
42 bool createDataRepresentation(double** data,
43 unsigned int columns,
44 unsigned int rows,
45 double minx,
46 double maxx,
47 double miny,
48 double maxy)
49 {
50 return loadFromData(data, columns, rows, minx, maxx, miny, maxy);
51 }
52 // Deprecated - Use loadFromData instead
53 bool createDataRepresentation(Qwt3D::TripleField const& data, Qwt3D::CellField const& poly)
54 {
55 return loadFromData(data, poly);
56 }
57
58 // Return floor style
59 Qwt3D::FLOORSTYLE floorStyle() const;
60 // Sets floor style
61 void setFloorStyle(Qwt3D::FLOORSTYLE val);
62 // Draw normals to every vertex
63 void showNormals(bool);
64 // Returns true, if normal drawing is on
65 bool normals() const;
66
67 // Sets length of normals in percent per hull diagonale
68 void setNormalLength(double val);
69 // Returns relative length of normals
70 double normalLength() const;
71 // Increases plotting quality of normal arrows
72 void setNormalQuality(int val);
73 // Returns plotting quality of normal arrows
74 int normalQuality() const;
75
76Q_SIGNALS:
83
84public Q_SLOTS:
85 void setResolution(int);
86
87protected:
88 QWT_DECLARE_PRIVATE(SurfacePlot)
89
90 void calculateHull() override;
91 void createData() override;
92 void createEnrichment(Qwt3D::Enrichment& p) override;
93 virtual void createFloorData();
94 void createNormals();
95 void createPoints();
96
97 void readIn(Qwt3D::GridData& gdata, Triple** data, unsigned int columns, unsigned int rows);
98 void readIn(Qwt3D::GridData& gdata,
99 double** data,
100 unsigned int columns,
101 unsigned int rows,
102 double minx,
103 double maxx,
104 double miny,
105 double maxy);
106 void calcNormals(GridData& gdata);
107 void sewPeriodic(GridData& gdata);
108
109private:
110 void Data2Floor();
111 void Isolines2Floor();
112
113 virtual void createDataG();
114 virtual void createFloorDataG();
115 void createNormalsG();
116 void Data2FloorG();
117 void Isolines2FloorG();
118 void setColorFromVertexG(int ix, int iy, bool skip = false);
119
120 virtual void createDataC();
121 virtual void createFloorDataC();
122 void createNormalsC();
123 void Data2FloorC();
124 void Isolines2FloorC();
125 void setColorFromVertexC(int node, bool skip = false);
126};
127
128} // ns
129
130#endif // QWT3D_SURFACEPLOT_H
Abstract base class for data dependent visible user objects
Definition qwt3d_enrichment.h:20
Implements a matrix of z-Values with limit access functions
Definition qwt3d_types.h:417
Base class for all plotting widgets
Definition qwt3d_plot.h:22
A class representing surfaces
Definition qwt3d_surfaceplot.h:16
void resolutionChanged(int)
Signal emitted when the resolution changes
Triple [x,y,z]
Definition qwt3d_types.h:170