VTK
|
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 "vtkObject.h" 00058 class vtkViewport; 00059 00060 #define VTK_DISPLAY 0 00061 #define VTK_NORMALIZED_DISPLAY 1 00062 #define VTK_VIEWPORT 2 00063 #define VTK_NORMALIZED_VIEWPORT 3 00064 #define VTK_VIEW 4 00065 #define VTK_WORLD 5 00066 #define VTK_USERDEFINED 6 00067 00068 class VTK_FILTERING_EXPORT vtkCoordinate : public vtkObject 00069 { 00070 public: 00071 vtkTypeMacro(vtkCoordinate,vtkObject); 00072 void PrintSelf(ostream& os, vtkIndent indent); 00073 00076 static vtkCoordinate* New(); 00077 00079 00082 vtkSetMacro(CoordinateSystem, int); 00083 vtkGetMacro(CoordinateSystem, int); 00084 void SetCoordinateSystemToDisplay() {this->SetCoordinateSystem(VTK_DISPLAY);} 00085 void SetCoordinateSystemToNormalizedDisplay() 00086 {this->SetCoordinateSystem(VTK_NORMALIZED_DISPLAY);} 00087 void SetCoordinateSystemToViewport() 00088 {this->SetCoordinateSystem(VTK_VIEWPORT);} 00089 void SetCoordinateSystemToNormalizedViewport() 00090 {this->SetCoordinateSystem(VTK_NORMALIZED_VIEWPORT);} 00091 void SetCoordinateSystemToView() {this->SetCoordinateSystem(VTK_VIEW);} 00092 void SetCoordinateSystemToWorld() {this->SetCoordinateSystem(VTK_WORLD);} 00094 00095 const char *GetCoordinateSystemAsString (); 00096 00098 00100 vtkSetVector3Macro(Value,double); 00101 vtkGetVector3Macro(Value,double); 00102 void SetValue(double a, double b) { this->SetValue(a,b,0.0);} 00104 00106 00109 virtual void SetReferenceCoordinate(vtkCoordinate*); 00110 vtkGetObjectMacro(ReferenceCoordinate,vtkCoordinate); 00112 00114 00118 void SetViewport(vtkViewport *viewport); 00119 vtkGetObjectMacro(Viewport,vtkViewport); 00121 00123 00124 double *GetComputedWorldValue(vtkViewport *); 00125 int *GetComputedViewportValue(vtkViewport *); 00126 int *GetComputedDisplayValue(vtkViewport *); 00127 int *GetComputedLocalDisplayValue(vtkViewport *); 00129 00130 double *GetComputedDoubleViewportValue(vtkViewport *); 00131 double *GetComputedDoubleDisplayValue(vtkViewport *); 00132 00137 double *GetComputedValue(vtkViewport *); 00138 00140 00144 virtual double *GetComputedUserDefinedValue(vtkViewport *) 00145 { return this->Value; } 00147 00148 protected: 00149 vtkCoordinate(); 00150 ~vtkCoordinate(); 00151 00152 double Value[3]; 00153 int CoordinateSystem; 00154 vtkCoordinate *ReferenceCoordinate; 00155 vtkViewport *Viewport; 00156 double ComputedWorldValue[3]; 00157 int ComputedDisplayValue[2]; 00158 int ComputedViewportValue[2]; 00159 int Computing; 00160 00161 double ComputedDoubleDisplayValue[2]; 00162 double ComputedDoubleViewportValue[2]; 00163 double ComputedUserDefinedValue[3]; 00164 00165 private: 00166 vtkCoordinate(const vtkCoordinate&); // Not implemented. 00167 void operator=(const vtkCoordinate&); // Not implemented. 00168 }; 00169 00170 #endif 00171 00172