VTK  9.2.6
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=========================================================================*/
72#ifndef vtkCoordinate_h
73#define vtkCoordinate_h
74
75#include "vtkObject.h"
76#include "vtkRenderingCoreModule.h" // For export macro
77class vtkViewport;
78
79#define VTK_DISPLAY 0
80#define VTK_NORMALIZED_DISPLAY 1
81#define VTK_VIEWPORT 2
82#define VTK_NORMALIZED_VIEWPORT 3
83#define VTK_VIEW 4
84#define VTK_POSE 5
85#define VTK_WORLD 6
86#define VTK_USERDEFINED 7
87
88class VTKRENDERINGCORE_EXPORT vtkCoordinate : public vtkObject
89{
90public:
91 vtkTypeMacro(vtkCoordinate, vtkObject);
92 void PrintSelf(ostream& os, vtkIndent indent) override;
93
98 static vtkCoordinate* New();
99
101
106 vtkSetMacro(CoordinateSystem, int);
107 vtkGetMacro(CoordinateSystem, int);
108 void SetCoordinateSystemToDisplay() { this->SetCoordinateSystem(VTK_DISPLAY); }
110 {
111 this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY);
112 }
113 void SetCoordinateSystemToViewport() { this->SetCoordinateSystem(VTK_VIEWPORT); }
115 {
116 this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT);
117 }
118 void SetCoordinateSystemToView() { this->SetCoordinateSystem(VTK_VIEW); }
119 void SetCoordinateSystemToPose() { this->SetCoordinateSystem(VTK_POSE); }
120 void SetCoordinateSystemToWorld() { this->SetCoordinateSystem(VTK_WORLD); }
122
124
126
130 vtkSetVector3Macro(Value, double);
131 vtkGetVector3Macro(Value, double);
132 void SetValue(double a, double b) { this->SetValue(a, b, 0.0); }
134
136
142 vtkGetObjectMacro(ReferenceCoordinate, vtkCoordinate);
144
146
153 void SetViewport(vtkViewport* viewport);
154 vtkGetObjectMacro(Viewport, vtkViewport);
156
158
166
169
177
185 virtual double* GetComputedUserDefinedValue(vtkViewport*) VTK_SIZEHINT(3) { return this->Value; }
186
187protected:
189 ~vtkCoordinate() override;
190
191 double Value[3];
195 double ComputedWorldValue[3];
196 int ComputedDisplayValue[2];
197 int ComputedViewportValue[2];
199
200 double ComputedDoubleDisplayValue[2];
201 double ComputedDoubleViewportValue[2];
202 double ComputedUserDefinedValue[3];
203
204private:
205 vtkCoordinate(const vtkCoordinate&) = delete;
206 void operator=(const vtkCoordinate&) = delete;
207};
208
209#endif
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
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:49
abstract base class for most VTK objects
Definition vtkObject.h:72
abstract specification for Viewports
Definition vtkViewport.h:65
#define VTK_DISPLAY
#define VTK_WORLD
#define VTK_VIEW
#define VTK_NORMALIZED_VIEWPORT
#define VTK_VIEWPORT
#define VTK_POSE
#define VTK_NORMALIZED_DISPLAY
#define VTK_SIZEHINT(...)