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 =========================================================================*/
54 #ifndef __vtkCoordinate_h
55 #define __vtkCoordinate_h
56 
57 #include "vtkObject.h"
58 class vtkViewport;
59 
60 #define VTK_DISPLAY 0
61 #define VTK_NORMALIZED_DISPLAY 1
62 #define VTK_VIEWPORT 2
63 #define VTK_NORMALIZED_VIEWPORT 3
64 #define VTK_VIEW 4
65 #define VTK_WORLD 5
66 #define VTK_USERDEFINED 6
67 
69 {
70 public:
71  vtkTypeMacro(vtkCoordinate,vtkObject);
72  void PrintSelf(ostream& os, vtkIndent indent);
73 
76  static vtkCoordinate* New();
77 
79 
82  vtkSetMacro(CoordinateSystem, int);
83  vtkGetMacro(CoordinateSystem, int);
84  void SetCoordinateSystemToDisplay() {this->SetCoordinateSystem(VTK_DISPLAY);}
86  {this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY);}
88  {this->SetCoordinateSystem(VTK_VIEWPORT);}
90  {this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT);}
91  void SetCoordinateSystemToView() {this->SetCoordinateSystem(VTK_VIEW);}
92  void SetCoordinateSystemToWorld() {this->SetCoordinateSystem(VTK_WORLD);}
94 
95  const char *GetCoordinateSystemAsString ();
96 
98 
100  vtkSetVector3Macro(Value,double);
101  vtkGetVector3Macro(Value,double);
102  void SetValue(double a, double b) { this->SetValue(a,b,0.0);}
104 
106 
109  virtual void SetReferenceCoordinate(vtkCoordinate*);
110  vtkGetObjectMacro(ReferenceCoordinate,vtkCoordinate);
112 
114 
118  void SetViewport(vtkViewport *viewport);
119  vtkGetObjectMacro(Viewport,vtkViewport);
121 
123 
124  double *GetComputedWorldValue(vtkViewport *);
125  int *GetComputedViewportValue(vtkViewport *);
126  int *GetComputedDisplayValue(vtkViewport *);
127  int *GetComputedLocalDisplayValue(vtkViewport *);
129 
130  double *GetComputedDoubleViewportValue(vtkViewport *);
131  double *GetComputedDoubleDisplayValue(vtkViewport *);
132 
137  double *GetComputedValue(vtkViewport *);
138 
140 
145  { return this->Value; }
147 
148 protected:
149  vtkCoordinate();
150  ~vtkCoordinate();
151 
152  double Value[3];
156  double ComputedWorldValue[3];
157  int ComputedDisplayValue[2];
158  int ComputedViewportValue[2];
160 
161  double ComputedDoubleDisplayValue[2];
162  double ComputedDoubleViewportValue[2];
163  double ComputedUserDefinedValue[3];
164 
165 private:
166  vtkCoordinate(const vtkCoordinate&); // Not implemented.
167  void operator=(const vtkCoordinate&); // Not implemented.
168 };
169 
170 #endif
171 
172