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 =========================================================================*/
55 #ifndef vtkCoordinate_h
56 #define vtkCoordinate_h
57 
58 #include "vtkRenderingCoreModule.h" // For export macro
59 #include "vtkObject.h"
60 class vtkViewport;
61 
62 #define VTK_DISPLAY 0
63 #define VTK_NORMALIZED_DISPLAY 1
64 #define VTK_VIEWPORT 2
65 #define VTK_NORMALIZED_VIEWPORT 3
66 #define VTK_VIEW 4
67 #define VTK_WORLD 5
68 #define VTK_USERDEFINED 6
69 
70 class VTKRENDERINGCORE_EXPORT vtkCoordinate : public vtkObject
71 {
72 public:
73  vtkTypeMacro(vtkCoordinate, vtkObject);
74  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
75 
80  static vtkCoordinate* New();
81 
83 
88  vtkSetMacro(CoordinateSystem, int);
89  vtkGetMacro(CoordinateSystem, int);
91  { this->SetCoordinateSystem(VTK_DISPLAY); }
93  { this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY); }
95  { this->SetCoordinateSystem(VTK_VIEWPORT); }
97  { this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT); }
99  { this->SetCoordinateSystem(VTK_VIEW); }
101  { this->SetCoordinateSystem(VTK_WORLD); }
103 
105 
107 
111  vtkSetVector3Macro(Value, double);
112  vtkGetVector3Macro(Value, double);
113  void SetValue(double a, double b)
114  { this->SetValue(a, b, 0.0); }
116 
118 
124  vtkGetObjectMacro(ReferenceCoordinate, vtkCoordinate);
126 
128 
135  void SetViewport(vtkViewport *viewport);
136  vtkGetObjectMacro(Viewport, vtkViewport);
138 
140 
148 
151 
159 
168  { return this->Value; }
169 
170 protected:
173 
174  double Value[3];
178  double ComputedWorldValue[3];
179  int ComputedDisplayValue[2];
180  int ComputedViewportValue[2];
182 
183  double ComputedDoubleDisplayValue[2];
184  double ComputedDoubleViewportValue[2];
185  double ComputedUserDefinedValue[3];
186 
187 private:
188  vtkCoordinate(const vtkCoordinate&) VTK_DELETE_FUNCTION;
189  void operator=(const vtkCoordinate&) VTK_DELETE_FUNCTION;
190 };
191 
192 #endif
vtkCoordinate::New
static vtkCoordinate * New()
Creates an instance of this class with the following defaults: value of (0,0,0) in world coordinates.
vtkCoordinate::~vtkCoordinate
~vtkCoordinate()
vtkCoordinate::SetValue
void SetValue(double a, double b)
Definition: vtkCoordinate.h:113
vtkCoordinate::SetReferenceCoordinate
virtual void SetReferenceCoordinate(vtkCoordinate *)
If this coordinate is relative to another coordinate, then specify that coordinate as the ReferenceCo...
vtkCoordinate::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
VTK_NORMALIZED_VIEWPORT
#define VTK_NORMALIZED_VIEWPORT
Definition: vtkCoordinate.h:65
vtkCoordinate::SetCoordinateSystemToNormalizedViewport
void SetCoordinateSystemToNormalizedViewport()
Definition: vtkCoordinate.h:96
vtkCoordinate::SetCoordinateSystemToDisplay
void SetCoordinateSystemToDisplay()
Definition: vtkCoordinate.h:90
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkCoordinate::GetCoordinateSystemAsString
const char * GetCoordinateSystemAsString()
vtkCoordinate::ReferenceCoordinate
vtkCoordinate * ReferenceCoordinate
Definition: vtkCoordinate.h:176
vtkCoordinate::GetComputedWorldValue
double * GetComputedWorldValue(vtkViewport *)
Return the computed value in a specified coordinate system.
VTK_VIEW
#define VTK_VIEW
Definition: vtkCoordinate.h:66
vtkCoordinate::SetCoordinateSystemToWorld
void SetCoordinateSystemToWorld()
Definition: vtkCoordinate.h:100
vtkCoordinate::CoordinateSystem
int CoordinateSystem
Definition: vtkCoordinate.h:175
vtkCoordinate::vtkCoordinate
vtkCoordinate()
vtkCoordinate::GetComputedValue
double * GetComputedValue(vtkViewport *)
GetComputedValue() will return either World, Viewport or Display based on what has been set as the co...
VTK_VIEWPORT
#define VTK_VIEWPORT
Definition: vtkCoordinate.h:64
vtkCoordinate::GetComputedLocalDisplayValue
int * GetComputedLocalDisplayValue(vtkViewport *)
vtkCoordinate::Computing
int Computing
Definition: vtkCoordinate.h:181
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
VTK_NORMALIZED_DISPLAY
#define VTK_NORMALIZED_DISPLAY
Definition: vtkCoordinate.h:63
vtkCoordinate::SetCoordinateSystemToViewport
void SetCoordinateSystemToViewport()
Definition: vtkCoordinate.h:94
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:71
vtkCoordinate::GetComputedUserDefinedValue
virtual double * GetComputedUserDefinedValue(vtkViewport *)
GetComputedUserDefinedValue() is to be used only when the coordinate system is VTK_USERDEFINED.
Definition: vtkCoordinate.h:167
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:48
vtkCoordinate::SetViewport
void SetViewport(vtkViewport *viewport)
If you want this coordinate to be relative to a specific vtkViewport (vtkRenderer) then you can speci...
vtkObject.h
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkCoordinate::SetCoordinateSystemToNormalizedDisplay
void SetCoordinateSystemToNormalizedDisplay()
Definition: vtkCoordinate.h:92
vtkCoordinate::GetComputedDisplayValue
int * GetComputedDisplayValue(vtkViewport *)
vtkCoordinate::GetComputedViewportValue
int * GetComputedViewportValue(vtkViewport *)
VTK_WORLD
#define VTK_WORLD
Definition: vtkCoordinate.h:67
vtkCoordinate::SetCoordinateSystemToView
void SetCoordinateSystemToView()
Definition: vtkCoordinate.h:98
vtkCoordinate::GetComputedDoubleDisplayValue
double * GetComputedDoubleDisplayValue(vtkViewport *)
vtkCoordinate::GetComputedDoubleViewportValue
double * GetComputedDoubleViewportValue(vtkViewport *)
vtkCoordinate::Viewport
vtkViewport * Viewport
Definition: vtkCoordinate.h:177
VTK_DISPLAY
#define VTK_DISPLAY
Definition: vtkCoordinate.h:62