VTK  9.0.0
vtkCoordinate.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkCoordinate.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
60 #ifndef vtkCoordinate_h
61 #define vtkCoordinate_h
62 
63 #include "vtkObject.h"
64 #include "vtkRenderingCoreModule.h" // For export macro
65 class vtkViewport;
66 
67 #define VTK_DISPLAY 0
68 #define VTK_NORMALIZED_DISPLAY 1
69 #define VTK_VIEWPORT 2
70 #define VTK_NORMALIZED_VIEWPORT 3
71 #define VTK_VIEW 4
72 #define VTK_POSE 5
73 #define VTK_WORLD 6
74 #define VTK_USERDEFINED 7
75 
76 class VTKRENDERINGCORE_EXPORT vtkCoordinate : public vtkObject
77 {
78 public:
79  vtkTypeMacro(vtkCoordinate, vtkObject);
80  void PrintSelf(ostream& os, vtkIndent indent) override;
81 
86  static vtkCoordinate* New();
87 
89 
94  vtkSetMacro(CoordinateSystem, int);
95  vtkGetMacro(CoordinateSystem, int);
96  void SetCoordinateSystemToDisplay() { this->SetCoordinateSystem(VTK_DISPLAY); }
98  {
99  this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY);
100  }
101  void SetCoordinateSystemToViewport() { this->SetCoordinateSystem(VTK_VIEWPORT); }
103  {
104  this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT);
105  }
106  void SetCoordinateSystemToView() { this->SetCoordinateSystem(VTK_VIEW); }
107  void SetCoordinateSystemToPose() { this->SetCoordinateSystem(VTK_POSE); }
108  void SetCoordinateSystemToWorld() { this->SetCoordinateSystem(VTK_WORLD); }
110 
111  const char* GetCoordinateSystemAsString();
112 
114 
118  vtkSetVector3Macro(Value, double);
119  vtkGetVector3Macro(Value, double);
120  void SetValue(double a, double b) { this->SetValue(a, b, 0.0); }
122 
124 
129  virtual void SetReferenceCoordinate(vtkCoordinate*);
130  vtkGetObjectMacro(ReferenceCoordinate, vtkCoordinate);
132 
134 
141  void SetViewport(vtkViewport* viewport);
142  vtkGetObjectMacro(Viewport, vtkViewport);
144 
146 
149  double* GetComputedWorldValue(vtkViewport*) VTK_SIZEHINT(3);
150  int* GetComputedViewportValue(vtkViewport*) VTK_SIZEHINT(2);
151  int* GetComputedDisplayValue(vtkViewport*) VTK_SIZEHINT(2);
152  int* GetComputedLocalDisplayValue(vtkViewport*) VTK_SIZEHINT(2);
154 
155  double* GetComputedDoubleViewportValue(vtkViewport*) VTK_SIZEHINT(2);
156  double* GetComputedDoubleDisplayValue(vtkViewport*) VTK_SIZEHINT(2);
157 
164  double* GetComputedValue(vtkViewport*) VTK_SIZEHINT(3);
165 
173  virtual double* GetComputedUserDefinedValue(vtkViewport*) VTK_SIZEHINT(3) { return this->Value; }
174 
175 protected:
176  vtkCoordinate();
177  ~vtkCoordinate() override;
178 
179  double Value[3];
183  double ComputedWorldValue[3];
184  int ComputedDisplayValue[2];
185  int ComputedViewportValue[2];
187 
188  double ComputedDoubleDisplayValue[2];
189  double ComputedDoubleViewportValue[2];
190  double ComputedUserDefinedValue[3];
191 
192 private:
193  vtkCoordinate(const vtkCoordinate&) = delete;
194  void operator=(const vtkCoordinate&) = delete;
195 };
196 
197 #endif
vtkCoordinate::SetValue
void SetValue(double a, double b)
Definition: vtkCoordinate.h:120
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
VTK_NORMALIZED_VIEWPORT
#define VTK_NORMALIZED_VIEWPORT
Definition: vtkCoordinate.h:70
vtkCoordinate::SetCoordinateSystemToNormalizedViewport
void SetCoordinateSystemToNormalizedViewport()
Definition: vtkCoordinate.h:102
vtkCoordinate::SetCoordinateSystemToDisplay
void SetCoordinateSystemToDisplay()
Definition: vtkCoordinate.h:96
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
VTK_POSE
#define VTK_POSE
Definition: vtkCoordinate.h:72
vtkCoordinate::ReferenceCoordinate
vtkCoordinate * ReferenceCoordinate
Definition: vtkCoordinate.h:181
VTK_VIEW
#define VTK_VIEW
Definition: vtkCoordinate.h:71
vtkCoordinate::SetCoordinateSystemToWorld
void SetCoordinateSystemToWorld()
Definition: vtkCoordinate.h:108
vtkCoordinate::CoordinateSystem
int CoordinateSystem
Definition: vtkCoordinate.h:180
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
VTK_VIEWPORT
#define VTK_VIEWPORT
Definition: vtkCoordinate.h:69
vtkCoordinate::Computing
int Computing
Definition: vtkCoordinate.h:186
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
VTK_NORMALIZED_DISPLAY
#define VTK_NORMALIZED_DISPLAY
Definition: vtkCoordinate.h:68
vtkCoordinate::SetCoordinateSystemToViewport
void SetCoordinateSystemToViewport()
Definition: vtkCoordinate.h:101
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:76
vtkCoordinate::GetComputedUserDefinedValue
virtual double * GetComputedUserDefinedValue(vtkViewport *)
GetComputedUserDefinedValue() is to be used only when the coordinate system is VTK_USERDEFINED.
Definition: vtkCoordinate.h:173
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkObject.h
vtkCoordinate::SetCoordinateSystemToNormalizedDisplay
void SetCoordinateSystemToNormalizedDisplay()
Definition: vtkCoordinate.h:97
VTK_WORLD
#define VTK_WORLD
Definition: vtkCoordinate.h:73
vtkCoordinate::SetCoordinateSystemToView
void SetCoordinateSystemToView()
Definition: vtkCoordinate.h:106
vtkCoordinate::SetCoordinateSystemToPose
void SetCoordinateSystemToPose()
Definition: vtkCoordinate.h:107
vtkCoordinate::Viewport
vtkViewport * Viewport
Definition: vtkCoordinate.h:182
VTK_DISPLAY
#define VTK_DISPLAY
Definition: vtkCoordinate.h:67