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 =========================================================================*/
63 #ifndef vtkCoordinate_h
64 #define vtkCoordinate_h
65 
66 #include "vtkRenderingCoreModule.h" // For export macro
67 #include "vtkObject.h"
68 class vtkViewport;
69 
70 #define VTK_DISPLAY 0
71 #define VTK_NORMALIZED_DISPLAY 1
72 #define VTK_VIEWPORT 2
73 #define VTK_NORMALIZED_VIEWPORT 3
74 #define VTK_VIEW 4
75 #define VTK_WORLD 5
76 #define VTK_USERDEFINED 6
77 
78 class VTKRENDERINGCORE_EXPORT vtkCoordinate : public vtkObject
79 {
80 public:
81  vtkTypeMacro(vtkCoordinate, vtkObject);
82  void PrintSelf(ostream& os, vtkIndent indent) override;
83 
88  static vtkCoordinate* New();
89 
91 
96  vtkSetMacro(CoordinateSystem, int);
97  vtkGetMacro(CoordinateSystem, int);
99  { this->SetCoordinateSystem(VTK_DISPLAY); }
101  { this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY); }
103  { this->SetCoordinateSystem(VTK_VIEWPORT); }
105  { this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT); }
107  { this->SetCoordinateSystem(VTK_VIEW); }
109  { this->SetCoordinateSystem(VTK_WORLD); }
111 
112  const char *GetCoordinateSystemAsString ();
113 
115 
119  vtkSetVector3Macro(Value, double);
120  vtkGetVector3Macro(Value, double);
121  void SetValue(double a, double b)
122  { this->SetValue(a, b, 0.0); }
124 
126 
131  virtual void SetReferenceCoordinate(vtkCoordinate*);
132  vtkGetObjectMacro(ReferenceCoordinate, vtkCoordinate);
134 
136 
143  void SetViewport(vtkViewport *viewport);
144  vtkGetObjectMacro(Viewport, vtkViewport);
146 
148 
151  double *GetComputedWorldValue(vtkViewport *);
152  int *GetComputedViewportValue(vtkViewport *);
153  int *GetComputedDisplayValue(vtkViewport *);
154  int *GetComputedLocalDisplayValue(vtkViewport *);
156 
157  double *GetComputedDoubleViewportValue(vtkViewport *);
158  double *GetComputedDoubleDisplayValue(vtkViewport *);
159 
166  double *GetComputedValue(vtkViewport *);
167 
176  { return this->Value; }
177 
178 protected:
179  vtkCoordinate();
180  ~vtkCoordinate() override;
181 
182  double Value[3];
186  double ComputedWorldValue[3];
187  int ComputedDisplayValue[2];
188  int ComputedViewportValue[2];
190 
191  double ComputedDoubleDisplayValue[2];
192  double ComputedDoubleViewportValue[2];
193  double ComputedUserDefinedValue[3];
194 
195 private:
196  vtkCoordinate(const vtkCoordinate&) = delete;
197  void operator=(const vtkCoordinate&) = delete;
198 };
199 
200 #endif
void SetCoordinateSystemToWorld()
Set/get the coordinate system which this coordinate is defined in.
abstract base class for most VTK objects
Definition: vtkObject.h:59
void SetCoordinateSystemToNormalizedViewport()
Set/get the coordinate system which this coordinate is defined in.
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:47
void SetValue(double a, double b)
Set/get the value of this coordinate.
#define VTK_NORMALIZED_VIEWPORT
Definition: vtkCoordinate.h:73
void SetCoordinateSystemToDisplay()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:98
#define VTK_VIEW
Definition: vtkCoordinate.h:74
vtkCoordinate * ReferenceCoordinate
void SetCoordinateSystemToNormalizedDisplay()
Set/get the coordinate system which this coordinate is defined in.
a simple class to control print indentation
Definition: vtkIndent.h:39
#define VTK_VIEWPORT
Definition: vtkCoordinate.h:72
void SetCoordinateSystemToView()
Set/get the coordinate system which this coordinate is defined in.
#define VTK_NORMALIZED_DISPLAY
Definition: vtkCoordinate.h:71
void SetCoordinateSystemToViewport()
Set/get the coordinate system which this coordinate is defined in.
vtkViewport * Viewport
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:78
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
#define VTK_WORLD
Definition: vtkCoordinate.h:75
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:70