VTK
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 =========================================================================*/
59 #ifndef vtkCoordinate_h
60 #define vtkCoordinate_h
61 
62 #include "vtkRenderingCoreModule.h" // For export macro
63 #include "vtkObject.h"
64 class vtkViewport;
65 
66 #define VTK_DISPLAY 0
67 #define VTK_NORMALIZED_DISPLAY 1
68 #define VTK_VIEWPORT 2
69 #define VTK_NORMALIZED_VIEWPORT 3
70 #define VTK_VIEW 4
71 #define VTK_POSE 5
72 #define VTK_WORLD 6
73 #define VTK_USERDEFINED 7
74 
75 class VTKRENDERINGCORE_EXPORT vtkCoordinate : public vtkObject
76 {
77 public:
78  vtkTypeMacro(vtkCoordinate, vtkObject);
79  void PrintSelf(ostream& os, vtkIndent indent) override;
80 
85  static vtkCoordinate* New();
86 
88 
93  vtkSetMacro(CoordinateSystem, int);
94  vtkGetMacro(CoordinateSystem, int);
96  { this->SetCoordinateSystem(VTK_DISPLAY); }
98  { this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY); }
100  { this->SetCoordinateSystem(VTK_VIEWPORT); }
102  { this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT); }
104  { this->SetCoordinateSystem(VTK_VIEW); }
106  { this->SetCoordinateSystem(VTK_POSE); }
108  { 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)
121  { this->SetValue(a, b, 0.0); }
123 
125 
130  virtual void SetReferenceCoordinate(vtkCoordinate*);
131  vtkGetObjectMacro(ReferenceCoordinate, vtkCoordinate);
133 
135 
142  void SetViewport(vtkViewport *viewport);
143  vtkGetObjectMacro(Viewport, vtkViewport);
145 
147 
150  double *GetComputedWorldValue(vtkViewport *) VTK_SIZEHINT(3);
151  int *GetComputedViewportValue(vtkViewport *) VTK_SIZEHINT(2);
152  int *GetComputedDisplayValue(vtkViewport *) VTK_SIZEHINT(2);
153  int *GetComputedLocalDisplayValue(vtkViewport *) VTK_SIZEHINT(2);
155 
156  double *GetComputedDoubleViewportValue(vtkViewport *) VTK_SIZEHINT(2);
157  double *GetComputedDoubleDisplayValue(vtkViewport *) VTK_SIZEHINT(2);
158 
165  double *GetComputedValue(vtkViewport *) VTK_SIZEHINT(3);
166 
175  { return this->Value; }
176 
177 protected:
178  vtkCoordinate();
179  ~vtkCoordinate() override;
180 
181  double Value[3];
185  double ComputedWorldValue[3];
186  int ComputedDisplayValue[2];
187  int ComputedViewportValue[2];
189 
190  double ComputedDoubleDisplayValue[2];
191  double ComputedDoubleViewportValue[2];
192  double ComputedUserDefinedValue[3];
193 
194 private:
195  vtkCoordinate(const vtkCoordinate&) = delete;
196  void operator=(const vtkCoordinate&) = delete;
197 };
198 
199 #endif
void SetCoordinateSystemToWorld()
Set/get the coordinate system which this coordinate is defined in.
abstract base class for most VTK objects
Definition: vtkObject.h:53
void SetCoordinateSystemToNormalizedViewport()
Set/get the coordinate system which this coordinate is defined in.
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:44
void SetValue(double a, double b)
Set/get the value of this coordinate.
#define VTK_POSE
Definition: vtkCoordinate.h:71
#define VTK_NORMALIZED_VIEWPORT
Definition: vtkCoordinate.h:69
void SetCoordinateSystemToDisplay()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:95
#define VTK_VIEW
Definition: vtkCoordinate.h:70
vtkCoordinate * ReferenceCoordinate
void SetCoordinateSystemToNormalizedDisplay()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:97
void SetCoordinateSystemToPose()
Set/get the coordinate system which this coordinate is defined in.
a simple class to control print indentation
Definition: vtkIndent.h:33
#define VTK_VIEWPORT
Definition: vtkCoordinate.h:68
void SetCoordinateSystemToView()
Set/get the coordinate system which this coordinate is defined in.
#define VTK_NORMALIZED_DISPLAY
Definition: vtkCoordinate.h:67
#define VTK_SIZEHINT(...)
void SetCoordinateSystemToViewport()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:99
vtkViewport * Viewport
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:75
#define VTK_WORLD
Definition: vtkCoordinate.h:72
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
virtual double * GetComputedUserDefinedValue(vtkViewport *)
GetComputedUserDefinedValue() is to be used only when the coordinate system is VTK_USERDEFINED.
#define VTK_DISPLAY
Definition: vtkCoordinate.h:66