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 
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 "vtkObject.h"
00038 
00039 #include "vtkImageMapper.h" // For all the inline methods
00040 #include "vtkRenderWindow.h" // For all the inline methods
00041 
00042 class vtkInteractorStyleImage;
00043 
00044 class VTK_RENDERING_EXPORT vtkImageViewer : public vtkObject 
00045 {
00046 public:
00047   static vtkImageViewer *New();
00048   
00049   vtkTypeRevisionMacro(vtkImageViewer,vtkObject);
00050   void PrintSelf(ostream& os, vtkIndent indent);
00051 
00053   char *GetWindowName() {return this->RenderWindow->GetWindowName();};
00054 
00056   virtual void Render(void);
00057   
00059 
00060   void SetInput(vtkImageData *in) {this->ImageMapper->SetInput(in);};
00061   vtkImageData *GetInput() { return this->ImageMapper->GetInput();};
00063   
00065 
00066   int GetWholeZMin() {return this->ImageMapper->GetWholeZMin();};
00067   int GetWholeZMax() {return this->ImageMapper->GetWholeZMax();};
00069   
00071 
00072   int GetZSlice() {return this->ImageMapper->GetZSlice();};
00073   void SetZSlice(int s) {this->ImageMapper->SetZSlice(s);};
00075   
00077 
00078   double GetColorWindow() {return this->ImageMapper->GetColorWindow();};
00079   double GetColorLevel() {return this->ImageMapper->GetColorLevel();};
00080   void SetColorWindow(double s) {this->ImageMapper->SetColorWindow(s);};
00081   void SetColorLevel(double s) {this->ImageMapper->SetColorLevel(s);};
00083 
00085 
00086   void SetDisplayId(void *a) {this->RenderWindow->SetDisplayId(a);};
00087   void SetWindowId(void *a) {this->RenderWindow->SetWindowId(a);};
00088   void SetParentId(void *a) {this->RenderWindow->SetParentId(a);};
00090   
00092 
00094   int GetGrayScaleHint() 
00095     {vtkWarningMacro("GetGrayScaleHint deprecated, not required anymore"); return 0;};
00096   void SetGrayScaleHint(int vtkNotUsed(a)) 
00097     {vtkWarningMacro("SetGrayScaleHint deprecated, not required anymore");};
00098   void GrayScaleHintOn()
00099     {vtkWarningMacro("GrayScaleHintOn deprecated, not required anymore");};
00100   void GrayScaleHintOff()
00101     {vtkWarningMacro("GrayScaleHintOff deprecated, not required anymore");};
00103 
00105 
00106   int *GetPosition() {return this->RenderWindow->GetPosition();};
00107   void SetPosition(int a,int b) {this->RenderWindow->SetPosition(a,b);};
00108   virtual void SetPosition(int a[2]);
00110 
00112 
00113   int *GetSize() {return this->RenderWindow->GetSize();};
00114   void SetSize(int a,int b) {this->RenderWindow->SetSize(a,b);};
00115   virtual void SetSize(int a[2]);
00117   
00119 
00120   vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
00121   vtkGetObjectMacro(Renderer, vtkRenderer);
00122   vtkGetObjectMacro(ImageMapper,vtkImageMapper);
00123   vtkGetObjectMacro(Actor2D,vtkActor2D);
00125   
00127   void SetupInteractor(vtkRenderWindowInteractor *);
00128   
00130 
00133   void SetOffScreenRendering(int);
00134   int GetOffScreenRendering();
00135   void OffScreenRenderingOn();
00136   void OffScreenRenderingOff();
00138 
00139 protected:
00140   vtkImageViewer();
00141   ~vtkImageViewer();
00142 
00143   vtkRenderWindow *RenderWindow;
00144   vtkRenderer *Renderer;
00145   vtkImageMapper *ImageMapper;
00146   vtkActor2D     *Actor2D;
00147   int FirstRender;
00148   vtkRenderWindowInteractor *Interactor;
00149   vtkInteractorStyleImage *InteractorStyle;
00150 private:
00151   vtkImageViewer(const vtkImageViewer&);  // Not implemented.
00152   void operator=(const vtkImageViewer&);  // Not implemented.
00153 };
00154 
00155 #endif
00156 
00157