QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
qwt3d_colormap_color.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10#ifndef QWT3D_COLORMAP_COLOR_H
11#define QWT3D_COLORMAP_COLOR_H
12
13#include "qwt3d_global.h"
14#include "qwt3d_color.h"
15
16class QwtColorMap;
17class QString;
18
19
20
25class QWT3D_EXPORT Qwt3DColorMapColor : public Qwt3DColor
26{
27public:
28 explicit Qwt3DColorMapColor(const QString& presetName = QString("viridis"), unsigned size = 256);
29
30 Qwt3DColorMapColor(::QwtColorMap* colorMap, unsigned size = 256);
31
32 ~Qwt3DColorMapColor() override;
33
34 RGBA operator()(double x, double y, double z) const override;
35 ColorVector& createVector(ColorVector& vec) override;
36
37 void setColorMap(::QwtColorMap* map);
38 const ::QwtColorMap* colorMap() const;
39
40 void setInterval(double min, double max);
41 void reset(unsigned size = 256);
42 void setAlpha(double a);
43
44 // Returns the preset name passed to the constructor (empty if constructed from QwtColorMap*)
45 QString presetName() const;
46 // Returns the number of colors in the color vector
47 unsigned colorCount() const;
48 // Returns the alpha value (default 1.0)
49 double alpha() const;
50 // Returns true if a manual interval was set via setInterval()
51 bool useManualInterval() const;
52 // Returns the manual min value (only meaningful when useManualInterval() is true)
53 double manualMin() const;
54 // Returns the manual max value (only meaningful when useManualInterval() is true)
55 double manualMax() const;
56
57private:
58 void rebuildColorVector(unsigned size);
59
60 ::QwtColorMap* m_colorMap;
61 ColorVector m_colors;
62 double m_manualMin;
63 double m_manualMax;
64 bool m_useManualInterval;
65 double m_alpha;
66 QString m_presetName;
67};
68
69
70#endif
Adapts a QwtColorMap (from qwt::core) for use as a Qwt3DColor.
Definition qwt3d_colormap_color.h:26
Abstract base class for color functors.
Definition qwt3d_color.h:25
QwtColorMap is used to map values into colors.
Definition qwt_colormap.h:33
Red-Green-Blue-Alpha value.
Definition qwt3d_types.h:395