SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
smtk::view::RespondToVTKSelection Class Reference

A base class for operations that should be invoked when the VTK selection changes. More...

#include <RespondToVTKSelection.h>

Inheritance diagram for smtk::view::RespondToVTKSelection:
[legend]
Collaboration diagram for smtk::view::RespondToVTKSelection:
[legend]

Public Types

using Result = smtk::operation::Operation::Result
 
- Public Types inherited from smtk::operation::Operation
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::AttributeParameters
 
typedef std::shared_ptr< smtk::attribute::AttributeResult
 
typedef std::shared_ptr< smtk::attribute::ResourceSpecification
 
typedef std::shared_ptr< smtk::attribute::DefinitionDefinition
 

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
 
- Public Member Functions inherited from smtk::operation::XMLOperation
 smtkTypeMacro (XMLOperation)
 
 smtkSharedFromThisMacro (smtk::operation::Operation)
 
- Public Member Functions inherited from 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...
 
virtual smtk::io::Loggerlog () 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::Managersmanagers () 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.
 
- Protected Member Functions inherited from smtk::operation::XMLOperation
Specification createSpecification () override
 
- Protected Member Functions inherited from smtk::operation::Operation
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 }
 
- Protected Attributes inherited from smtk::operation::Operation
int m_debugLevel { 0 }
 
std::weak_ptr< Managerm_manager
 
std::shared_ptr< smtk::common::Managersm_managers
 

Additional Inherited Members

- Public Attributes inherited from smtk::operation::Operation
friend Manager
 
friend ImportPythonOperation
 

Detailed Description

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.

Member Function Documentation

◆ setInteractionMode()

bool smtk::view::RespondToVTKSelection::setInteractionMode ( int  mode)

Set/get the interaction mode.

The interaction mode values correspond to the vtkPVRenderView::InteractionModes enum:

  • INTERACTION_MODE_3D = 0,
  • INTERACTION_MODE_2D,
  • INTERACTION_MODE_SELECTION,
  • INTERACTION_MODE_ZOOM,
  • INTERACTION_MODE_POLYGON

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.

◆ setModifier()

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.

◆ setSelectingBlocks()

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.

◆ setSMTKSelection()

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.

◆ setSMTKSelectionSource()

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.

◆ setSMTKSelectionValue()

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.

◆ setVTKData()

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.

◆ setVTKSelection()

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.

◆ transcribeBlockSelection()

bool smtk::view::RespondToVTKSelection::transcribeBlockSelection ( )
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.


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