Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
T.J. Corona
SMTK
Commits
de16a2ca
Commit
de16a2ca
authored
Aug 05, 2020
by
David Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make ParaView's "interaction mode" available to SMTK...
... when translating selections.
parent
77303ceb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
1 deletion
+51
-1
smtk/extension/paraview/appcomponents/plugin/vtkSMTKEncodeSelection.cxx
.../paraview/appcomponents/plugin/vtkSMTKEncodeSelection.cxx
+4
-1
smtk/extension/paraview/server/RespondToVTKSelection.cxx
smtk/extension/paraview/server/RespondToVTKSelection.cxx
+25
-0
smtk/extension/paraview/server/RespondToVTKSelection.h
smtk/extension/paraview/server/RespondToVTKSelection.h
+22
-0
No files found.
smtk/extension/paraview/appcomponents/plugin/vtkSMTKEncodeSelection.cxx
View file @
de16a2ca
...
...
@@ -31,6 +31,7 @@
#include "pqView.h"
#include "vtkSMPropertyHelper.h"
#include "vtkSMRenderViewProxy.h"
#include "vtkInformation.h"
#include "vtkMultiBlockDataSet.h"
...
...
@@ -163,7 +164,7 @@ void vtkSMTKEncodeSelection::ProcessRawSelection(
bool
vtkSMTKEncodeSelection
::
ProcessResource
(
pqSMTKWrapper
*
wrapper
,
const
smtk
::
resource
::
ResourcePtr
&
resource
,
const
smtk
::
view
::
SelectionPtr
&
smtkSelection
,
vtkSMTKResourceRepresentation
*
resourceRep
,
vtkSelection
*
rawSelection
,
vtkSMRenderViewProxy
*
v
tkNotUsed
(
viewProxy
)
/*unused*/
,
int
modifier
,
bool
selectBlocks
)
vtkSMRenderViewProxy
*
v
iewProxy
,
int
modifier
,
bool
selectBlocks
)
{
(
void
)
resource
;
(
void
)
rawSelection
;
...
...
@@ -187,6 +188,8 @@ bool vtkSMTKEncodeSelection::ProcessResource(pqSMTKWrapper* wrapper,
{
continue
;
}
int
mode
=
vtkSMPropertyHelper
(
viewProxy
,
"InteractionMode"
).
GetAsInt
();
operation
->
setInteractionMode
(
mode
);
operation
->
setSMTKSelection
(
smtkSelection
);
operation
->
setVTKSelection
(
rawSelection
);
operation
->
setVTKData
(
mbds
);
...
...
smtk/extension/paraview/server/RespondToVTKSelection.cxx
View file @
de16a2ca
...
...
@@ -20,6 +20,8 @@
#include "smtk/io/Logger.h"
#include "vtkPVRenderView.h"
#include "vtkCompositeDataIterator.h"
#include "vtkIdTypeArray.h"
#include "vtkInformation.h"
...
...
@@ -73,6 +75,29 @@ RespondToVTKSelection::~RespondToVTKSelection()
}
}
bool
RespondToVTKSelection
::
setInteractionMode
(
int
mode
)
{
if
(
mode
==
m_interactionMode
)
{
return
false
;
}
switch
(
mode
)
{
case
vtkPVRenderView
::
INTERACTION_MODE_UNINTIALIZED
:
// fall through
case
vtkPVRenderView
::
INTERACTION_MODE_3D
:
// fall through
case
vtkPVRenderView
::
INTERACTION_MODE_2D
:
// fall through
case
vtkPVRenderView
::
INTERACTION_MODE_SELECTION
:
// fall through
case
vtkPVRenderView
::
INTERACTION_MODE_ZOOM
:
// fall through
case
vtkPVRenderView
::
INTERACTION_MODE_POLYGON
:
// fall through
m_interactionMode
=
mode
;
return
true
;
default:
vtkGenericWarningMacro
(
"Unknown interaction mode ("
<<
mode
<<
") during selection."
);
break
;
}
return
false
;
}
bool
RespondToVTKSelection
::
setVTKData
(
vtkMultiBlockDataSet
*
mbds
)
{
if
(
m_vtkData
==
mbds
)
...
...
smtk/extension/paraview/server/RespondToVTKSelection.h
View file @
de16a2ca
...
...
@@ -45,6 +45,27 @@ public:
smtkSuperclassMacro
(
smtk
::
operation
::
XMLOperation
);
virtual
~
RespondToVTKSelection
();
/**\brief 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.
*/
bool
setInteractionMode
(
int
mode
);
int
interactionMode
()
const
{
return
m_interactionMode
;
}
/**\brief Set/get the multiblock data holding per-component tessellation info.
*
* This is set by the vtkSMTKWrapper before the operation is invoked.
...
...
@@ -127,6 +148,7 @@ protected:
/// Fail or succeed quietly.
void
generateSummary
(
Operation
::
Result
&
)
override
{};
int
m_interactionMode
;
::
vtkSelection
*
m_vtkSelection
;
vtkMultiBlockDataSet
*
m_vtkData
;
smtk
::
view
::
WeakSelectionPtr
m_smtkSelection
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment