VTK
dox/Rendering/Core/vtkCoordinate.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCoordinate.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00054 #ifndef __vtkCoordinate_h
00055 #define __vtkCoordinate_h
00056 
00057 #include "vtkRenderingCoreModule.h" // For export macro
00058 #include "vtkObject.h"
00059 class vtkViewport;
00060 
00061 #define VTK_DISPLAY             0
00062 #define VTK_NORMALIZED_DISPLAY  1
00063 #define VTK_VIEWPORT            2
00064 #define VTK_NORMALIZED_VIEWPORT 3
00065 #define VTK_VIEW                4
00066 #define VTK_WORLD               5
00067 #define VTK_USERDEFINED         6
00068 
00069 class VTKRENDERINGCORE_EXPORT vtkCoordinate : public vtkObject
00070 {
00071 public:
00072   vtkTypeMacro(vtkCoordinate, vtkObject);
00073   void PrintSelf(ostream& os, vtkIndent indent);
00074 
00077   static vtkCoordinate* New();
00078 
00080 
00083   vtkSetMacro(CoordinateSystem, int);
00084   vtkGetMacro(CoordinateSystem, int);
00085   void SetCoordinateSystemToDisplay()
00086     { this->SetCoordinateSystem(VTK_DISPLAY); }
00087   void SetCoordinateSystemToNormalizedDisplay()
00088     { this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY); }
00089   void SetCoordinateSystemToViewport()
00090     { this->SetCoordinateSystem(VTK_VIEWPORT); }
00091   void SetCoordinateSystemToNormalizedViewport()
00092     { this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT); }
00093   void SetCoordinateSystemToView()
00094     { this->SetCoordinateSystem(VTK_VIEW); }
00095   void SetCoordinateSystemToWorld()
00096     { this->SetCoordinateSystem(VTK_WORLD); }
00098 
00099   const char *GetCoordinateSystemAsString ();
00100 
00102 
00104   vtkSetVector3Macro(Value, double);
00105   vtkGetVector3Macro(Value, double);
00106   void SetValue(double a, double b)
00107     { this->SetValue(a, b, 0.0); }
00109 
00111 
00114   virtual void SetReferenceCoordinate(vtkCoordinate*);
00115   vtkGetObjectMacro(ReferenceCoordinate, vtkCoordinate);
00117 
00119 
00123   void SetViewport(vtkViewport *viewport);
00124   vtkGetObjectMacro(Viewport, vtkViewport);
00126 
00128 
00129   double *GetComputedWorldValue(vtkViewport *);
00130   int *GetComputedViewportValue(vtkViewport *);
00131   int *GetComputedDisplayValue(vtkViewport *);
00132   int *GetComputedLocalDisplayValue(vtkViewport *);
00134 
00135   double *GetComputedDoubleViewportValue(vtkViewport *);
00136   double *GetComputedDoubleDisplayValue(vtkViewport *);
00137 
00142   double *GetComputedValue(vtkViewport *);
00143 
00145 
00149   virtual double *GetComputedUserDefinedValue(vtkViewport *)
00150     { return this->Value; }
00152 
00153 protected:
00154   vtkCoordinate();
00155   ~vtkCoordinate();
00156 
00157   double Value[3];
00158   int CoordinateSystem;
00159   vtkCoordinate *ReferenceCoordinate;
00160   vtkViewport *Viewport;
00161   double ComputedWorldValue[3];
00162   int ComputedDisplayValue[2];
00163   int ComputedViewportValue[2];
00164   int Computing;
00165 
00166   double ComputedDoubleDisplayValue[2];
00167   double ComputedDoubleViewportValue[2];
00168   double ComputedUserDefinedValue[3];
00169 
00170 private:
00171   vtkCoordinate(const vtkCoordinate&);  // Not implemented.
00172   void operator=(const vtkCoordinate&);  // Not implemented.
00173 };
00174 
00175 #endif
00176 
00177