QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt3d_color.h
1#ifndef __COLORGENERATOR_H__
2#define __COLORGENERATOR_H__
3
4#include <qstring.h>
5#include "qwt3d_global.h"
6#include "qwt3d_types.h"
7
8namespace Qwt3D {
9
26class QWT3D_EXPORT Color
27{
28public:
29 // Implement your color model here
30 virtual Qwt3D::RGBA operator()(double x, double y,
31 double z) const = 0;
32 virtual Qwt3D::RGBA operator()(Qwt3D::Triple const &t) const
33 {
34 return this->operator()(t.x, t.y, t.z);
35 }
36 // Should create a color vector usable by ColorLegend. The default implementation returns its argument
37 virtual Qwt3D::ColorVector &createVector(Qwt3D::ColorVector &vec) { return vec; }
38
39 void destroy() const { delete this; }
40
41protected:
42 virtual ~Color() { }
43};
44
45class Plot3D;
46
59class QWT3D_EXPORT StandardColor : public Color
60{
61public:
62 // Initializes with data and set up a ColorVector with a size of 100 z values (default)
63 explicit StandardColor(Qwt3D::Plot3D *data, unsigned size = 100);
64 // Receives z-dependent color from ColorVector
65 Qwt3D::RGBA operator()(double x, double y,
66 double z) const;
67 void setColorVector(Qwt3D::ColorVector const &cv);
68 // Resets the standard colors
69 void reset(unsigned size = 100);
70 // Sets unitary alpha value for all colors
71 void setAlpha(double a);
72 // Creates color vector for ColorLegend - essentially a copy from the internal vector
73 Qwt3D::ColorVector &createVector(Qwt3D::ColorVector &vec)
74 {
75 vec = colors_;
76 return vec;
77 }
78
79protected:
80 Qwt3D::ColorVector colors_;
81 Qwt3D::Plot3D *data_;
82};
83
84} // ns
85
86#endif
颜色函数的抽象基类
Definition qwt3d_color.h:27
所有绘图控件的基类
Definition qwt3d_plot.h:31
Plot3D 的标准颜色模型 - 实现数据驱动的 operator()(double x, double y, double z)
Definition qwt3d_color.h:60
红-绿-蓝-透明度值
Definition qwt3d_types.h:480
三元组 [x,y,z]
Definition qwt3d_types.h:240