QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 成员函数 | 所有成员列表
Qwt3DStandardColor类 参考

Standard color model for Qwt3DPlot - implements the data driven operator()(double x, double y, double z) 更多...

#include <qwt3d_color.h>

类 Qwt3DStandardColor 继承关系图:
Qwt3DColor

class  PrivateData
 

Public 成员函数

 Qwt3DStandardColor (unsigned size=100)
 Constructs a Qwt3DStandardColor object
 
RGBA operator() (double x, double y, double z) const override
 Returns the color for a given z value
 
void setColorVector (ColorVector const &cv)
 Assigns a new ColorVector
 
void reset (unsigned size=100)
 
void setAlpha (double a)
 Sets the alpha value for all colors
 
ColorVector & createVector (ColorVector &vec) override
 Creates color vector for Qwt3DColorLegend - essentially a copy from the internal vector
 
void setPreset (const QString &presetName, unsigned size=100)
 Set colormap from a preset name
 
QString presetName () const
 返回当前 preset 名称
 
unsigned colorCount () const
 返回颜色向量中的颜色数量
 
double alpha () const
 返回上次 setAlpha() 设置的 alpha 值
 
- Public 成员函数 继承自 Qwt3DColor
virtual RGBA operator() (Triple const &t) const
 
void destroy () const
 
void setActiveRange (double zMin, double zMax)
 Sets the active z-range used for color normalization (pushed by the owning Qwt3DPlotItem before VBO/legend build)
 

额外继承的成员函数

- Protected 成员函数 继承自 Qwt3DColor
double activeZMin () const
 Lower bound of the active z-range (default 0.0)
 
double activeZMax () const
 Upper bound of the active z-range (default 1.0)
 

详细描述

Standard color model for Qwt3DPlot - implements the data driven operator()(double x, double y, double z)

The class has a ColorVector representing z values, which will be used by operator()(double x, double y, double z)

构造及析构函数说明

◆ Qwt3DStandardColor()

Qwt3DStandardColor::Qwt3DStandardColor ( unsigned  size = 100)
explicit

Constructs a Qwt3DStandardColor object

参数
sizeNumber of color entries in the color vector

Creates a standard color mapping with the specified size and resets the color vector to default gradient values. The z-range used for color normalization is pushed in by the owning Qwt3DPlotItem via setActiveRange() (defaults to [0, 1] until set).

Resets the color vector to the default colormap

参数
sizeNumber of color entries to generate

Creates a color vector of the given size sampled from the viridis colormap, the modern perceptually-uniform default.

成员函数说明

◆ alpha()

double Qwt3DStandardColor::alpha ( ) const

返回上次 setAlpha() 设置的 alpha 值

返回
alpha 值(0.0 ~ 1.0),默认 1.0

◆ colorCount()

unsigned Qwt3DStandardColor::colorCount ( ) const

返回颜色向量中的颜色数量

返回
颜色数量

◆ createVector()

ColorVector & Qwt3DStandardColor::createVector ( ColorVector &  vec)
overridevirtual

Creates color vector for Qwt3DColorLegend - essentially a copy from the internal vector

参数
vecThe vector to fill
返回
Reference to the filled color vector

重载 Qwt3DColor .

◆ operator()()

RGBA Qwt3DStandardColor::operator() ( double  x,
double  y,
double  z 
) const
overridevirtual

Returns the color for a given z value

参数
zThe z coordinate value for color lookup
返回
RGBA color corresponding to the z value

Maps the z value to a color index based on the active z-range pushed in by the owning Qwt3DPlotItem via setActiveRange().

实现了 Qwt3DColor.

◆ presetName()

QString Qwt3DStandardColor::presetName ( ) const

返回当前 preset 名称

返回
preset 名称字符串,如果通过 setColorVector() 设置则返回空字符串

◆ setAlpha()

void Qwt3DStandardColor::setAlpha ( double  a)

Sets the alpha value for all colors

参数
aAlpha value (0.0 to 1.0)

Silent mutation: call Qwt3DSurface::invalidateColors() to rebuild.

◆ setColorVector()

void Qwt3DStandardColor::setColorVector ( ColorVector const &  cv)

Assigns a new ColorVector

参数
cvThe new color vector (also overwrites the constructor's size argument)

This is a silent mutation: the owning Qwt3DPlotItem is not notified. Call Qwt3DSurface::invalidateColors() afterwards to trigger a VBO rebuild.

◆ setPreset()

void Qwt3DStandardColor::setPreset ( const QString &  presetName,
unsigned  size = 100 
)

Set colormap from a preset name

参数
presetNameName of the colormap preset (e.g. "viridis", "plasma", "jet")
sizeNumber of color stops to sample from the colormap

Uses QwtColorMapPreset to create a QwtLinearColorMap and samples it at the specified number of points to fill the internal color vector.


该类的文档由以下文件生成: