Public Types | Signals | Public Member Functions | Protected Slots | List of all members
pqPresetDialog Class Reference

pqPresetDialog is the dialog used by to show the user with a choice of color maps/opacity maps/presets to choose from. More...

#include <pqPresetDialog.h>

Inherits QDialog.

Public Types

enum  Modes { SHOW_ALL, SHOW_INDEXED_COLORS_ONLY, SHOW_NON_INDEXED_COLORS_ONLY }
 Used to control what kinds of presets are shown in the dialog. More...
 

Signals

void applyPreset (const Json::Value &preset)
 

Public Member Functions

 pqPresetDialog (QWidget *parent=nullptr, Modes mode=SHOW_ALL)
 
 ~pqPresetDialog () override
 
void setMode (Modes mode)
 Set the current mode (which type of presets are displayed) More...
 
void setCurrentPreset (const char *presetName)
 Set the current preset using its name. More...
 
const Json::Value & currentPreset ()
 Return current preset, if any. More...
 
bool loadColors () const
 Returns true if the user requested to load colors for the current preset. More...
 
bool loadOpacities () const
 Returns true if the user requested to load opacities for the current preset. More...
 
bool loadAnnotations () const
 Returns true if the user requested to load annotations for the current preset. More...
 
QRegularExpression regularExpression ()
 Returns the specified regularExpression. More...
 
bool usePresetRange () const
 Returns true if the user requested to preserve/use the preset data range. More...
 
void setCustomizableLoadColors (bool state, bool defaultValue=true)
 Set when user can choose to load colors along with the default state. More...
 
void setCustomizableLoadAnnotations (bool state, bool defaultValue=true)
 Set when user can choose to load annotations along with the default state. More...
 
void setCustomizableAnnotationsRegexp (bool state, bool defaultValue=false)
 Set when user can choose a regexp to load annotations along with the default state. More...
 
void setCustomizableLoadOpacities (bool state, bool defaultValue=true)
 Set when user can choose to load opacities along with the default state. More...
 
void setCustomizableUsePresetRange (bool state, bool defaultValue=false)
 Set when user can choose to load usePresetRange along with the default state. More...
 

Protected Slots

void updateEnabledStateForSelection ()
 
void updateForSelectedIndex (const QModelIndex &proxyIndex)
 
void triggerApply (const QModelIndex &proxyIndex=QModelIndex())
 
void removePreset (const QModelIndex &idx=QModelIndex())
 
void importPresets ()
 
void exportPresets ()
 
void setPresetIsAdvanced (int newState)
 

Detailed Description

pqPresetDialog is the dialog used by to show the user with a choice of color maps/opacity maps/presets to choose from.

The Dialog can be customized to show only indexed (or non-indexed) color maps using pqPresetDialog::Modes. Application code should observe the pqPresetDialog::applyPreset() signal to perform the applying of the preset to a specific transfer function proxy. This class works with vtkSMTransferFunctionPresets, which acts as the preset manager for the application with support to inspect existing presets as well as updating them.

Definition at line 25 of file pqPresetDialog.h.

Member Enumeration Documentation

◆ Modes

Used to control what kinds of presets are shown in the dialog.

This merely affects the presets that are hidden from the view.

Enumerator
SHOW_ALL 
SHOW_INDEXED_COLORS_ONLY 
SHOW_NON_INDEXED_COLORS_ONLY 

Definition at line 35 of file pqPresetDialog.h.

Constructor & Destructor Documentation

◆ pqPresetDialog()

pqPresetDialog::pqPresetDialog ( QWidget *  parent = nullptr,
Modes  mode = SHOW_ALL 
)

◆ ~pqPresetDialog()

pqPresetDialog::~pqPresetDialog ( )
override

Member Function Documentation

◆ setMode()

void pqPresetDialog::setMode ( Modes  mode)

Set the current mode (which type of presets are displayed)

◆ setCurrentPreset()

void pqPresetDialog::setCurrentPreset ( const char *  presetName)

Set the current preset using its name.

◆ currentPreset()

const Json::Value& pqPresetDialog::currentPreset ( )

Return current preset, if any.

◆ loadColors()

bool pqPresetDialog::loadColors ( ) const

Returns true if the user requested to load colors for the current preset.

◆ loadOpacities()

bool pqPresetDialog::loadOpacities ( ) const

Returns true if the user requested to load opacities for the current preset.

◆ loadAnnotations()

bool pqPresetDialog::loadAnnotations ( ) const

Returns true if the user requested to load annotations for the current preset.

◆ regularExpression()

QRegularExpression pqPresetDialog::regularExpression ( )

Returns the specified regularExpression.

◆ usePresetRange()

bool pqPresetDialog::usePresetRange ( ) const

Returns true if the user requested to preserve/use the preset data range.

If false, the user is expecting the current transfer function range to be maintained.

◆ setCustomizableLoadColors()

void pqPresetDialog::setCustomizableLoadColors ( bool  state,
bool  defaultValue = true 
)

Set when user can choose to load colors along with the default state.

◆ setCustomizableLoadAnnotations()

void pqPresetDialog::setCustomizableLoadAnnotations ( bool  state,
bool  defaultValue = true 
)

Set when user can choose to load annotations along with the default state.

◆ setCustomizableAnnotationsRegexp()

void pqPresetDialog::setCustomizableAnnotationsRegexp ( bool  state,
bool  defaultValue = false 
)

Set when user can choose a regexp to load annotations along with the default state.

◆ setCustomizableLoadOpacities()

void pqPresetDialog::setCustomizableLoadOpacities ( bool  state,
bool  defaultValue = true 
)

Set when user can choose to load opacities along with the default state.

◆ setCustomizableUsePresetRange()

void pqPresetDialog::setCustomizableUsePresetRange ( bool  state,
bool  defaultValue = false 
)

Set when user can choose to load usePresetRange along with the default state.

◆ applyPreset

void pqPresetDialog::applyPreset ( const Json::Value &  preset)
signal

◆ updateEnabledStateForSelection

void pqPresetDialog::updateEnabledStateForSelection ( )
protectedslot

◆ updateForSelectedIndex

void pqPresetDialog::updateForSelectedIndex ( const QModelIndex &  proxyIndex)
protectedslot

◆ triggerApply

void pqPresetDialog::triggerApply ( const QModelIndex &  proxyIndex = QModelIndex())
protectedslot

◆ removePreset

void pqPresetDialog::removePreset ( const QModelIndex &  idx = QModelIndex())
protectedslot

◆ importPresets

void pqPresetDialog::importPresets ( )
protectedslot

◆ exportPresets

void pqPresetDialog::exportPresets ( )
protectedslot

◆ setPresetIsAdvanced

void pqPresetDialog::setPresetIsAdvanced ( int  newState)
protectedslot

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