QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
Qwt3D::StandardColor Class Reference

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

#include <qwt3d_color.h>

Inheritance diagram for Qwt3D::StandardColor:
Qwt3D::Color

Classes

class  PrivateData
 

Public Member Functions

 StandardColor (Qwt3D::Plot3D *data, unsigned size=100)
 Constructs a StandardColor object.
 
Qwt3D::RGBA operator() (double x, double y, double z) const override
 Returns the color for a given z value.
 
void setColorVector (Qwt3D::ColorVector const &cv)
 Assigns a new ColorVector.
 
void reset (unsigned size=100)
 
void setAlpha (double a)
 Sets the alpha value for all colors.
 
Qwt3D::ColorVector & createVector (Qwt3D::ColorVector &vec) override
 Creates color vector for ColorLegend - essentially a copy from the internal vector.
 
void setPreset (const QString &presetName, unsigned size=100)
 Set colormap from a preset name.
 
- Public Member Functions inherited from Qwt3D::Color
virtual Qwt3D::RGBA operator() (Qwt3D::Triple const &t) const
 
void destroy () const
 

Detailed Description

Standard color model for Plot3D - 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)

Constructor & Destructor Documentation

◆ StandardColor()

StandardColor::StandardColor(Plot3D *data, unsigned size) StandardColor::reset void(unsigned size) ( Qwt3D::Plot3D data,
unsigned  size = 100 
)
explicit

Constructs a StandardColor object.

Parameters
dataPlot3D data source for color mapping
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.

Resets the color vector to the default colormap

Parameters
sizeNumber of color entries to generate

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

Member Function Documentation

◆ createVector()

Qwt3D::ColorVector & StandardColor::createVector ( Qwt3D::ColorVector &  vec)
overridevirtual

Creates color vector for ColorLegend - essentially a copy from the internal vector.

Parameters
vecThe vector to fill
Returns
Reference to the filled color vector

Reimplemented from Qwt3D::Color.

◆ operator()()

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

Returns the color for a given z value.

Parameters
zThe z coordinate value for color lookup
Returns
RGBA color corresponding to the z value

Maps the z value to a color index based on the data hull's z range.

Implements Qwt3D::Color.

◆ setAlpha()

void StandardColor::setAlpha ( double  a)

Sets the alpha value for all colors.

Parameters
aAlpha value (0.0 to 1.0)

◆ setColorVector()

void StandardColor::setColorVector ( Qwt3D::ColorVector const &  cv)

Assigns a new ColorVector.

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

◆ setPreset()

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

Set colormap from a preset name.

Parameters
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.


The documentation for this class was generated from the following files: