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 =========================================================================*/
65 #ifndef vtkCoordinate_h
66 #define vtkCoordinate_h
67 
68 #include "vtkRenderingCoreModule.h" // For export macro
69 #include "vtkObject.h"
70 class vtkViewport;
71 
72 #define VTK_DISPLAY 0
73 #define VTK_NORMALIZED_DISPLAY 1
74 #define VTK_VIEWPORT 2
75 #define VTK_NORMALIZED_VIEWPORT 3
76 #define VTK_VIEW 4
77 #define VTK_POSE 5
78 #define VTK_WORLD 6
79 #define VTK_USERDEFINED 7
80 
81 class VTKRENDERINGCORE_EXPORT vtkCoordinate : public vtkObject
82 {
83 public:
84  vtkTypeMacro(vtkCoordinate, vtkObject);
85  void PrintSelf(ostream& os, vtkIndent indent) override;
86 
91  static vtkCoordinate* New();
92 
94 
99  vtkSetMacro(CoordinateSystem, int);
100  vtkGetMacro(CoordinateSystem, int);
102  { this->SetCoordinateSystem(VTK_DISPLAY); }
104  { this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY); }
106  { this->SetCoordinateSystem(VTK_VIEWPORT); }
108  { this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT); }
110  { this->SetCoordinateSystem(VTK_VIEW); }
112  { this->SetCoordinateSystem(VTK_POSE); }
114  { this->SetCoordinateSystem(VTK_WORLD); }
116 
117  const char *GetCoordinateSystemAsString ();
118 
120 
124  vtkSetVector3Macro(Value, double);
125  vtkGetVector3Macro(Value, double);
126  void SetValue(double a, double b)
127  { this->SetValue(a, b, 0.0); }
129 
131 
136  virtual void SetReferenceCoordinate(vtkCoordinate*);
137  vtkGetObjectMacro(ReferenceCoordinate, vtkCoordinate);
139 
141 
148  void SetViewport(vtkViewport *viewport);
149  vtkGetObjectMacro(Viewport, vtkViewport);
151 
153 
156  double *GetComputedWorldValue(vtkViewport *) VTK_SIZEHINT(3);
157  int *GetComputedViewportValue(vtkViewport *) VTK_SIZEHINT(2);
158  int *GetComputedDisplayValue(vtkViewport *) VTK_SIZEHINT(2);
159  int *GetComputedLocalDisplayValue(vtkViewport *) VTK_SIZEHINT(2);
161 
162  double *GetComputedDoubleViewportValue(vtkViewport *) VTK_SIZEHINT(2);
163  double *GetComputedDoubleDisplayValue(vtkViewport *) VTK_SIZEHINT(2);
164 
171  double *GetComputedValue(vtkViewport *) VTK_SIZEHINT(3);
172 
180  virtual double *GetComputedUserDefinedValue(vtkViewport *) VTK_SIZEHINT(3)
181  { return this->Value; }
182 
183 protected:
184  vtkCoordinate();
185  ~vtkCoordinate() override;
186 
187  double Value[3];
191  double ComputedWorldValue[3];
192  int ComputedDisplayValue[2];
193  int ComputedViewportValue[2];
195 
196  double ComputedDoubleDisplayValue[2];
197  double ComputedDoubleViewportValue[2];
198  double ComputedUserDefinedValue[3];
199 
200 private:
201  vtkCoordinate(const vtkCoordinate&) = delete;
202  void operator=(const vtkCoordinate&) = delete;
203 };
204 
205 #endif
void SetCoordinateSystemToWorld()
Set/get the coordinate system which this coordinate is defined in.
abstract base class for most VTK objects
Definition: vtkObject.h:59
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:47
void SetValue(double a, double b)
Set/get the value of this coordinate.
#define VTK_POSE
Definition: vtkCoordinate.h:77
#define VTK_NORMALIZED_VIEWPORT
Definition: vtkCoordinate.h:75
void SetCoordinateSystemToDisplay()
Set/get the coordinate system which this coordinate is defined in.
#define VTK_VIEW
Definition: vtkCoordinate.h:76
vtkCoordinate * ReferenceCoordinate
void SetCoordinateSystemToNormalizedDisplay()
Set/get the coordinate system which this coordinate is defined in.
void SetCoordinateSystemToPose()
Set/get the coordinate system which this coordinate is defined in.
a simple class to control print indentation
Definition: vtkIndent.h:39
#define VTK_VIEWPORT
Definition: vtkCoordinate.h:74
void SetCoordinateSystemToView()
Set/get the coordinate system which this coordinate is defined in.
#define VTK_NORMALIZED_DISPLAY
Definition: vtkCoordinate.h:73
#define VTK_SIZEHINT(...)
void SetCoordinateSystemToViewport()
Set/get the coordinate system which this coordinate is defined in.
vtkViewport * Viewport
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:81
#define VTK_WORLD
Definition: vtkCoordinate.h:78
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:72