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

Rendering/vtkImageViewer.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageViewer.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00038 #ifndef __vtkImageViewer_h
00039 #define __vtkImageViewer_h
00040 
00041 #include "vtkObject.h"
00042 
00043 #include "vtkImageMapper.h" // For all the inline methods
00044 #include "vtkRenderWindow.h" // For all the inline methods
00045 
00046 class vtkInteractorStyleImage;
00047 
00048 class VTK_RENDERING_EXPORT vtkImageViewer : public vtkObject 
00049 {
00050 public:
00051   static vtkImageViewer *New();
00052   
00053   vtkTypeRevisionMacro(vtkImageViewer,vtkObject);
00054   void PrintSelf(ostream& os, vtkIndent indent);
00055 
00057   char *GetWindowName() {return this->RenderWindow->GetWindowName();};
00058 
00060   virtual void Render(void);
00061   
00063 
00064   void SetInput(vtkImageData *in) {this->ImageMapper->SetInput(in);};
00065   vtkImageData *GetInput() { return this->ImageMapper->GetInput();};
00067   
00069 
00070   int GetWholeZMin() {return this->ImageMapper->GetWholeZMin();};
00071   int GetWholeZMax() {return this->ImageMapper->GetWholeZMax();};
00073   
00075 
00076   int GetZSlice() {return this->ImageMapper->GetZSlice();};
00077   void SetZSlice(int s) {this->ImageMapper->SetZSlice(s);};
00079   
00081 
00082   float GetColorWindow() {return this->ImageMapper->GetColorWindow();};
00083   float GetColorLevel() {return this->ImageMapper->GetColorLevel();};
00084   void SetColorWindow(float s) {this->ImageMapper->SetColorWindow(s);};
00085   void SetColorLevel(float s) {this->ImageMapper->SetColorLevel(s);};
00087 
00089 
00090   void SetDisplayId(void *a) {this->RenderWindow->SetDisplayId(a);};
00091   void SetWindowId(void *a) {this->RenderWindow->SetWindowId(a);};
00092   void SetParentId(void *a) {this->RenderWindow->SetParentId(a);};
00094   
00096 
00098   int GetGrayScaleHint() 
00099     {vtkWarningMacro("GetGrayScaleHint deprecated, not required anymore"); return 0;};
00100   void SetGrayScaleHint(int vtkNotUsed(a)) 
00101     {vtkWarningMacro("SetGrayScaleHint deprecated, not required anymore");};
00102   void GrayScaleHintOn()
00103     {vtkWarningMacro("GrayScaleHintOn deprecated, not required anymore");};
00104   void GrayScaleHintOff()
00105     {vtkWarningMacro("GrayScaleHintOff deprecated, not required anymore");};
00107 
00109 
00110   int *GetPosition() {return this->RenderWindow->GetPosition();};
00111   void SetPosition(int a,int b) {this->RenderWindow->SetPosition(a,b);};
00112   virtual void SetPosition(int a[2]);
00114 
00116 
00117   int *GetSize() {return this->RenderWindow->GetSize();};
00118   void SetSize(int a,int b) {this->RenderWindow->SetSize(a,b);};
00119   virtual void SetSize(int a[2]);
00121   
00123 
00124   vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
00125   vtkGetObjectMacro(Renderer, vtkRenderer);
00126   vtkGetObjectMacro(ImageMapper,vtkImageMapper);
00127   vtkGetObjectMacro(Actor2D,vtkActor2D);
00129   
00131   void SetupInteractor(vtkRenderWindowInteractor *);
00132   
00134 
00137   void SetOffScreenRendering(int);
00138   int GetOffScreenRendering();
00139   void OffScreenRenderingOn();
00140   void OffScreenRenderingOff();
00142 
00143 protected:
00144   vtkImageViewer();
00145   ~vtkImageViewer();
00146 
00147   vtkRenderWindow *RenderWindow;
00148   vtkRenderer *Renderer;
00149   vtkImageMapper *ImageMapper;
00150   vtkActor2D     *Actor2D;
00151   int FirstRender;
00152   vtkRenderWindowInteractor *Interactor;
00153   vtkInteractorStyleImage *InteractorStyle;
00154 private:
00155   vtkImageViewer(const vtkImageViewer&);  // Not implemented.
00156   void operator=(const vtkImageViewer&);  // Not implemented.
00157 };
00158 
00159 #endif
00160 
00161