Reaction to pop up a color palette chooser dialog. More...
#include <pqChooseColorPresetReaction.h>
Public Slots | |
bool | choosePreset (const char *presetName=nullptr) |
Choose color preset for the representation set using setRepresentation(). More... | |
void | updateEnableState () override |
Updates the enabled state. More... | |
void | setAllowsRegexpMatching (bool allow) |
Show/hide widget in the dialog. More... | |
QRegularExpression | regularExpression () |
Return the regular expression specified in the Dialog. More... | |
bool | loadAnnotations () |
Return if annotations should be loaded. More... | |
void | setRepresentation (pqDataRepresentation *repr, int selectedPropertiesType) |
Set the data representation explicitly when track_active_objects is false. More... | |
void | setRepresentation (pqDataRepresentation *repr) |
Set the data representation explicitly when track_active_objects is false. More... | |
void | setActiveRepresentation () |
Set the data representation explicitly when track_active_objects is false. More... | |
void | setTransferFunctions (std::vector< vtkSMProxy *> lut) |
Set the transfer function proxy. More... | |
void | setTransferFunction (vtkSMProxy *lut) |
Set the transfer function proxy. More... | |
Signals | |
void | presetApplied (const QString &) |
fired every time a preset is applied. More... | |
Public Member Functions | |
pqChooseColorPresetReaction (QAction *parent, bool track_active_objects=true) | |
~pqChooseColorPresetReaction () override | |
Public Member Functions inherited from pqReaction | |
pqReaction (QAction *parent, Qt::ConnectionType type=Qt::AutoConnection) | |
Constructor. More... | |
~pqReaction () override | |
QAction * | parentAction () const |
Provides access to the parent action. More... | |
Protected Member Functions | |
void | onTriggered () override |
Called when the action is triggered. More... | |
Additional Inherited Members | |
Protected Slots inherited from pqReaction | |
virtual void | updateEnableState () |
virtual void | updateMasterEnableState (bool) |
Protected Attributes inherited from pqReaction | |
bool | IsMaster |
Reaction to pop up a color palette chooser dialog.
pqChooseColorPresetReaction is used by pqColorEditorPropertyWidget (for example) allow the user to change the color palette. It pops up a modal dialog with color presets to select and apply. There are three ways of using this reaction:
track_active_objects
parameter to the constructor as true
(default). When in this configuration, the reaction monitors the active representation (via pqActiveObjects) and allows the user to load a preset on the active representation's color/opacity transfer function using the parent action.track_active_objects
parameter to the constructor as false
. Then the calling code can explicitly set the representation using pqChooseColorPresetReaction::setRepresentation() method. The reaction will monitor this representation and allow user to load preset of its transfer functions.track_active_objects
parameter to the constructor as false
and then set the transfer function proxy explicitly using pqChooseColorPresetReaction::setTransferFunction() method.In all modes, the reaction will fire the presetApplied() signal to indicate a new preset has been applied. Typically one can hook that signal up to render affected views.
Definition at line 49 of file pqChooseColorPresetReaction.h.
pqChooseColorPresetReaction::pqChooseColorPresetReaction | ( | QAction * | parent, |
bool | track_active_objects = true |
||
) |
|
override |
|
slot |
Choose color preset for the representation set using setRepresentation().
Returns false if representation cannot be located or its is not using scalar coloring.
|
slot |
Set the data representation explicitly when track_active_objects is false.
|
inlineslot |
Set the data representation explicitly when track_active_objects is false.
Definition at line 71 of file pqChooseColorPresetReaction.h.
|
slot |
Set the data representation explicitly when track_active_objects is false.
|
slot |
Set the transfer function proxy.
This can be used, instead of setRepresentation() when track_active_objects
was false to directly set the transfer function proxy on which to apply the preset.
|
inlineslot |
Set the transfer function proxy.
This can be used, instead of setRepresentation() when track_active_objects
was false to directly set the transfer function proxy on which to apply the preset.
Definition at line 85 of file pqChooseColorPresetReaction.h.
|
overrideslot |
Updates the enabled state.
Applications need not explicitly call this.
|
inlineslot |
Show/hide widget in the dialog.
Allows a regexp as user entry to do the matching between data values and preset. Intended to be used for series preset.
Definition at line 101 of file pqChooseColorPresetReaction.h.
|
slot |
Return the regular expression specified in the Dialog.
|
slot |
Return if annotations should be loaded.
|
signal |
fired every time a preset is applied.
|
overrideprotectedvirtual |
Called when the action is triggered.
Reimplemented from pqReaction.