File: vtkParallelCoordinatesInteractorStyle.h

package info (click to toggle)
vtk9 9.5.2%2Bdfsg3-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 205,984 kB
  • sloc: cpp: 2,336,570; ansic: 327,116; python: 111,200; yacc: 4,104; java: 3,977; sh: 3,032; xml: 2,771; perl: 2,189; lex: 1,787; makefile: 181; javascript: 165; objc: 153; tcl: 59
file content (125 lines) | stat: -rw-r--r-- 3,795 bytes parent folder | download | duplicates (2)
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-FileCopyrightText: Copyright 2009 Sandia Corporation
// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
/**
 * @class   vtkParallelCoordinatesInteractorStyle
 * @brief   interactive manipulation of the camera specialized for parallel coordinates
 *
 * vtkParallelCoordinatesInteractorStyle allows the user to interactively manipulate
 * (rotate, pan, zoom etc.) the camera.
 * Several events are overloaded from its superclass
 * vtkInteractorStyleTrackballCamera, hence the mouse bindings are different.
 * (The bindings keep the camera's view plane normal perpendicular to the x-y plane.)
 * In summary, the mouse events are as follows:
 * + Left Mouse button triggers window level events
 * + CTRL Left Mouse spins the camera around its view plane normal
 * + SHIFT Left Mouse pans the camera
 * + CTRL SHIFT Left Mouse dollys (a positional zoom) the camera
 * + Middle mouse button pans the camera
 * + Right mouse button dollys the camera.
 * + SHIFT Right Mouse triggers pick events
 *
 * Note that the renderer's actors are not moved; instead the camera is moved.
 *
 * @sa
 * vtkInteractorStyle vtkInteractorStyleTrackballActor
 * vtkInteractorStyleJoystickCamera vtkInteractorStyleJoystickActor
 */

#ifndef vtkParallelCoordinatesInteractorStyle_h
#define vtkParallelCoordinatesInteractorStyle_h

#include "vtkInteractionStyleModule.h" // For export macro
#include "vtkInteractorStyleTrackballCamera.h"
#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO

VTK_ABI_NAMESPACE_BEGIN
class vtkViewport;

class VTKINTERACTIONSTYLE_EXPORT VTK_MARSHALAUTO vtkParallelCoordinatesInteractorStyle
  : public vtkInteractorStyleTrackballCamera
{
public:
  static vtkParallelCoordinatesInteractorStyle* New();
  vtkTypeMacro(vtkParallelCoordinatesInteractorStyle, vtkInteractorStyleTrackballCamera);
  void PrintSelf(ostream& os, vtkIndent indent) override;

  enum
  {
    INTERACT_HOVER = 0,
    INTERACT_INSPECT,
    INTERACT_ZOOM,
    INTERACT_PAN
  };

  ///@{
  /**
   * Get the cursor positions in pixel coords
   */
  vtkGetVector2Macro(CursorStartPosition, int);
  vtkGetVector2Macro(CursorCurrentPosition, int);
  vtkGetVector2Macro(CursorLastPosition, int);
  ///@}

  ///@{
  /**
   * Get the cursor positions in a given coordinate system
   */
  void GetCursorStartPosition(vtkViewport* viewport, double pos[2]);
  void GetCursorCurrentPosition(vtkViewport* viewport, double pos[2]);
  void GetCursorLastPosition(vtkViewport* viewport, double pos[2]);
  ///@}

  ///@{
  /**
   * Event bindings controlling the effects of pressing mouse buttons
   * or moving the mouse.
   */
  void OnMouseMove() override;
  void OnLeftButtonDown() override;
  void OnLeftButtonUp() override;
  void OnMiddleButtonDown() override;
  void OnMiddleButtonUp() override;
  void OnRightButtonDown() override;
  void OnRightButtonUp() override;
  void OnLeave() override;
  ///@}

  ///@{
  virtual void StartInspect(int x, int y);
  virtual void Inspect(int x, int y);
  virtual void EndInspect();
  ///@}

  ///@{
  void StartZoom() override;
  void Zoom() override;
  void EndZoom() override;
  ///@}

  ///@{
  void StartPan() override;
  void Pan() override;
  void EndPan() override;
  ///@}

  /**
   * Override the "fly-to" (f keypress) for images.
   */
  void OnChar() override;

protected:
  vtkParallelCoordinatesInteractorStyle();
  ~vtkParallelCoordinatesInteractorStyle() override;

  int CursorStartPosition[2];
  int CursorCurrentPosition[2];
  int CursorLastPosition[2];

private:
  vtkParallelCoordinatesInteractorStyle(const vtkParallelCoordinatesInteractorStyle&) = delete;
  void operator=(const vtkParallelCoordinatesInteractorStyle&) = delete;
};

VTK_ABI_NAMESPACE_END
#endif