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 "vtkRenderingCoreModule.h" // For export macro
58 #include "vtkObject.h"
59 class vtkViewport;
60 
61 #define VTK_DISPLAY 0
62 #define VTK_NORMALIZED_DISPLAY 1
63 #define VTK_VIEWPORT 2
64 #define VTK_NORMALIZED_VIEWPORT 3
65 #define VTK_VIEW 4
66 #define VTK_WORLD 5
67 #define VTK_USERDEFINED 6
68 
70 {
71 public:
72  vtkTypeMacro(vtkCoordinate, vtkObject);
73  void PrintSelf(ostream& os, vtkIndent indent);
74 
77  static vtkCoordinate* New();
78 
80 
83  vtkSetMacro(CoordinateSystem, int);
84  vtkGetMacro(CoordinateSystem, int);
86  { this->SetCoordinateSystem(VTK_DISPLAY); }
88  { this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY); }
90  { this->SetCoordinateSystem(VTK_VIEWPORT); }
92  { this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT); }
94  { this->SetCoordinateSystem(VTK_VIEW); }
96  { this->SetCoordinateSystem(VTK_WORLD); }
98 
99  const char *GetCoordinateSystemAsString ();
100 
102 
104  vtkSetVector3Macro(Value, double);
105  vtkGetVector3Macro(Value, double);
106  void SetValue(double a, double b)
107  { this->SetValue(a, b, 0.0); }
109 
111 
114  virtual void SetReferenceCoordinate(vtkCoordinate*);
115  vtkGetObjectMacro(ReferenceCoordinate, vtkCoordinate);
117 
119 
123  void SetViewport(vtkViewport *viewport);
124  vtkGetObjectMacro(Viewport, vtkViewport);
126 
128 
129  double *GetComputedWorldValue(vtkViewport *);
130  int *GetComputedViewportValue(vtkViewport *);
131  int *GetComputedDisplayValue(vtkViewport *);
132  int *GetComputedLocalDisplayValue(vtkViewport *);
134 
135  double *GetComputedDoubleViewportValue(vtkViewport *);
136  double *GetComputedDoubleDisplayValue(vtkViewport *);
137 
142  double *GetComputedValue(vtkViewport *);
143 
145 
150  { return this->Value; }
152 
153 protected:
154  vtkCoordinate();
155  ~vtkCoordinate();
156 
157  double Value[3];
161  double ComputedWorldValue[3];
162  int ComputedDisplayValue[2];
163  int ComputedViewportValue[2];
165 
166  double ComputedDoubleDisplayValue[2];
167  double ComputedDoubleViewportValue[2];
168  double ComputedUserDefinedValue[3];
169 
170 private:
171  vtkCoordinate(const vtkCoordinate&); // Not implemented.
172  void operator=(const vtkCoordinate&); // Not implemented.
173 };
174 
175 #endif
176 
177 
void SetCoordinateSystemToWorld()
Definition: vtkCoordinate.h:95
abstract base class for most VTK objects
Definition: vtkObject.h:61
void SetCoordinateSystemToNormalizedViewport()
Definition: vtkCoordinate.h:91
abstract specification for Viewports
Definition: vtkViewport.h:46
void SetValue(double a, double b)
#define VTK_NORMALIZED_VIEWPORT
Definition: vtkCoordinate.h:64
void SetCoordinateSystemToDisplay()
Definition: vtkCoordinate.h:85
#define VTK_VIEW
Definition: vtkCoordinate.h:65
vtkCoordinate * ReferenceCoordinate
void SetCoordinateSystemToNormalizedDisplay()
Definition: vtkCoordinate.h:87
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
#define VTK_VIEWPORT
Definition: vtkCoordinate.h:63
void SetCoordinateSystemToView()
Definition: vtkCoordinate.h:93
#define VTK_NORMALIZED_DISPLAY
Definition: vtkCoordinate.h:62
void SetCoordinateSystemToViewport()
Definition: vtkCoordinate.h:89
vtkViewport * Viewport
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:69
#define VTKRENDERINGCORE_EXPORT
#define VTK_WORLD
Definition: vtkCoordinate.h:66
static vtkObject * New()
virtual double * GetComputedUserDefinedValue(vtkViewport *)
#define VTK_DISPLAY
Definition: vtkCoordinate.h:61