SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
A base class for operations that should be invoked when the VTK selection changes. More...
#include <RespondToVTKSelection.h>
Public Types | |
using | Result = smtk::operation::Operation::Result |
![]() | |
enum | Outcome { Outcome::UNABLE_TO_OPERATE, Outcome::CANCELED, Outcome::FAILED, Outcome::SUCCEEDED, Outcome::UNKNOWN = -1 } |
typedef std::size_t | Index |
typedef std::shared_ptr< smtk::attribute::Attribute > | Parameters |
typedef std::shared_ptr< smtk::attribute::Attribute > | Result |
typedef std::shared_ptr< smtk::attribute::Resource > | Specification |
typedef std::shared_ptr< smtk::attribute::Definition > | Definition |
Public Member Functions | |
smtkTypeMacro (RespondToVTKSelection) | |
smtkCreateMacro (RespondToVTKSelection) | |
smtkSharedFromThisMacro (smtk::operation::Operation) | |
smtkSuperclassMacro (smtk::operation::XMLOperation) | |
bool | setInteractionMode (int mode) |
Set/get the interaction mode. More... | |
int | interactionMode () const |
bool | setVTKData (vtkMultiBlockDataSet *seln) |
Set/get the multiblock data holding per-component tessellation info. More... | |
vtkMultiBlockDataSet * | vtkData () const |
bool | setVTKSelection (vtkSelection *seln) |
Set/get the VTK data object holding the user-requested selection parameters. More... | |
::vtkSelection * | vtkSelection () const |
bool | setSMTKSelection (const smtk::view::SelectionPtr &seln) |
Set/get the SMTK selection that is the destination/target of the translated VTK selection. More... | |
smtk::view::SelectionPtr | smtkSelection () const |
bool | setSMTKSelectionSource (const std::string &sourceName) |
Set/get the name used as the "source" from which the VTK selection originated. More... | |
std::string | smtkSelectionSource () const |
bool | setSMTKSelectionValue (int value) |
Set/get the SMTK selection bits to be set for each item of the VTK selection. More... | |
int | smtkSelectionValue () const |
bool | setModifier (int modifier) |
Set/get the selection modifier indicated by the user. More... | |
int | modifier () const |
smtk::view::SelectionAction | modifierAction () const |
A convenience to return SMTK's equivalent of modifier()'s value. | |
bool | setSelectingBlocks (bool shouldSelectBlocks) |
Set/get the selection block-mode. More... | |
bool | selectingBlocks () const |
![]() | |
smtkTypeMacro (XMLOperation) | |
smtkSharedFromThisMacro (smtk::operation::Operation) | |
![]() | |
smtkTypeMacroBase (smtk::operation::Operation) | |
virtual Index | index () const |
virtual bool | configure (const smtk::attribute::AttributePtr &changedAttribute=smtk::attribute::AttributePtr(), const smtk::attribute::ItemPtr &changedItem=smtk::attribute::ItemPtr()) |
Update the operation's specification and operations to be consistent. More... | |
virtual bool | ableToOperate () |
Check if the operation's attribute resource is valid. More... | |
Result | operate () |
Execute the operation, log its outcome and return its results. More... | |
Outcome | safeOperate () |
Execute the operation in an asynchronous environment. More... | |
Outcome | safeOperate (Handler handler) |
virtual bool | releaseResult (Result &result) |
Release the operation result returned by operate() . More... | |
virtual smtk::io::Logger & | log () const |
Retrieve the operation's logger. More... | |
Specification | specification () |
This accessor facilitates the lazy construction of the specification, allowing for derived implementations of its creation. More... | |
Parameters | parameters () |
Access the operation's input parameters, constructing them if necessary. More... | |
Parameters | parameters () const |
Result | createResult (Outcome) |
Create an attribute representing this operation's result type. More... | |
ManagerPtr | manager () const |
Operations that are managed have a non-null pointer to their manager. | |
bool | restoreTrace (const std::string &trace) |
restore operation parameters from the trace of a previously run operation. | |
void | setManagers (const std::shared_ptr< smtk::common::Managers > &m) |
Operations may be passed application state in the form of a Managers type-container. | |
std::shared_ptr< smtk::common::Managers > | managers () const |
virtual bool | threadSafe () const |
Is this type of operation safe to launch in a thread? | |
smtk::resource::ManagerPtr | resourceManager () |
retrieve the resource manager, if available. | |
Result | operate (Key) |
Protected Member Functions | |
bool | transcribeBlockSelection () |
A convenience method that subclasses may use internally to handle VTK block selections. More... | |
Result | operateInternal () override |
By default, only handle block selections by calling transcribeBlockSelection(). | |
void | generateSummary (Operation::Result &) override |
Fail or succeed quietly. | |
![]() | |
Specification | createSpecification () override |
![]() | |
virtual void | postProcessResult (Result &) |
virtual void | markModifiedResources (Result &) |
virtual bool | unmanageResources (Result &) |
virtual void | generateSummary (Result &) |
Specification | createBaseSpecification () const |
Protected Attributes | |
int | m_interactionMode |
::vtkSelection * | m_vtkSelection { nullptr } |
vtkMultiBlockDataSet * | m_vtkData { nullptr } |
smtk::view::WeakSelectionPtr | m_smtkSelection |
std::string | m_smtkSelectionSource |
int | m_smtkSelectionValue { 1 } |
int | m_modifier { 0 } |
bool | m_selectingBlocks { false } |
![]() | |
int | m_debugLevel { 0 } |
std::weak_ptr< Manager > | m_manager |
std::shared_ptr< smtk::common::Managers > | m_managers |
Additional Inherited Members | |
![]() | |
friend | Manager |
friend | ImportPythonOperation |
A base class for operations that should be invoked when the VTK selection changes.
Instances of subclasses of this operation are automatically populated by the current selection object inside ParaView by the vtkSMTKEncodeSelection class created as selection occurs.
The selection translator behavior will invoke subclass instances that have been registered to the VTKSelectionResponderGroup until one returns success.
bool smtk::view::RespondToVTKSelection::setInteractionMode | ( | int | mode | ) |
Set/get the interaction mode.
The interaction mode values correspond to the vtkPVRenderView::InteractionModes enum:
Generally speaking, primitive selections should not be created when the interaction mode is INTERACTION_MODE_3D, INTERACTION_MODE_2D, or INTERACTION_MODE_ZOOM (as these modes are for camera manipulation and whole-object picking).
This is set by the vtkSMTKWrapper before the operation is invoked.
bool smtk::view::RespondToVTKSelection::setModifier | ( | int | modifier | ) |
Set/get the selection modifier indicated by the user.
The default 0 is to replace the current selection. Other values are: addition (1), subtraction (2), and toggle (3). See ParaView's pqView.h header for values.
bool smtk::view::RespondToVTKSelection::setSelectingBlocks | ( | bool | shouldSelectBlocks | ) |
Set/get the selection block-mode.
When true, the user is selecting blocks, which indicates that SMTK should select persistent objects (usu. components) rather than subsets.
The value returned by setSelectingBlocks() indicates whether the value was changed rather than the new or old value of the internal variable itself; call selectingBlocks() to discover the internal variable value.
bool smtk::view::RespondToVTKSelection::setSMTKSelection | ( | const smtk::view::SelectionPtr & | seln | ) |
Set/get the SMTK selection that is the destination/target of the translated VTK selection.
This is set by the vtkSMTKWrapper before the operation is invoked.
bool smtk::view::RespondToVTKSelection::setSMTKSelectionSource | ( | const std::string & | sourceName | ) |
Set/get the name used as the "source" from which the VTK selection originated.
This defaults to "paraview" but will usually be overwritten by whatever the vtkSMTKWrapper is configured to use.
bool smtk::view::RespondToVTKSelection::setSMTKSelectionValue | ( | int | value | ) |
Set/get the SMTK selection bits to be set for each item of the VTK selection.
This defaults to 1 but will usually be overwritten by whatever the vtkSMTKWrapper is configured to use. Note that a value of 0 is not accepted; at least one bit must be set.
bool smtk::view::RespondToVTKSelection::setVTKData | ( | vtkMultiBlockDataSet * | seln | ) |
Set/get the multiblock data holding per-component tessellation info.
This is set by the vtkSMTKWrapper before the operation is invoked.
bool smtk::view::RespondToVTKSelection::setVTKSelection | ( | vtkSelection * | seln | ) |
Set/get the VTK data object holding the user-requested selection parameters.
This is set by the vtkSMTKWrapper before the operation is invoked.
|
protected |
A convenience method that subclasses may use internally to handle VTK block selections.
This will modify the SMTK selection to match the VTK selection should any selected blocks correspond to SMTK components.
Note that the selection may be filtered.