Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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
40class VTK_MRML_DISPLAYABLEMANAGER_EXPORT vtkMRMLCameraWidget : public vtkMRMLAbstractWidget
41{
42public:
47
49
53 void PrintSelf(ostream& os, vtkIndent indent) override;
55
60
63
65 bool CanProcessInteractionEvent(vtkMRMLInteractionEventData* eventData, double& distance2) override;
66
69
71
74 void SetTiltLocked(bool lockState);
76
78 enum
79 {
83 };
84
86 enum
87 {
90
93
100
107
114
117 WidgetEventCameraWheelZoomIn, // same as WidgetEventCameraZoomIn but with using wheel scaling factor
119
121
125 WidgetEventCameraResetFieldOfView, // VTK's standard camera reset (centers and resets field of view)
126
129
135
137 WidgetEventSetCrosshairPositionBackground, //< set crosshair position without consuming the event (so that other widgets can process the event)
139 };
140
142 vtkGetMacro(MotionFactor, double);
143 vtkSetMacro(MotionFactor, double);
144
146 vtkGetMacro(MouseWheelMotionFactor, double);
147 vtkSetMacro(MouseWheelMotionFactor, double);
148
149protected:
152
156
163
169
171
173
174 bool Dolly(double factor);
175 vtkCamera* GetCamera();
176
178 void CameraModifyEnd(bool wasModified, bool updateClippingRange, bool updateLights);
179
181
185
186 vtkWeakPointer<vtkMRMLCameraNode> CameraNode;
187
190
194
195private:
197 void operator=(const vtkMRMLCameraWidget&) = delete;
198};
199
200#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.