VTK  9.3.20240722
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
160#ifndef vtkCoordinate_h
161#define vtkCoordinate_h
162
163#include "vtkObject.h"
164#include "vtkRenderingCoreModule.h" // For export macro
165#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
166VTK_ABI_NAMESPACE_BEGIN
167class vtkViewport;
168
169#define VTK_DISPLAY 0
170#define VTK_NORMALIZED_DISPLAY 1
171#define VTK_VIEWPORT 2
172#define VTK_NORMALIZED_VIEWPORT 3
173#define VTK_VIEW 4
174#define VTK_POSE 5
175#define VTK_WORLD 6
176#define VTK_USERDEFINED 7
177
178class VTKRENDERINGCORE_EXPORT VTK_MARSHALAUTO vtkCoordinate : public vtkObject
179{
180public:
181 vtkTypeMacro(vtkCoordinate, vtkObject);
182 void PrintSelf(ostream& os, vtkIndent indent) override;
183
189
191
196 vtkSetMacro(CoordinateSystem, int);
197 vtkGetMacro(CoordinateSystem, int);
198 void SetCoordinateSystemToDisplay() { this->SetCoordinateSystem(VTK_DISPLAY); }
200 {
201 this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY);
202 }
203 void SetCoordinateSystemToViewport() { this->SetCoordinateSystem(VTK_VIEWPORT); }
205 {
206 this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT);
207 }
208 void SetCoordinateSystemToView() { this->SetCoordinateSystem(VTK_VIEW); }
209 void SetCoordinateSystemToPose() { this->SetCoordinateSystem(VTK_POSE); }
210 void SetCoordinateSystemToWorld() { this->SetCoordinateSystem(VTK_WORLD); }
212
214
216
220 vtkSetVector3Macro(Value, double);
221 vtkGetVector3Macro(Value, double);
222 void SetValue(double a, double b) { this->SetValue(a, b, 0.0); }
224
226
232 vtkGetObjectMacro(ReferenceCoordinate, vtkCoordinate);
234
236
243 void SetViewport(vtkViewport* viewport);
244 vtkGetObjectMacro(Viewport, vtkViewport);
246
248
256
259
267
275 virtual double* GetComputedUserDefinedValue(vtkViewport*) VTK_SIZEHINT(3) { return this->Value; }
276
277protected:
279 ~vtkCoordinate() override;
280
281 double Value[3];
285 double ComputedWorldValue[3];
286 int ComputedDisplayValue[2];
287 int ComputedViewportValue[2];
289
290 double ComputedDoubleDisplayValue[2];
291 double ComputedDoubleViewportValue[2];
292 double ComputedUserDefinedValue[3];
293
294private:
295 vtkCoordinate(const vtkCoordinate&) = delete;
296 void operator=(const vtkCoordinate&) = delete;
297};
298
299VTK_ABI_NAMESPACE_END
300#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:108
abstract base class for most VTK objects
Definition vtkObject.h:162
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(...)
#define VTK_MARSHALAUTO