VTK  9.1.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=========================================================================*/
69#ifndef vtkCoordinate_h
70#define vtkCoordinate_h
71
72#include "vtkObject.h"
73#include "vtkRenderingCoreModule.h" // For export macro
74class vtkViewport;
75
76#define VTK_DISPLAY 0
77#define VTK_NORMALIZED_DISPLAY 1
78#define VTK_VIEWPORT 2
79#define VTK_NORMALIZED_VIEWPORT 3
80#define VTK_VIEW 4
81#define VTK_POSE 5
82#define VTK_WORLD 6
83#define VTK_USERDEFINED 7
84
85class VTKRENDERINGCORE_EXPORT vtkCoordinate : public vtkObject
86{
87public:
88 vtkTypeMacro(vtkCoordinate, vtkObject);
89 void PrintSelf(ostream& os, vtkIndent indent) override;
90
95 static vtkCoordinate* New();
96
98
103 vtkSetMacro(CoordinateSystem, int);
104 vtkGetMacro(CoordinateSystem, int);
105 void SetCoordinateSystemToDisplay() { this->SetCoordinateSystem(VTK_DISPLAY); }
107 {
108 this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY);
109 }
110 void SetCoordinateSystemToViewport() { this->SetCoordinateSystem(VTK_VIEWPORT); }
112 {
113 this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT);
114 }
115 void SetCoordinateSystemToView() { this->SetCoordinateSystem(VTK_VIEW); }
116 void SetCoordinateSystemToPose() { this->SetCoordinateSystem(VTK_POSE); }
117 void SetCoordinateSystemToWorld() { this->SetCoordinateSystem(VTK_WORLD); }
119
121
123
127 vtkSetVector3Macro(Value, double);
128 vtkGetVector3Macro(Value, double);
129 void SetValue(double a, double b) { this->SetValue(a, b, 0.0); }
131
133
139 vtkGetObjectMacro(ReferenceCoordinate, vtkCoordinate);
141
143
150 void SetViewport(vtkViewport* viewport);
151 vtkGetObjectMacro(Viewport, vtkViewport);
153
155
163
166
174
182 virtual double* GetComputedUserDefinedValue(vtkViewport*) VTK_SIZEHINT(3) { return this->Value; }
183
184protected:
186 ~vtkCoordinate() override;
187
188 double Value[3];
192 double ComputedWorldValue[3];
193 int ComputedDisplayValue[2];
194 int ComputedViewportValue[2];
196
197 double ComputedDoubleDisplayValue[2];
198 double ComputedDoubleViewportValue[2];
199 double ComputedUserDefinedValue[3];
200
201private:
202 vtkCoordinate(const vtkCoordinate&) = delete;
203 void operator=(const vtkCoordinate&) = delete;
204};
205
206#endif
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:86
double * GetComputedWorldValue(vtkViewport *)
Return the computed value in a specified coordinate system.
virtual double * GetComputedUserDefinedValue(vtkViewport *)
GetComputedUserDefinedValue() is to be used only when the coordinate system is VTK_USERDEFINED.
void SetCoordinateSystemToWorld()
Set/get the coordinate system which this coordinate is defined in.
double * GetComputedDoubleViewportValue(vtkViewport *)
double * GetComputedDoubleDisplayValue(vtkViewport *)
virtual void SetReferenceCoordinate(vtkCoordinate *)
If this coordinate is relative to another coordinate, then specify that coordinate as the ReferenceCo...
static vtkCoordinate * New()
Creates an instance of this class with the following defaults: value of (0,0,0) in world coordinates.
int * GetComputedLocalDisplayValue(vtkViewport *)
Return the computed value in a specified coordinate system.
void SetCoordinateSystemToNormalizedViewport()
Set/get the coordinate system which this coordinate is defined in.
void SetCoordinateSystemToDisplay()
Set/get the coordinate system which this coordinate is defined in.
int * GetComputedViewportValue(vtkViewport *)
Return the computed value in a specified coordinate system.
~vtkCoordinate() override
void SetCoordinateSystemToPose()
Set/get the coordinate system which this coordinate is defined in.
const char * GetCoordinateSystemAsString()
int * GetComputedDisplayValue(vtkViewport *)
Return the computed value in a specified coordinate system.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double * GetComputedValue(vtkViewport *)
GetComputedValue() will return either World, Viewport or Display based on what has been set as the co...
vtkCoordinate * ReferenceCoordinate
void SetCoordinateSystemToViewport()
Set/get the coordinate system which this coordinate is defined in.
void SetViewport(vtkViewport *viewport)
If you want this coordinate to be relative to a specific vtkViewport (vtkRenderer) then you can speci...
vtkViewport * Viewport
void SetCoordinateSystemToView()
Set/get the coordinate system which this coordinate is defined in.
void SetCoordinateSystemToNormalizedDisplay()
Set/get the coordinate system which this coordinate is defined in.
void SetValue(double a, double b)
Set/get the value of this coordinate.
a simple class to control print indentation
Definition: vtkIndent.h:43
abstract base class for most VTK objects
Definition: vtkObject.h:63
abstract specification for Viewports
Definition: vtkViewport.h:56
#define VTK_DISPLAY
Definition: vtkCoordinate.h:76
#define VTK_WORLD
Definition: vtkCoordinate.h:82
#define VTK_VIEW
Definition: vtkCoordinate.h:80
#define VTK_NORMALIZED_VIEWPORT
Definition: vtkCoordinate.h:79
#define VTK_VIEWPORT
Definition: vtkCoordinate.h:78
#define VTK_POSE
Definition: vtkCoordinate.h:81
#define VTK_NORMALIZED_DISPLAY
Definition: vtkCoordinate.h:77
#define VTK_SIZEHINT(...)