manages presets for color, opacity, and annotation presets.
More...
#include <vtkSMTransferFunctionPresets.h>
manages presets for color, opacity, and annotation presets.
vtkSMTransferFunctionPresets is a manager to manage all color, opacity, and annotation presets. It also uses vtkSMSettings to support persistent customizations besides hard-coded/builtin presets.
vtkSMTransferFunctionPresets designed to be instantiated, used and then destroyed. While there is no explicit synchronization between multiple instances of vtkSMTransferFunctionPresets, there should not be any need to have multiple instances alive at the same time.
Definition at line 44 of file vtkSMTransferFunctionPresets.h.
◆ Superclass
◆ vtkSMTransferFunctionPresets()
vtkSMTransferFunctionPresets::vtkSMTransferFunctionPresets |
( |
| ) |
|
|
protected |
◆ ~vtkSMTransferFunctionPresets()
vtkSMTransferFunctionPresets::~vtkSMTransferFunctionPresets |
( |
| ) |
|
|
protected |
◆ New()
◆ GetClassName()
virtual const char* vtkSMTransferFunctionPresets::GetClassName |
( |
| ) |
|
|
virtual |
◆ IsTypeOf()
static int vtkSMTransferFunctionPresets::IsTypeOf |
( |
const char * |
type | ) |
|
|
static |
◆ IsA()
virtual int vtkSMTransferFunctionPresets::IsA |
( |
const char * |
type | ) |
|
|
virtual |
◆ SafeDownCast()
◆ PrintSelf()
void vtkSMTransferFunctionPresets::PrintSelf |
( |
ostream & |
os, |
|
|
vtkIndent |
indent |
|
) |
| |
◆ GetNumberOfPresets()
unsigned int vtkSMTransferFunctionPresets::GetNumberOfPresets |
( |
| ) |
|
Returns the number of presets current available (including builtin and custom).
◆ GetPresetAsString()
vtkStdString vtkSMTransferFunctionPresets::GetPresetAsString |
( |
unsigned int |
index | ) |
|
Gets the raw text for a preset given its index.
The preset is provided as a JSON string. Returns an empty string when not available.
◆ AddPreset() [1/2]
bool vtkSMTransferFunctionPresets::AddPreset |
( |
const char * |
name, |
|
|
const vtkStdString & |
preset |
|
) |
| |
Add a new preset.
This will get saved across sessions using vtkSMSettings, as appropriate. If name provided already exists, this will override the existing preset (even for builtin presets). preset
must be a valid JSON string. If not, this will return failure.
◆ RemovePreset()
bool vtkSMTransferFunctionPresets::RemovePreset |
( |
unsigned int |
index | ) |
|
Remove a preset.
This has no effect for builtin presets.
◆ GetFirstPresetWithName()
const Json::Value& vtkSMTransferFunctionPresets::GetFirstPresetWithName |
( |
const char * |
name | ) |
|
Returns a preset JSON given the name.
Since multiple presets can have the same name, this returns the 'first' preset with the specified name.
◆ GetPreset()
const Json::Value& vtkSMTransferFunctionPresets::GetPreset |
( |
unsigned int |
index | ) |
|
Returns a preset at a given index.
◆ GetPresetName()
vtkStdString vtkSMTransferFunctionPresets::GetPresetName |
( |
unsigned int |
index | ) |
|
Returns the name for a preset at the given index.
◆ GetPresetHasOpacities() [1/2]
bool vtkSMTransferFunctionPresets::GetPresetHasOpacities |
( |
const Json::Value & |
preset | ) |
|
Returns true if the preset has opacities i.e.
values for a piecewise function.
◆ GetPresetHasOpacities() [2/2]
bool vtkSMTransferFunctionPresets::GetPresetHasOpacities |
( |
unsigned int |
index | ) |
|
|
inline |
◆ GetPresetHasIndexedColors() [1/2]
bool vtkSMTransferFunctionPresets::GetPresetHasIndexedColors |
( |
const Json::Value & |
preset | ) |
|
Returns true is the preset has indexed colors.
◆ GetPresetHasIndexedColors() [2/2]
bool vtkSMTransferFunctionPresets::GetPresetHasIndexedColors |
( |
unsigned int |
index | ) |
|
|
inline |
◆ GetPresetHasAnnotations() [1/2]
bool vtkSMTransferFunctionPresets::GetPresetHasAnnotations |
( |
const Json::Value & |
preset | ) |
|
Returns true is the preset has annotations.
◆ GetPresetHasAnnotations() [2/2]
bool vtkSMTransferFunctionPresets::GetPresetHasAnnotations |
( |
unsigned int |
index | ) |
|
|
inline |
◆ AddPreset() [2/2]
bool vtkSMTransferFunctionPresets::AddPreset |
( |
const char * |
name, |
|
|
const Json::Value & |
preset |
|
) |
| |
Add a preset give the Json::Value object.
◆ AddUniquePreset()
vtkStdString vtkSMTransferFunctionPresets::AddUniquePreset |
( |
const Json::Value & |
preset, |
|
|
const char * |
prefix = NULL |
|
) |
| |
Same as AddPreset() expect it create a unique name using the prefix provided.
If no prefix is specified, "Preset" will be used as the prefix.
◆ IsPresetBuiltin()
bool vtkSMTransferFunctionPresets::IsPresetBuiltin |
( |
unsigned int |
index | ) |
|
Returns true if the preset is a builtin preset.
The preset is identified by its index.
◆ RenamePreset()
bool vtkSMTransferFunctionPresets::RenamePreset |
( |
unsigned int |
index, |
|
|
const char * |
newname |
|
) |
| |
◆ ImportPresets() [1/2]
bool vtkSMTransferFunctionPresets::ImportPresets |
( |
const char * |
filename | ) |
|
Load presets from a file.
All presets are added to "custom" presets list and are considered as non-builtin. If the filename ends with a .xml, it's assumed to be a legacy color map XML and will be converted to the new format before processing.
◆ ImportPresets() [2/2]
bool vtkSMTransferFunctionPresets::ImportPresets |
( |
const Json::Value & |
presets | ) |
|
Load presets from a file.
All presets are added to "custom" presets list and are considered as non-builtin. If the filename ends with a .xml, it's assumed to be a legacy color map XML and will be converted to the new format before processing.
The documentation for this class was generated from the following file: