VTK  9.1.0
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 =========================================================================*/
169 #ifndef vtkCoordinate_h
170 #define vtkCoordinate_h
171 
172 #include "vtkObject.h"
173 #include "vtkRenderingCoreModule.h" // For export macro
174 class vtkViewport;
175 
176 #define VTK_DISPLAY 0
177 #define VTK_NORMALIZED_DISPLAY 1
178 #define VTK_VIEWPORT 2
179 #define VTK_NORMALIZED_VIEWPORT 3
180 #define VTK_VIEW 4
181 #define VTK_POSE 5
182 #define VTK_WORLD 6
183 #define VTK_USERDEFINED 7
184 
185 class VTKRENDERINGCORE_EXPORT vtkCoordinate : public vtkObject
186 {
187 public:
188  vtkTypeMacro(vtkCoordinate, vtkObject);
189  void PrintSelf(ostream& os, vtkIndent indent) override;
190 
195  static vtkCoordinate* New();
196 
198 
203  vtkSetMacro(CoordinateSystem, int);
204  vtkGetMacro(CoordinateSystem, int);
205  void SetCoordinateSystemToDisplay() { this->SetCoordinateSystem(VTK_DISPLAY); }
207  {
208  this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY);
209  }
210  void SetCoordinateSystemToViewport() { this->SetCoordinateSystem(VTK_VIEWPORT); }
212  {
213  this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT);
214  }
215  void SetCoordinateSystemToView() { this->SetCoordinateSystem(VTK_VIEW); }
216  void SetCoordinateSystemToPose() { this->SetCoordinateSystem(VTK_POSE); }
217  void SetCoordinateSystemToWorld() { this->SetCoordinateSystem(VTK_WORLD); }
219 
221 
223 
227  vtkSetVector3Macro(Value, double);
228  vtkGetVector3Macro(Value, double);
229  void SetValue(double a, double b) { this->SetValue(a, b, 0.0); }
231 
233 
239  vtkGetObjectMacro(ReferenceCoordinate, vtkCoordinate);
241 
243 
250  void SetViewport(vtkViewport* viewport);
251  vtkGetObjectMacro(Viewport, vtkViewport);
253 
255 
263 
266 
274 
282  virtual double* GetComputedUserDefinedValue(vtkViewport*) VTK_SIZEHINT(3) { return this->Value; }
283 
284 protected:
286  ~vtkCoordinate() override;
287 
288  double Value[3];
292  double ComputedWorldValue[3];
293  int ComputedDisplayValue[2];
294  int ComputedViewportValue[2];
296 
297  double ComputedDoubleDisplayValue[2];
298  double ComputedDoubleViewportValue[2];
299  double ComputedUserDefinedValue[3];
300 
301 private:
302  vtkCoordinate(const vtkCoordinate&) = delete;
303  void operator=(const vtkCoordinate&) = delete;
304 };
305 
306 #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::SetValue
void SetValue(double a, double b)
Set/get the value of this coordinate.
Definition: vtkCoordinate.h:229
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:179
vtkCoordinate::SetCoordinateSystemToNormalizedViewport
void SetCoordinateSystemToNormalizedViewport()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:211
vtkCoordinate::SetCoordinateSystemToDisplay
void SetCoordinateSystemToDisplay()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:205
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
VTK_POSE
#define VTK_POSE
Definition: vtkCoordinate.h:181
vtkCoordinate::GetCoordinateSystemAsString
const char * GetCoordinateSystemAsString()
vtkCoordinate::ReferenceCoordinate
vtkCoordinate * ReferenceCoordinate
Definition: vtkCoordinate.h:290
vtkCoordinate::GetComputedWorldValue
double * GetComputedWorldValue(vtkViewport *)
Return the computed value in a specified coordinate system.
VTK_VIEW
#define VTK_VIEW
Definition: vtkCoordinate.h:180
vtkCoordinate::SetCoordinateSystemToWorld
void SetCoordinateSystemToWorld()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:217
vtkCoordinate::CoordinateSystem
int CoordinateSystem
Definition: vtkCoordinate.h:289
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_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:48
VTK_VIEWPORT
#define VTK_VIEWPORT
Definition: vtkCoordinate.h:178
vtkCoordinate::GetComputedLocalDisplayValue
int * GetComputedLocalDisplayValue(vtkViewport *)
Return the computed value in a specified coordinate system.
vtkCoordinate::Computing
int Computing
Definition: vtkCoordinate.h:295
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
VTK_NORMALIZED_DISPLAY
#define VTK_NORMALIZED_DISPLAY
Definition: vtkCoordinate.h:177
vtkCoordinate::SetCoordinateSystemToViewport
void SetCoordinateSystemToViewport()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:210
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:186
vtkCoordinate::GetComputedUserDefinedValue
virtual double * GetComputedUserDefinedValue(vtkViewport *)
GetComputedUserDefinedValue() is to be used only when the coordinate system is VTK_USERDEFINED.
Definition: vtkCoordinate.h:282
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
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
vtkCoordinate::SetCoordinateSystemToNormalizedDisplay
void SetCoordinateSystemToNormalizedDisplay()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:206
vtkCoordinate::GetComputedDisplayValue
int * GetComputedDisplayValue(vtkViewport *)
Return the computed value in a specified coordinate system.
vtkCoordinate::GetComputedViewportValue
int * GetComputedViewportValue(vtkViewport *)
Return the computed value in a specified coordinate system.
vtkCoordinate::~vtkCoordinate
~vtkCoordinate() override
VTK_WORLD
#define VTK_WORLD
Definition: vtkCoordinate.h:182
vtkCoordinate::SetCoordinateSystemToView
void SetCoordinateSystemToView()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:215
vtkCoordinate::GetComputedDoubleDisplayValue
double * GetComputedDoubleDisplayValue(vtkViewport *)
vtkCoordinate::GetComputedDoubleViewportValue
double * GetComputedDoubleViewportValue(vtkViewport *)
vtkCoordinate::SetCoordinateSystemToPose
void SetCoordinateSystemToPose()
Set/get the coordinate system which this coordinate is defined in.
Definition: vtkCoordinate.h:216
vtkCoordinate::Viewport
vtkViewport * Viewport
Definition: vtkCoordinate.h:291
VTK_DISPLAY
#define VTK_DISPLAY
Definition: vtkCoordinate.h:176