Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLLayerDisplayableManager.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 __vtkMRMLLayerDisplayableManager_h
22#define __vtkMRMLLayerDisplayableManager_h
23
24#include "vtkSlicerLayerDMModuleMRMLDisplayableManagerExport.h"
25
26// Slicer includes
28
29// VTK includes
30#include <vtkSmartPointer.h>
31
32class vtkImageData;
36class vtkRenderWindow;
37
44class VTK_SLICER_LAYERDM_MODULE_MRMLDISPLAYABLEMANAGER_EXPORT vtkMRMLLayerDisplayableManager : public vtkMRMLAbstractDisplayableManager
45{
46public:
49 void PrintSelf(ostream& os, vtkIndent indent) override;
50
51 bool CanProcessInteractionEvent(vtkMRMLInteractionEventData* eventData, double& distance2) override;
53
56
59
62
69 vtkSmartPointer<vtkMRMLLayerDMPipeline> GetNodePipeline(vtkMRMLNode* node) const;
70
77 static vtkSmartPointer<vtkImageData> RenderWindowBufferToImage(vtkRenderWindow* window);
78 static void RenderWindowBufferToImage(vtkRenderWindow* window, const vtkSmartPointer<vtkImageData>& imageData);
80
81protected:
83 ~vtkMRMLLayerDisplayableManager() override = default;
86
87 void Create() override;
88 void SetRenderer(vtkRenderer* newRenderer) override;
89
90 void OnMRMLDisplayableNodeModifiedEvent(vtkObject* caller) override;
93 void OnMRMLSceneNodeAdded(vtkMRMLNode* node) override;
94 void OnMRMLSceneNodeRemoved(vtkMRMLNode* node) override;
95 void UnobserveMRMLScene() override;
96 void UpdateFromMRML() override;
97
98 int GetMouseCursor() override;
99 void SetHasFocus(bool hasFocus, vtkMRMLInteractionEventData* eventData) override;
100
101private:
102 vtkSmartPointer<vtkMRMLLayerDMPipelineManager> PipelineManager;
103};
104
105#endif
Factory where displayable manager classes are registered.
Class responsible for handling adding / updating / removing pipelines depending on nodes added / remo...
Interface for the layered displayable manager pipelines.
void PrintSelf(ostream &os, vtkIndent indent) override
~vtkMRMLLayerDisplayableManager() override=default
static void RegisterInDefaultViews()
Register the DM in the 2D and 3D view factories.
bool CanProcessInteractionEvent(vtkMRMLInteractionEventData *eventData, double &distance2) override
static void RenderWindowBufferToImage(vtkRenderWindow *window, const vtkSmartPointer< vtkImageData > &imageData)
void SetHasFocus(bool hasFocus, vtkMRMLInteractionEventData *eventData) override
Set if the widget gets/loses focus (interaction events are processed by this displayable manager).
vtkSmartPointer< vtkMRMLLayerDMPipeline > GetNodePipeline(vtkMRMLNode *node) const
vtkMRMLLayerDisplayableManager(const vtkMRMLLayerDisplayableManager &)=delete
void OnMRMLSceneNodeAdded(vtkMRMLNode *node) override
int GetMouseCursor() override
Displayable manager returns ID of the mouse cursor shape that should be displayed.
bool ProcessInteractionEvent(vtkMRMLInteractionEventData *eventData) override
void OnMRMLSceneStartBatchProcess() override
static vtkMRMLLayerDisplayableManager * New()
void SetRenderer(vtkRenderer *newRenderer) override
void operator=(const vtkMRMLLayerDisplayableManager &)=delete
static vtkSmartPointer< vtkImageData > RenderWindowBufferToImage(vtkRenderWindow *window)
void OnMRMLSceneEndBatchProcess() override
static bool IsRegisteredInFactory(vtkMRMLDisplayableManagerFactory *factory)
true if the input factory is defined and displayable manager is present in the input factory
void UnobserveMRMLScene() override
void OnMRMLSceneNodeRemoved(vtkMRMLNode *node) override
void OnMRMLDisplayableNodeModifiedEvent(vtkObject *caller) override
static void RegisterInFactory(vtkMRMLDisplayableManagerFactory *factory)
Register the Displayable Manager in the given input factory if it's not already registered.
Abstract Superclass for all specific types of MRML nodes.