Slicer 5.13
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkMRMLLayerDMCameraSynchronizer.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 __vtkMRMLLayerDMCameraSynchronizer_h
22#define __vtkMRMLLayerDMCameraSynchronizer_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 <memory>
33
34class vtkCamera;
35class vtkRenderer;
37
45class VTK_SLICER_LAYERDM_MODULE_MRMLDISPLAYABLEMANAGER_EXPORT vtkMRMLLayerDMCameraSynchronizer : public vtkObject
46{
47public:
48 class CameraSynchronizeStrategy;
49
51 vtkTypeMacro(vtkMRMLLayerDMCameraSynchronizer, vtkObject);
52 void PrintSelf(ostream& os, vtkIndent indent) override;
53
56
58 void SetDefaultCamera(const vtkSmartPointer<vtkCamera>& camera);
59
62 void SetRenderer(vtkRenderer* renderer);
63
66 bool BlockModified(bool isBlocked);
67
68protected:
71
72private:
74 void UpdateStrategy();
75
76 vtkSmartPointer<vtkCamera> DefaultCamera;
77 vtkWeakPointer<vtkRenderer> Renderer;
78 vtkWeakPointer<vtkMRMLAbstractViewNode> ViewNode;
79 std::unique_ptr<CameraSynchronizeStrategy> SynchronizeStrategy;
80 bool IsBlocked{ false };
81};
82
83#endif
Abstract MRML node to represent a view. The class holds the properties common to any view type (3D,...
void SetRenderer(vtkRenderer *renderer)
static vtkMRMLLayerDMCameraSynchronizer * New()
void SetDefaultCamera(const vtkSmartPointer< vtkCamera > &camera)
Set the default camera which will be synchronized by this class.
void PrintSelf(ostream &os, vtkIndent indent) override
bool BlockModified(bool isBlocked)
void SetViewNode(vtkMRMLAbstractViewNode *viewNode)
Set the view node for which the camera will be synchronized.