Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkImageViewer2.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageViewer2.h,v $
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 =========================================================================*/
00071 #ifndef __vtkImageViewer2_h
00072 #define __vtkImageViewer2_h
00073 
00074 #include "vtkObject.h"
00075 
00076 #include "vtkRenderWindow.h" // For inline methods
00077 #include "vtkImageActor.h" // For inline methods
00078 #include "vtkImageMapToWindowLevelColors.h" // For inline methods
00079 
00080 class vtkInteractorStyleImage;
00081 
00082 class VTK_RENDERING_EXPORT vtkImageViewer2 : public vtkObject 
00083 {
00084 public:
00085   static vtkImageViewer2 *New();
00086   
00087   vtkTypeRevisionMacro(vtkImageViewer2,vtkObject);
00088   void PrintSelf(ostream& os, vtkIndent indent);
00089 
00091   char *GetWindowName() {return this->RenderWindow->GetWindowName();}
00092 
00094   virtual void Render(void);
00095   
00097 
00098   void SetInput(vtkImageData *in) {this->WindowLevel->SetInput(in);}
00099   vtkImageData *GetInput() { return this->WindowLevel->GetInput();}
00101   
00103 
00104   int GetWholeZMin() {return this->ImageActor->GetWholeZMin();}
00105   int GetWholeZMax() {return this->ImageActor->GetWholeZMax();}
00107   
00109   vtkGetMacro(AutoResetCameraClippingRange,int);
00110   vtkSetMacro(AutoResetCameraClippingRange,int);
00111   vtkBooleanMacro(AutoResetCameraClippingRange,int);
00113   
00115 
00116   int GetZSlice() {return this->ImageActor->GetZSlice();}
00117   void SetZSlice(int s);
00119   
00121 
00122   double GetColorWindow() {return this->WindowLevel->GetWindow();}
00123   double GetColorLevel() {return this->WindowLevel->GetLevel();}
00124   void SetColorWindow(double s) {this->WindowLevel->SetWindow(s);}
00125   void SetColorLevel(double s) {this->WindowLevel->SetLevel(s);}
00127 
00129 
00130   void SetDisplayId(void *a) {this->RenderWindow->SetDisplayId(a);}
00131   void SetWindowId(void *a) {this->RenderWindow->SetWindowId(a);}
00132   void SetParentId(void *a) {this->RenderWindow->SetParentId(a);}
00134   
00136 
00137   int *GetPosition() {return this->RenderWindow->GetPosition();}
00138   void SetPosition(int a,int b) {this->RenderWindow->SetPosition(a,b);}
00139   virtual void SetPosition(int a[2]);
00141 
00143 
00144   int *GetSize() {return this->RenderWindow->GetSize();}
00145   void SetSize(int a,int b) {this->RenderWindow->SetSize(a,b);}
00146   virtual void SetSize(int a[2]);
00148   
00150 
00152   vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
00153   vtkGetObjectMacro(Renderer, vtkRenderer);
00154   vtkGetObjectMacro(ImageActor,vtkImageActor);
00155   vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
00157   
00159   void SetupInteractor(vtkRenderWindowInteractor *);
00160   
00162 
00165   void SetOffScreenRendering(int);
00166   int GetOffScreenRendering();
00167   void OffScreenRenderingOn();
00168   void OffScreenRenderingOff();
00170 
00171 protected:
00172   vtkImageViewer2();
00173   ~vtkImageViewer2();
00174 
00175   vtkImageMapToWindowLevelColors  *WindowLevel;
00176   vtkRenderWindow *RenderWindow;
00177   vtkRenderer     *Renderer;
00178   vtkImageActor   *ImageActor;
00179   int FirstRender;
00180   int AutoResetCameraClippingRange;
00181   vtkRenderWindowInteractor *Interactor;
00182   vtkInteractorStyleImage *InteractorStyle;
00183 
00184 private:
00185   vtkImageViewer2(const vtkImageViewer2&);  // Not implemented.
00186   void operator=(const vtkImageViewer2&);  // Not implemented.
00187 };
00188 
00189 #endif
00190 
00191