VTK  9.7.1
vtkCoordinate.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
51 #ifndef vtkCoordinate_h
52 #define vtkCoordinate_h
53 
54 #include "vtkObject.h"
55 #include "vtkRenderingCoreModule.h" // For export macro
56 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
57 VTK_ABI_NAMESPACE_BEGIN
58 class vtkViewport;
59 
60 #define VTK_DISPLAY 0
61 #define VTK_NORMALIZED_DISPLAY 1
62 #define VTK_VIEWPORT 2
63 #define VTK_NORMALIZED_VIEWPORT 3
64 #define VTK_VIEW 4
65 #define VTK_POSE 5
66 #define VTK_WORLD 6
67 #define VTK_USERDEFINED 7
68 
69 class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkCoordinate : public vtkObject
70 {
71 public:
72  vtkTypeMacro(vtkCoordinate, vtkObject);
73  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
79  static vtkCoordinate* New();
80 
82 
87  vtkSetMacro(CoordinateSystem, int);
88  vtkGetMacro(CoordinateSystem, int);
89  void SetCoordinateSystemToDisplay() { this->SetCoordinateSystem(VTK_DISPLAY); }
91  {
92  this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY);
93  }
94  void SetCoordinateSystemToViewport() { this->SetCoordinateSystem(VTK_VIEWPORT); }
96  {
97  this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT);
98  }
99  void SetCoordinateSystemToView() { this->SetCoordinateSystem(VTK_VIEW); }
100  void SetCoordinateSystemToPose() { this->SetCoordinateSystem(VTK_POSE); }
101  void SetCoordinateSystemToWorld() { this->SetCoordinateSystem(VTK_WORLD); }
103 
104  const char* GetCoordinateSystemAsString();
105 
107 
111  vtkSetVector3Macro(Value, double);
112  vtkGetVector3Macro(Value, double);
113  void SetValue(double a, double b) { this->SetValue(a, b, 0.0); }
115 
117 
122  virtual void SetReferenceCoordinate(vtkCoordinate*);
123  vtkGetObjectMacro(ReferenceCoordinate, vtkCoordinate);
125 
127 
134  void SetViewport(vtkViewport* viewport);
135  vtkGetObjectMacro(Viewport, vtkViewport);
137 
139 
142  double* GetComputedWorldValue(vtkViewport*) VTK_SIZEHINT(3);
143  int* GetComputedViewportValue(vtkViewport*) VTK_SIZEHINT(2);
144  int* GetComputedDisplayValue(vtkViewport*) VTK_SIZEHINT(2);
145  int* GetComputedLocalDisplayValue(vtkViewport*) VTK_SIZEHINT(2);
147 
148  double* GetComputedDoubleViewportValue(vtkViewport*) VTK_SIZEHINT(2);
149  double* GetComputedDoubleDisplayValue(vtkViewport*) VTK_SIZEHINT(2);
150 
157  double* GetComputedValue(vtkViewport*) VTK_SIZEHINT(3);
158 
166  virtual double* GetComputedUserDefinedValue(vtkViewport*) VTK_SIZEHINT(3) { return this->Value; }
167 
168 protected:
169  vtkCoordinate();
170  ~vtkCoordinate() override;
171 
172  double Value[3];
176  double ComputedWorldValue[3];
177  int ComputedDisplayValue[2];
178  int ComputedViewportValue[2];
180 
181  double ComputedDoubleDisplayValue[2];
182  double ComputedDoubleViewportValue[2];
183  double ComputedUserDefinedValue[3];
184 
185 private:
186  vtkCoordinate(const vtkCoordinate&) = delete;
187  void operator=(const vtkCoordinate&) = delete;
188 };
189 
190 VTK_ABI_NAMESPACE_END
191 #endif
void SetCoordinateSystemToWorld()
Set/get the coordinate system which this coordinate is defined in.
abstract base class for most VTK objects
Definition: vtkObject.h:52
void SetCoordinateSystemToNormalizedViewport()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:95
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract specification for Viewports
Definition: vtkViewport.h:46
void SetValue(double a, double b)
Set/get the value of this coordinate.
#define VTK_POSE
Definition: vtkCoordinate.h:65
#define VTK_NORMALIZED_VIEWPORT
Definition: vtkCoordinate.h:63
void SetCoordinateSystemToDisplay()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:89
#define VTK_VIEW
Definition: vtkCoordinate.h:64
vtkCoordinate * ReferenceCoordinate
void SetCoordinateSystemToNormalizedDisplay()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:90
void SetCoordinateSystemToPose()
Set/get the coordinate system which this coordinate is defined in.
a simple class to control print indentation
Definition: vtkIndent.h:28
#define VTK_VIEWPORT
Definition: vtkCoordinate.h:62
void SetCoordinateSystemToView()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:99
#define VTK_NORMALIZED_DISPLAY
Definition: vtkCoordinate.h:61
#define VTK_SIZEHINT(...)
void SetCoordinateSystemToViewport()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:94
vtkViewport * Viewport
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:69
#define VTK_MARSHALAUTO
#define VTK_WORLD
Definition: vtkCoordinate.h:66
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
#define VTK_DISPLAY
Definition: vtkCoordinate.h:60