ParaView
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
vtkSMTransferFunctionPresets Class Reference

manages presets for color, opacity, and annotation presets. More...

#include <vtkSMTransferFunctionPresets.h>

Inheritance diagram for vtkSMTransferFunctionPresets:
Inheritance graph
[legend]
Collaboration diagram for vtkSMTransferFunctionPresets:
Collaboration graph
[legend]

Public Types

typedef vtkSMObject Superclass
 
- Public Types inherited from vtkSMObject
typedef vtkObject Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent)
 
unsigned int GetNumberOfPresets ()
 Returns the number of presets current available (including builtin and custom). More...
 
vtkStdString GetPresetAsString (unsigned int index)
 Gets the raw text for a preset given its index. More...
 
bool AddPreset (const char *name, const vtkStdString &preset)
 Add a new preset. More...
 
bool RemovePreset (unsigned int index)
 Remove a preset. More...
 
const Json::Value & GetFirstPresetWithName (const char *name)
 Returns a preset JSON given the name. More...
 
const Json::Value & GetPreset (unsigned int index)
 Returns a preset at a given index. More...
 
vtkStdString GetPresetName (unsigned int index)
 Returns the name for a preset at the given index. More...
 
bool GetPresetHasOpacities (const Json::Value &preset)
 Returns true if the preset has opacities i.e. More...
 
bool GetPresetHasOpacities (unsigned int index)
 
bool GetPresetHasIndexedColors (const Json::Value &preset)
 Returns true is the preset has indexed colors. More...
 
bool GetPresetHasIndexedColors (unsigned int index)
 
bool GetPresetHasAnnotations (const Json::Value &preset)
 Returns true is the preset has annotations. More...
 
bool GetPresetHasAnnotations (unsigned int index)
 
bool AddPreset (const char *name, const Json::Value &preset)
 Add a preset give the Json::Value object. More...
 
vtkStdString AddUniquePreset (const Json::Value &preset, const char *prefix=NULL)
 Same as AddPreset() expect it create a unique name using the prefix provided. More...
 
bool IsPresetBuiltin (unsigned int index)
 Returns true if the preset is a builtin preset. More...
 
bool RenamePreset (unsigned int index, const char *newname)
 Rename a preset. More...
 
bool ImportPresets (const char *filename)
 Load presets from a file. More...
 
bool ImportPresets (const Json::Value &presets)
 Load presets from a file. More...
 
- Public Member Functions inherited from vtkSMObject
void PrintSelf (ostream &os, vtkIndent indent)
 

Static Public Member Functions

static vtkSMTransferFunctionPresetsNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMTransferFunctionPresetsSafeDownCast (vtkObject *o)
 
- Static Public Member Functions inherited from vtkSMObject
static vtkSMObjectNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMObjectSafeDownCast (vtkObject *o)
 

Protected Member Functions

 vtkSMTransferFunctionPresets ()
 
 ~vtkSMTransferFunctionPresets ()
 
- Protected Member Functions inherited from vtkSMObject
 vtkSMObject ()
 
 ~vtkSMObject ()
 

Detailed Description

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.

Member Typedef Documentation

§ Superclass

Definition at line 48 of file vtkSMTransferFunctionPresets.h.

Constructor & Destructor Documentation

§ vtkSMTransferFunctionPresets()

vtkSMTransferFunctionPresets::vtkSMTransferFunctionPresets ( )
protected

§ ~vtkSMTransferFunctionPresets()

vtkSMTransferFunctionPresets::~vtkSMTransferFunctionPresets ( )
protected

Member Function Documentation

§ New()

static vtkSMTransferFunctionPresets* vtkSMTransferFunctionPresets::New ( )
static

§ GetClassName()

virtual const char* vtkSMTransferFunctionPresets::GetClassName ( )
virtual

Reimplemented from vtkSMObject.

§ IsTypeOf()

static int vtkSMTransferFunctionPresets::IsTypeOf ( const char *  type)
static

§ IsA()

virtual int vtkSMTransferFunctionPresets::IsA ( const char *  type)
virtual

Reimplemented from vtkSMObject.

§ SafeDownCast()

static vtkSMTransferFunctionPresets* vtkSMTransferFunctionPresets::SafeDownCast ( vtkObject *  o)
static

§ 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

Definition at line 96 of file vtkSMTransferFunctionPresets.h.

§ 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

Definition at line 105 of file vtkSMTransferFunctionPresets.h.

§ 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

Definition at line 114 of file vtkSMTransferFunctionPresets.h.

§ 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 
)

Rename a preset.

§ 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: