VTK
dox/Interaction/Image/vtkImageViewer.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImageViewer.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 =========================================================================*/
00034 #ifndef __vtkImageViewer_h
00035 #define __vtkImageViewer_h
00036 
00037 #include "vtkInteractionImageModule.h" // For export macro
00038 #include "vtkObject.h"
00039 
00040 #include "vtkImageMapper.h" // For all the inline methods
00041 #include "vtkRenderWindow.h" // For all the inline methods
00042 
00043 class vtkInteractorStyleImage;
00044 
00045 class VTKINTERACTIONIMAGE_EXPORT vtkImageViewer : public vtkObject
00046 {
00047 public:
00048   static vtkImageViewer *New();
00049 
00050   vtkTypeMacro(vtkImageViewer,vtkObject);
00051   void PrintSelf(ostream& os, vtkIndent indent);
00052 
00054   char *GetWindowName() {return this->RenderWindow->GetWindowName();};
00055 
00057   virtual void Render(void);
00058 
00060 
00061   void SetInputData(vtkImageData *in) {this->ImageMapper->SetInputData(in);};
00062   vtkImageData *GetInput() { return this->ImageMapper->GetInput();};
00063   virtual void SetInputConnection(vtkAlgorithmOutput* input) {
00064     this->ImageMapper->SetInputConnection(input);};
00066 
00068 
00069   int GetWholeZMin() {return this->ImageMapper->GetWholeZMin();};
00070   int GetWholeZMax() {return this->ImageMapper->GetWholeZMax();};
00072 
00074 
00075   int GetZSlice() {return this->ImageMapper->GetZSlice();};
00076   void SetZSlice(int s) {this->ImageMapper->SetZSlice(s);};
00078 
00080 
00081   double GetColorWindow() {return this->ImageMapper->GetColorWindow();};
00082   double GetColorLevel() {return this->ImageMapper->GetColorLevel();};
00083   void SetColorWindow(double s) {this->ImageMapper->SetColorWindow(s);};
00084   void SetColorLevel(double s) {this->ImageMapper->SetColorLevel(s);};
00086 
00088 
00089   void SetDisplayId(void *a) {this->RenderWindow->SetDisplayId(a);};
00090   void SetWindowId(void *a) {this->RenderWindow->SetWindowId(a);};
00091   void SetParentId(void *a) {this->RenderWindow->SetParentId(a);};
00093 
00095 
00096   int *GetPosition() {return this->RenderWindow->GetPosition();};
00097   void SetPosition(int a,int b) {this->RenderWindow->SetPosition(a,b);};
00098   virtual void SetPosition(int a[2]);
00100 
00102 
00103   int *GetSize() {return this->RenderWindow->GetSize();};
00104   void SetSize(int a,int b) {this->RenderWindow->SetSize(a,b);};
00105   virtual void SetSize(int a[2]);
00107 
00109 
00110   vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
00111   vtkGetObjectMacro(Renderer, vtkRenderer);
00112   vtkGetObjectMacro(ImageMapper,vtkImageMapper);
00113   vtkGetObjectMacro(Actor2D,vtkActor2D);
00115 
00117   void SetupInteractor(vtkRenderWindowInteractor *);
00118 
00120 
00123   void SetOffScreenRendering(int);
00124   int GetOffScreenRendering();
00125   void OffScreenRenderingOn();
00126   void OffScreenRenderingOff();
00128 
00129 protected:
00130   vtkImageViewer();
00131   ~vtkImageViewer();
00132 
00133   vtkRenderWindow *RenderWindow;
00134   vtkRenderer *Renderer;
00135   vtkImageMapper *ImageMapper;
00136   vtkActor2D     *Actor2D;
00137   int FirstRender;
00138   vtkRenderWindowInteractor *Interactor;
00139   vtkInteractorStyleImage *InteractorStyle;
00140 
00141   friend class vtkImageViewerCallback;
00142   vtkAlgorithm* GetInputAlgorithm();
00143 
00144 private:
00145   vtkImageViewer(const vtkImageViewer&);  // Not implemented.
00146   void operator=(const vtkImageViewer&);  // Not implemented.
00147 };
00148 
00149 #endif