Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkMRMLCameraWidget.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Program: 3D Slicer
4
5 Copyright (c) Kitware Inc.
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==============================================================================*/
17
29
30#ifndef vtkMRMLCameraWidget_h
31#define vtkMRMLCameraWidget_h
32
33#include "vtkMRMLDisplayableManagerExport.h" // For export macro
35#include "vtkMRMLCameraNode.h"
36
37class vtkSliceIntersectionRepresentation2D;
39
40
41class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLCameraWidget : public vtkMRMLAbstractWidget
42{
43public:
48
50
54 void PrintSelf(ostream& os, vtkIndent indent) override;
56
61
64
66 bool CanProcessInteractionEvent(vtkMRMLInteractionEventData* eventData, double &distance2) override;
67
70
72
75 void SetTiltLocked(bool lockState);
77
79 enum
80 {
84 };
85
87 enum
88 {
91
94
101
108
115
118 WidgetEventCameraWheelZoomIn, // same as WidgetEventCameraZoomIn but with using wheel scaling factor
120
122
126 WidgetEventCameraResetFieldOfView, // VTK's standard camera reset (centers and resets field of view)
127
130
136
138 WidgetEventSetCrosshairPositionBackground, //< set crosshair position without consuming the event (so that other widgets can process the event)
140 };
141
143 vtkGetMacro(MotionFactor, double);
144 vtkSetMacro(MotionFactor, double);
145
147 vtkGetMacro(MouseWheelMotionFactor, double);
148 vtkSetMacro(MouseWheelMotionFactor, double);
149
150protected:
153
157
164
170
172
174
175 bool Dolly(double factor);
176 vtkCamera* GetCamera();
177
179 void CameraModifyEnd(bool wasModified, bool updateClippingRange, bool updateLights);
180
182
186
187 vtkWeakPointer<vtkMRMLCameraNode> CameraNode;
188
191
195
196
197private:
199 void operator=(const vtkMRMLCameraWidget&) = delete;
200};
201
202#endif
@ WidgetStateUser
this is a starting index that can be used for widget-specific states
@ WidgetEventUser
this is a starting index that can be used for widget-specific events
MRML node to represent camera node.
bool ProcessEndMouseDrag(vtkMRMLInteractionEventData *eventData)
void SetTiltLocked(bool lockState)
bool ProcessInteractionEvent(vtkMRMLInteractionEventData *eventData) override
Process interaction event.
bool ProcessSetCrosshairBackground(vtkMRMLInteractionEventData *eventData)
bool ProcessTouchGestureStart(vtkMRMLInteractionEventData *eventData)
vtkMRMLCameraNode * GetCameraNode()
void PrintSelf(ostream &os, vtkIndent indent) override
void CameraModifyEnd(bool wasModified, bool updateClippingRange, bool updateLights)
bool ProcessMaximizeView(vtkMRMLInteractionEventData *eventData)
bool ProcessTouchCameraZoom(vtkMRMLInteractionEventData *eventData)
bool ProcessTranslate(vtkMRMLInteractionEventData *eventData)
bool ProcessSpin(vtkMRMLInteractionEventData *eventData)
bool CanProcessInteractionEvent(vtkMRMLInteractionEventData *eventData, double &distance2) override
Return true if the widget can process the event.
bool ProcessTouchCameraTranslate(vtkMRMLInteractionEventData *eventData)
bool ProcessTouchCameraSpin(vtkMRMLInteractionEventData *eventData)
bool ProcessSetCrosshair(vtkMRMLInteractionEventData *eventData)
~vtkMRMLCameraWidget() override
bool ProcessScale(vtkMRMLInteractionEventData *eventData)
bool ProcessTouchGestureEnd(vtkMRMLInteractionEventData *eventData)
bool ProcessStartMouseDrag(vtkMRMLInteractionEventData *eventData)
bool ProcessWidgetMenu(vtkMRMLInteractionEventData *eventData)
vtkCamera * GetCamera()
static vtkMRMLCameraWidget * New()
@ WidgetStateMoveCrosshair
Move crosshair position, can be used for moving the crosshair with click-and-drag.
bool Dolly(double factor)
void CreateDefaultRepresentation()
bool ProcessMouseMove(vtkMRMLInteractionEventData *eventData)
vtkWeakPointer< vtkMRMLCameraNode > CameraNode
void SetCameraNode(vtkMRMLCameraNode *cameraNode)
bool ProcessRotate(vtkMRMLInteractionEventData *eventData)
MRML node for representing segmentation display attributes.