Version: 9.15.0
SPV3D_CADSelection Class Reference

SPV3D_CADSelection handles various selection modes available on RenderViews. More...

#include <SPV3D_CADSelection.h>

Inheritance diagram for SPV3D_CADSelection:
Inheritance graph

Public Types

enum  SelectionMode { SELECT_SOLIDS , SELECT_FACES , SELECT_EDGES , SELECT_VERTICES }
 

Public Slots

virtual void actionTriggered (bool val)
 For checkable actions, this calls this->beginSelection() or this->endSelection() is val is true or false, respectively. More...
 

Public Member Functions

 SPV3D_CADSelection (QObject *parent, pqRenderView *view, SelectionMode mode)
 If view is nullptr, this reaction will track the active-view maintained by pqActiveObjects. More...
 
 ~SPV3D_CADSelection () override
 
void SetMode (const SPV3D_CADSelection::SelectionMode mode)
 Set the selectionMode. More...
 

Private Slots

void setView (pqView *view)
 Called when this object was created with nullptr as the view and the active view changes. More...
 
void setRepresentation (pqDataRepresentation *representation)
 Called when the active representation changes. More...
 
void beginSelection ()
 starts the selection i.e. More...
 
void endSelection ()
 finishes the selection. More...
 
void updateEnableState ()
 
void onRightButtonPress ()
 Disable preselection during rotation using the right button. More...
 
void onRightButtonRelease ()
 

Private Member Functions

void selectionChanged (vtkObject *, unsigned long, void *calldata)
 callback called when the vtkPVRenderView is done with selection. More...
 
void onMouseMove ()
 callback called for mouse move events when in 'interactive selection' modes. More...
 
void onLeftButtonRelease ()
 callback called for click events when in 'interactive selection' modes. More...
 
int getSelectionModifier ()
 
void fastSelection (bool presel=false)
 makes fast selection. More...
 
void cleanupObservers ()
 cleans up observers. More...
 
 Q_DISABLE_COPY (SPV3D_CADSelection) QPointer< pqRenderView > View
 

Private Attributes

QPointer< pqDataRepresentation > Representation
 
QMetaObject::Connection RepresentationConnection
 
vtkSMRepresentationProxy * CurrentRepresentation = nullptr
 
SelectionMode Mode
 
int PreviousRenderViewMode
 
vtkWeakPointer< vtkObjectObservedObject
 
unsigned long ObserverIds [4]
 
int MousePosition [2]
 
QComboBoxselectionComboBox
 
bool DisablePreSelection = false
 

Detailed Description

SPV3D_CADSelection handles various selection modes available on RenderViews.

Simply create multiple instances of SPV3D_CADSelection to handle selection modes for that RenderView. SPV3D_CADSelection uses internal static members to ensure that at most 1 view (and 1 type of selection) is in selection-mode at any given time.

Member Enumeration Documentation

◆ SelectionMode

Enumerator
SELECT_SOLIDS 
SELECT_FACES 
SELECT_EDGES 
SELECT_VERTICES 

Constructor & Destructor Documentation

◆ SPV3D_CADSelection()

SPV3D_CADSelection::SPV3D_CADSelection ( QObject parent,
pqRenderView *  view,
SelectionMode  mode 
)

If view is nullptr, this reaction will track the active-view maintained by pqActiveObjects.

References Mode, MousePosition, ObserverIds, PreviousRenderViewMode, setRepresentation(), setView(), updateEnableState(), and View.

◆ ~SPV3D_CADSelection()

SPV3D_CADSelection::~SPV3D_CADSelection ( )
override

References cleanupObservers().

Member Function Documentation

◆ actionTriggered

void SPV3D_CADSelection::actionTriggered ( bool  val)
virtualslot

For checkable actions, this calls this->beginSelection() or this->endSelection() is val is true or false, respectively.

For non-checkable actions, this call this->beginSelection() and this->endSelection() in that order.

References beginSelection(), and endSelection().

◆ beginSelection

void SPV3D_CADSelection::beginSelection ( )
privateslot

starts the selection i.e.

setup render view in selection mode.

References ObservedObject, ObserverIds, onLeftButtonRelease(), onMouseMove(), onRightButtonPress(), onRightButtonRelease(), PreviousRenderViewMode, and View.

◆ cleanupObservers()

void SPV3D_CADSelection::cleanupObservers ( )
private

cleans up observers.

References ObservedObject, and ObserverIds.

◆ endSelection

void SPV3D_CADSelection::endSelection ( )
privateslot

finishes the selection.

Doesn't cause the selection, just returns the render view to previous interaction mode.

References cleanupObservers(), CurrentRepresentation, PreviousRenderViewMode, and View.

◆ fastSelection()

void SPV3D_CADSelection::fastSelection ( bool  presel = false)
private

◆ getSelectionModifier()

int SPV3D_CADSelection::getSelectionModifier ( )
private

References View.

◆ onLeftButtonRelease()

void SPV3D_CADSelection::onLeftButtonRelease ( )
private

callback called for click events when in 'interactive selection' modes.

References fastSelection().

◆ onMouseMove()

void SPV3D_CADSelection::onMouseMove ( )
private

callback called for mouse move events when in 'interactive selection' modes.

References DisablePreSelection, fastSelection(), SPV3D_Prs::FromVtkIdToEntry(), and Representation.

◆ onRightButtonPress

void SPV3D_CADSelection::onRightButtonPress ( )
privateslot

Disable preselection during rotation using the right button.

References DisablePreSelection.

◆ onRightButtonRelease

void SPV3D_CADSelection::onRightButtonRelease ( )
privateslot

References DisablePreSelection.

◆ Q_DISABLE_COPY()

SPV3D_CADSelection::Q_DISABLE_COPY ( SPV3D_CADSelection  )
private

◆ selectionChanged()

void SPV3D_CADSelection::selectionChanged ( vtkObject ,
unsigned long  ,
void *  calldata 
)
private

callback called when the vtkPVRenderView is done with selection.

References endSelection(), getSelectionModifier(), and View.

◆ SetMode()

void SPV3D_CADSelection::SetMode ( const SPV3D_CADSelection::SelectionMode  mode)

Set the selectionMode.

References Mode.

◆ setRepresentation

void SPV3D_CADSelection::setRepresentation ( pqDataRepresentation *  representation)
privateslot

Called when the active representation changes.

References endSelection(), Representation, RepresentationConnection, and updateEnableState().

◆ setView

void SPV3D_CADSelection::setView ( pqView *  view)
privateslot

Called when this object was created with nullptr as the view and the active view changes.

References endSelection(), and View.

◆ updateEnableState

void SPV3D_CADSelection::updateEnableState ( )
privateslot

Member Data Documentation

◆ CurrentRepresentation

vtkSMRepresentationProxy* SPV3D_CADSelection::CurrentRepresentation = nullptr
private

◆ DisablePreSelection

bool SPV3D_CADSelection::DisablePreSelection = false
private

◆ Mode

SelectionMode SPV3D_CADSelection::Mode
private

◆ MousePosition

int SPV3D_CADSelection::MousePosition[2]
private

◆ ObservedObject

vtkWeakPointer<vtkObject> SPV3D_CADSelection::ObservedObject
private

◆ ObserverIds

unsigned long SPV3D_CADSelection::ObserverIds[4]
private

◆ PreviousRenderViewMode

int SPV3D_CADSelection::PreviousRenderViewMode
private

◆ Representation

QPointer<pqDataRepresentation> SPV3D_CADSelection::Representation
private

◆ RepresentationConnection

QMetaObject::Connection SPV3D_CADSelection::RepresentationConnection
private

◆ selectionComboBox

QComboBox* SPV3D_CADSelection::selectionComboBox
private

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