File: vtkKWInteractorStyle2DView.h

package info (click to toggle)
volview 3.4-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 25,204 kB
  • sloc: cpp: 132,585; ansic: 11,612; tcl: 236; sh: 64; makefile: 25; xml: 8
file content (103 lines) | stat: -rw-r--r-- 3,382 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*=========================================================================

  Copyright (c) Kitware, Inc.
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/VolViewCopyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
// .NAME vtkKWInteractorStyle2DView - Interactor Style specific for 2D View
// .SECTION Description
// The strings for events are hardcoded, be extremely carefull when copy/pasting
// events

#ifndef __vtkKWInteractorStyle2DView_h
#define __vtkKWInteractorStyle2DView_h

#include "vtkKWInteractorStyleView.h"

class vtkKW2DRenderWidget;
class vtkKWImageMapToWindowLevelColors;
class vtkLineSource;

class VTK_EXPORT vtkKWInteractorStyle2DView : public vtkKWInteractorStyleView
{
public:
  static vtkKWInteractorStyle2DView *New();
  vtkTypeRevisionMacro(vtkKWInteractorStyle2DView, vtkKWInteractorStyleView);
  void PrintSelf(ostream& os, vtkIndent indent);
  
  // Description:
  // Actions to perform when an event happens
  virtual void StartWindowLevel() {};
  virtual void WindowLevel() {};
  virtual void StopWindowLevel() {};
  virtual void StartPan() {};
  virtual void Pan();
  virtual void StopPan() {};
  virtual void StartZoom() {};
  virtual void Zoom();
  virtual void StopZoom() {};
  virtual void Reset();
  virtual void DecrementSlice();
  virtual void IncrementSlice();
  virtual void DecrementPage();
  virtual void IncrementPage();
  virtual void GoToFirstSlice();
  virtual void GoToLastSlice();

  virtual void SetWindowLevel(double window, double level);
  virtual void Zoom(double factor);
  virtual void SetCameraFocalPointAndPosition(
    double fpx, double fpy, double fpz, double px, double py, double pz);
  virtual void SetCameraFocalPointAndPosition(double a[6])
    { this->SetCameraFocalPointAndPosition(a[0],a[1],a[2],a[3],a[4],a[5]);};

  virtual void SetImageMapToRGBA(vtkKWImageMapToWindowLevelColors *map);
  vtkGetObjectMacro(ImageMapToRGBA, vtkKWImageMapToWindowLevelColors);

  // Description:
  // Event bindings controlling the effects of pressing mouse buttons,
  // moving the mouse, or pressing keys.
  virtual void OnMouseMove();

  // Description:
  // Probe
  virtual void Probe();

  // Description:
  // Mouse wheel is translated into slice navigation
  virtual void OnMouseWheelForward();
  virtual void OnMouseWheelBackward();

protected:
  vtkKWInteractorStyle2DView();
  ~vtkKWInteractorStyle2DView();

  int   InCallback;
  
  vtkKWImageMapToWindowLevelColors *ImageMapToRGBA;

  virtual int StartAction(const char* action);
  virtual int PerformAction(const char* action);
  virtual int StopAction(const char* action);

  // Description:
  // Proxy used to get some vars that are either in the widget
  virtual vtkKW2DRenderWidget* Get2DRenderWidget();
  virtual int GetSliceOrientation();
  virtual char* GetDistanceUnits();

  virtual void InvokeSliceChangedEvent();

  void FormatProbeDisplay(char *display, double location[3], double *values);

private:
  vtkKWInteractorStyle2DView(const vtkKWInteractorStyle2DView&);  // Not implemented
  void operator=(const vtkKWInteractorStyle2DView&);  // Not implemented
};

#endif