ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
vtkCameraManipulator.cxx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkCameraManipulator.cxx
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 #include "vtkCameraManipulator.h"
16 
18 #include "vtkObjectFactory.h"
19 #include "vtkRenderWindowInteractor.h"
20 #include "vtkRenderer.h"
21 
24 
25 //-------------------------------------------------------------------------
27 {
28  this->Button = 1;
29  this->Shift = 0;
30  this->Control = 0;
31 
32  this->Center[0] = this->Center[1] = this->Center[2] = 0.0;
33  this->RotationFactor = 1.0;
34  this->DisplayCenter[0] = this->DisplayCenter[1] = 0.0;
35 
36  this->ManipulatorName = 0;
37  this->GUIHelper = 0;
38 }
39 
40 //-------------------------------------------------------------------------
42 {
43  this->SetManipulatorName(0);
44  this->SetGUIHelper(0);
45 }
46 
47 //-------------------------------------------------------------------------
49 {
50 }
51 
52 //-------------------------------------------------------------------------
54 {
55 }
56 
57 //-------------------------------------------------------------------------
58 void vtkCameraManipulator::OnButtonDown(int, int, vtkRenderer*, vtkRenderWindowInteractor*)
59 {
60 }
61 
62 //-------------------------------------------------------------------------
63 void vtkCameraManipulator::OnButtonUp(int, int, vtkRenderer*, vtkRenderWindowInteractor*)
64 {
65 }
66 
67 //-------------------------------------------------------------------------
68 void vtkCameraManipulator::OnMouseMove(int, int, vtkRenderer*, vtkRenderWindowInteractor*)
69 {
70 }
71 
72 //-------------------------------------------------------------------------
73 void vtkCameraManipulator::OnKeyUp(vtkRenderWindowInteractor*)
74 {
75 }
76 
77 //-------------------------------------------------------------------------
78 void vtkCameraManipulator::OnKeyDown(vtkRenderWindowInteractor*)
79 {
80 }
81 
82 //-------------------------------------------------------------------------
84 {
85  double* pt;
86 
87  // save the center of rotation in screen coordinates
88  ren->SetWorldPoint(this->Center[0], this->Center[1], this->Center[2], 1.0);
89  ren->WorldToDisplay();
90  pt = ren->GetDisplayPoint();
91  this->DisplayCenter[0] = pt[0];
92  this->DisplayCenter[1] = pt[1];
93 }
94 
95 //-------------------------------------------------------------------------
96 void vtkCameraManipulator::PrintSelf(ostream& os, vtkIndent indent)
97 {
98  this->Superclass::PrintSelf(os, indent);
99 
100  os << indent << "ManipulatorName: " << (this->ManipulatorName ? this->ManipulatorName : "none")
101  << endl;
102  os << indent << "Button: " << this->Button << endl;
103  os << indent << "Shift: " << this->Shift << endl;
104  os << indent << "Control: " << this->Control << endl;
105  os << indent << "Center: " << this->Center[0] << ", " << this->Center[1] << ", "
106  << this->Center[2] << endl;
107  os << indent << "RotationFactor: " << this->RotationFactor << endl;
108  os << indent << "GUIHelper: " << this->GUIHelper << endl;
109 }
virtual void OnButtonUp(int x, int y, vtkRenderer *ren, vtkRenderWindowInteractor *iren)
virtual void OnMouseMove(int x, int y, vtkRenderer *ren, vtkRenderWindowInteractor *iren)
virtual void OnButtonDown(int x, int y, vtkRenderer *ren, vtkRenderWindowInteractor *iren)
void SetGUIHelper(vtkCameraManipulatorGUIHelper *)
void ComputeDisplayCenter(vtkRenderer *ren)
virtual void OnKeyDown(vtkRenderWindowInteractor *iren)
vtkCameraManipulatorGUIHelper * GUIHelper
virtual void OnKeyUp(vtkRenderWindowInteractor *iren)
void PrintSelf(ostream &os, vtkIndent indent) override
QTextStream & endl(QTextStream &stream)
Definition: QtCompat.h:718
vtkCxxSetObjectMacro(vtkCameraManipulator, GUIHelper, vtkCameraManipulatorGUIHelper)
vtkStandardNewMacro(vtkCameraManipulator)