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 =========================================================================*/
57 #ifndef vtkCoordinate_h
58 #define vtkCoordinate_h
59 
60 #include "vtkRenderingCoreModule.h" // For export macro
61 #include "vtkObject.h"
62 class vtkViewport;
63 
64 #define VTK_DISPLAY 0
65 #define VTK_NORMALIZED_DISPLAY 1
66 #define VTK_VIEWPORT 2
67 #define VTK_NORMALIZED_VIEWPORT 3
68 #define VTK_VIEW 4
69 #define VTK_WORLD 5
70 #define VTK_USERDEFINED 6
71 
72 class VTKRENDERINGCORE_EXPORT vtkCoordinate : public vtkObject
73 {
74 public:
75  vtkTypeMacro(vtkCoordinate, vtkObject);
76  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
77 
82  static vtkCoordinate* New();
83 
85 
90  vtkSetMacro(CoordinateSystem, int);
91  vtkGetMacro(CoordinateSystem, int);
93  { this->SetCoordinateSystem(VTK_DISPLAY); }
95  { this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY); }
97  { this->SetCoordinateSystem(VTK_VIEWPORT); }
99  { this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT); }
101  { this->SetCoordinateSystem(VTK_VIEW); }
103  { this->SetCoordinateSystem(VTK_WORLD); }
105 
106  const char *GetCoordinateSystemAsString ();
107 
109 
113  vtkSetVector3Macro(Value, double);
114  vtkGetVector3Macro(Value, double);
115  void SetValue(double a, double b)
116  { this->SetValue(a, b, 0.0); }
118 
120 
125  virtual void SetReferenceCoordinate(vtkCoordinate*);
126  vtkGetObjectMacro(ReferenceCoordinate, vtkCoordinate);
128 
130 
137  void SetViewport(vtkViewport *viewport);
138  vtkGetObjectMacro(Viewport, vtkViewport);
140 
142 
145  double *GetComputedWorldValue(vtkViewport *);
146  int *GetComputedViewportValue(vtkViewport *);
147  int *GetComputedDisplayValue(vtkViewport *);
148  int *GetComputedLocalDisplayValue(vtkViewport *);
150 
151  double *GetComputedDoubleViewportValue(vtkViewport *);
152  double *GetComputedDoubleDisplayValue(vtkViewport *);
153 
160  double *GetComputedValue(vtkViewport *);
161 
170  { return this->Value; }
171 
172 protected:
173  vtkCoordinate();
174  ~vtkCoordinate() VTK_OVERRIDE;
175 
176  double Value[3];
180  double ComputedWorldValue[3];
181  int ComputedDisplayValue[2];
182  int ComputedViewportValue[2];
184 
185  double ComputedDoubleDisplayValue[2];
186  double ComputedDoubleViewportValue[2];
187  double ComputedUserDefinedValue[3];
188 
189 private:
190  vtkCoordinate(const vtkCoordinate&) VTK_DELETE_FUNCTION;
191  void operator=(const vtkCoordinate&) VTK_DELETE_FUNCTION;
192 };
193 
194 #endif
void SetCoordinateSystemToWorld()
Set/get the coordinate system which this coordinate is defined in.
abstract base class for most VTK objects
Definition: vtkObject.h:53
void SetCoordinateSystemToNormalizedViewport()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:98
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:44
void SetValue(double a, double b)
Set/get the value of this coordinate.
#define VTK_NORMALIZED_VIEWPORT
Definition: vtkCoordinate.h:67
void SetCoordinateSystemToDisplay()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:92
#define VTK_VIEW
Definition: vtkCoordinate.h:68
vtkCoordinate * ReferenceCoordinate
void SetCoordinateSystemToNormalizedDisplay()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:94
a simple class to control print indentation
Definition: vtkIndent.h:33
#define VTK_VIEWPORT
Definition: vtkCoordinate.h:66
void SetCoordinateSystemToView()
Set/get the coordinate system which this coordinate is defined in.
#define VTK_NORMALIZED_DISPLAY
Definition: vtkCoordinate.h:65
void SetCoordinateSystemToViewport()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:96
vtkViewport * Viewport
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:72
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
#define VTK_WORLD
Definition: vtkCoordinate.h:69
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:64