A special property class that can be used as member, if you want to provide a ComboBox where the user is able to select the available and registered color colormaps.
More...
#include <visualization/ColormapProperty.h>
A special property class that can be used as member, if you want to provide a ComboBox where the user is able to select the available and registered color colormaps.
- See also
- Colormap
◆ ColormapProperty() [1/2]
Creates property with no selected colormap.
◆ ColormapProperty() [2/2]
Tries to select the specified colormap.
◆ reflectRead()
void reflectRead |
( |
Reflector & |
r | ) |
|
|
inline |
◆ reflectWrite()
void reflectWrite |
( |
Reflector & |
r | ) |
|
|
inline |
◆ isValid()
Returns true, if a valid colormap was chosen.
◆ operator=()
Assigns colormap identifier string.
◆ str()
const std::string& str |
( |
| ) |
const |
|
inline |
Returns the set colormap identifier as string.
◆ getColormap()
Returns the chosen color colormap.
- Exceptions
-
XInvalidParameter | if no valid colormap is set. |
◆ getColorTable()
const QVector<QRgb>& getColorTable |
( |
| ) |
const |
Returns the chosen color colormap as color table in Qt compliant form.
- Exceptions
-
XInvalidParameter | if no valid colormap is set. |
◆ setFilter()
void setFilter |
( |
boost::function< bool(const Colormap *)> |
filterFunction | ) |
|
Allows to specify a filter function.
The filter function can be used to filter the colormaps that are shown in the combobox and that can be specified using the property. The filter function must take a pointer to a Colormap as parameter and should return true, if the colormap is allowed, or false, if it should be filtered out.
A predefined filter function is filterContinuous().
Example:
- Note
- : if you use a ColormapProperty member 'mycolormap' in your class and mycolormap is reflected, be aware that it may not be enough to set the filter to colormap in your class' constructor: When restoring your class from serialized data (e.g. XML), depending on the particular method used for reflection, a temporary ColormapProperty object may be created, which is then copied over to the mycolormap member, thus overwriting the filter setting. To avoid this, use a setter function in your reflection and set the filter on mycolormap after copying the parameter value.
◆ filter()
bool filter |
( |
const Colormap * |
colormap | ) |
const |
Returns true, if the specified colormap has passed the optional set filter.
(for internal use)
◆ filterContinuous()
static bool filterContinuous |
( |
const Colormap * |
colormap | ) |
|
|
inlinestatic |
The documentation for this class was generated from the following file: