Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLLayerDMInteractionLogic.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Kitware SAS
6
7 See COPYRIGHT.txt
8 or http://www.slicer.org/copyright/copyright.txt for details.
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15
16 This file was originally developed by Thibault Pelletier, Kitware SAS,
17 and was partially funded by ANR grants ANR-22-CE45-0034 and ANR-18-RHUS-005.
18
19==============================================================================*/
20
21#ifndef __vtkMRMLLayerDMInteractionLogic_h
22#define __vtkMRMLLayerDMInteractionLogic_h
23
24#include "vtkSlicerLayerDMModuleMRMLDisplayableManagerExport.h"
25
26// VTK includes
27#include <vtkObject.h>
28#include <vtkSmartPointer.h>
29#include <vtkWeakPointer.h>
30
31// STL includes
32#include <vector>
33
37
47class VTK_SLICER_LAYERDM_MODULE_MRMLDISPLAYABLEMANAGER_EXPORT vtkMRMLLayerDMInteractionLogic : public vtkObject
48{
49public:
51 vtkTypeMacro(vtkMRMLLayerDMInteractionLogic, vtkObject);
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
54 void AddPipeline(const vtkSmartPointer<vtkMRMLLayerDMPipeline>& pipeline);
55 bool CanProcessInteractionEvent(vtkMRMLInteractionEventData* eventData, double& distance2);
56 std::vector<vtkSmartPointer<vtkMRMLLayerDMPipeline>> GetCanProcessPipelines() const;
59 void LoseFocus();
61 void RemovePipeline(const vtkSmartPointer<vtkMRMLLayerDMPipeline>& pipeline);
63
64protected:
66 ~vtkMRMLLayerDMInteractionLogic() override = default;
67
68private:
69 static int MinWidgetState();
70 std::tuple<double, int> PrioritizeCanProcessPipelines(vtkMRMLInteractionEventData* eventData);
71 void LosePreviousFocusInCannotProcess(vtkMRMLInteractionEventData* eventData);
72
73 std::vector<vtkSmartPointer<vtkMRMLLayerDMPipeline>> Pipelines;
74 vtkSmartPointer<vtkMRMLLayerDMPipeline> LastFocusedPipeline;
75 std::vector<vtkSmartPointer<vtkMRMLLayerDMPipeline>> CanProcessPipelines;
76 vtkWeakPointer<vtkMRMLAbstractViewNode> ViewNode;
77};
78
79#endif
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D,...
void LoseFocus(vtkMRMLInteractionEventData *eventData)
void SetViewNode(vtkMRMLAbstractViewNode *viewNode)
void RemovePipeline(const vtkSmartPointer< vtkMRMLLayerDMPipeline > &pipeline)
void AddPipeline(const vtkSmartPointer< vtkMRMLLayerDMPipeline > &pipeline)
vtkMRMLLayerDMPipeline * GetLastFocusedPipeline() const
void PrintSelf(ostream &os, vtkIndent indent) override
bool ProcessInteractionEvent(vtkMRMLInteractionEventData *eventData)
bool CanProcessInteractionEvent(vtkMRMLInteractionEventData *eventData, double &distance2)
static vtkMRMLLayerDMInteractionLogic * New()
std::vector< vtkSmartPointer< vtkMRMLLayerDMPipeline > > GetCanProcessPipelines() const
~vtkMRMLLayerDMInteractionLogic() override=default
Interface for the layered displayable manager pipelines.