Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLLayerDMSelectionObserver.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 __vtkMRMLLayerDMSelectionObserver_h
22#define __vtkMRMLLayerDMSelectionObserver_h
23
24// LayerDM includes
25#include "vtkSlicerLayerDMModuleMRMLExport.h"
26
27// VTK includes
28#include <vtkObject.h>
29#include <vtkSmartPointer.h>
30#include <vtkWeakPointer.h>
31
33class vtkMRMLNode;
34class vtkMRMLScene;
38
43class VTK_SLICER_LAYERDM_MODULE_MRML_EXPORT vtkMRMLLayerDMSelectionObserver : public vtkObject
44{
45public:
47 vtkTypeMacro(vtkMRMLLayerDMSelectionObserver, vtkObject);
48 void PrintSelf(ostream& os, vtkIndent indent) override;
49
54 void SetScene(vtkMRMLScene* scene);
57
61
64
67
69 bool IsPlacing(vtkMRMLNode* node) const;
70
72 bool IsPlacing() const;
73
75 void StartPlace(vtkMRMLNode* node, bool isPersistent);
76
78 void StopPlace() const;
79
80 std::string GetActivePlaceNodeID() const;
81 void SetInteractionMode(int interactionMode) const;
83
86
87protected:
92
93private:
94 vtkSmartPointer<vtkMRMLLayerDMObjectEventObserver> Observer;
95 vtkWeakPointer<vtkMRMLScene> Scene;
96 vtkWeakPointer<vtkMRMLInteractionNode> InteractionNode;
97 vtkWeakPointer<vtkMRMLSelectionNode> SelectionNode;
98};
99
100#endif
VTK object observer with one callback endpoint when an event is triggered. Can observe multiple objec...
bool SetSelectionNode(vtkMRMLSelectionNode *selectionNode)
void PrintSelf(ostream &os, vtkIndent indent) override
void SetInteractionMode(int interactionMode) const
void StopPlace() const
Sets the interaction mode to view.
vtkMRMLSelectionNode * GetSelectionNode() const
void UpdateNodesFromApplicationLogic(vtkMRMLApplicationLogic *logic)
Updates selection and interaction nodes from the input application logic Doesn't store the applicatio...
bool SetInteractionNode(vtkMRMLInteractionNode *interactionNode)
void operator=(const vtkMRMLLayerDMSelectionObserver &)=delete
void StartPlace(vtkMRMLNode *node, bool isPersistent)
Starts placing the input node (selection to node ID + interaction in place mode)
vtkMRMLLayerDMSelectionObserver(const vtkMRMLLayerDMSelectionObserver &)=delete
bool IsPlacing(vtkMRMLNode *node) const
void UpdateNodesFromScene(vtkMRMLScene *scene)
vtkMRMLInteractionNode * GetInteractionNode() const
std::string GetActivePlaceNodeID() const
void SetScene(vtkMRMLScene *scene)
Updates selection and interaction nodes from the input scene Uses the singleton instances defined in ...
static vtkMRMLLayerDMSelectionObserver * New()
Abstract Superclass for all specific types of MRML nodes.
A set of MRML Nodes that supports serialization and undo/redo.
MRML node for storing information about the active nodes in the scene.