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

Rendering/vtkImageViewer2.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageViewer2.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 =========================================================================*/
00047 #ifndef __vtkImageViewer2_h
00048 #define __vtkImageViewer2_h
00049 
00050 #include "vtkObject.h"
00051 
00052 #include "vtkRenderWindow.h" // For inline methods
00053 #include "vtkImageActor.h" // For inline methods
00054 #include "vtkImageMapToWindowLevelColors.h" // For inline methods
00055 
00056 class vtkInteractorStyleImage;
00057 
00058 class VTK_RENDERING_EXPORT vtkImageViewer2 : public vtkObject 
00059 {
00060 public:
00061   static vtkImageViewer2 *New();
00062   
00063   vtkTypeRevisionMacro(vtkImageViewer2,vtkObject);
00064   void PrintSelf(ostream& os, vtkIndent indent);
00065 
00067   char *GetWindowName() {return this->RenderWindow->GetWindowName();};
00068 
00070   virtual void Render(void);
00071   
00073 
00074   void SetInput(vtkImageData *in) {this->WindowLevel->SetInput(in);};
00075   vtkImageData *GetInput() { return this->WindowLevel->GetInput();};
00077   
00079 
00080   int GetWholeZMin() {return this->ImageActor->GetWholeZMin();};
00081   int GetWholeZMax() {return this->ImageActor->GetWholeZMax();};
00083   
00085 
00086   int GetZSlice() {return this->ImageActor->GetZSlice();};
00087   void SetZSlice(int s) {this->ImageActor->SetZSlice(s);};
00089   
00091 
00092   float GetColorWindow() {return this->WindowLevel->GetWindow();};
00093   float GetColorLevel() {return this->WindowLevel->GetLevel();};
00094   void SetColorWindow(float s) {this->WindowLevel->SetWindow(s);};
00095   void SetColorLevel(float s) {this->WindowLevel->SetLevel(s);};
00097 
00099 
00100   void SetDisplayId(void *a) {this->RenderWindow->SetDisplayId(a);};
00101   void SetWindowId(void *a) {this->RenderWindow->SetWindowId(a);};
00102   void SetParentId(void *a) {this->RenderWindow->SetParentId(a);};
00104   
00106 
00107   int *GetPosition() {return this->RenderWindow->GetPosition();};
00108   void SetPosition(int a,int b) {this->RenderWindow->SetPosition(a,b);};
00109   virtual void SetPosition(int a[2]);
00111 
00113 
00114   int *GetSize() {return this->RenderWindow->GetSize();};
00115   void SetSize(int a,int b) {this->RenderWindow->SetSize(a,b);};
00116   virtual void SetSize(int a[2]);
00118   
00120 
00121   vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
00122   vtkGetObjectMacro(Renderer, vtkRenderer);
00123   vtkGetObjectMacro(ImageActor,vtkImageActor);
00124   vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
00126   
00128   void SetupInteractor(vtkRenderWindowInteractor *);
00129   
00131 
00134   void SetOffScreenRendering(int);
00135   int GetOffScreenRendering();
00136   void OffScreenRenderingOn();
00137   void OffScreenRenderingOff();
00139 
00140 protected:
00141   vtkImageViewer2();
00142   ~vtkImageViewer2();
00143 
00144   vtkImageMapToWindowLevelColors  *WindowLevel;
00145   vtkRenderWindow *RenderWindow;
00146   vtkRenderer     *Renderer;
00147   vtkImageActor   *ImageActor;
00148   int FirstRender;
00149   vtkRenderWindowInteractor *Interactor;
00150   vtkInteractorStyleImage *InteractorStyle;
00151 private:
00152   vtkImageViewer2(const vtkImageViewer2&);  // Not implemented.
00153   void operator=(const vtkImageViewer2&);  // Not implemented.
00154 };
00155 
00156 #endif
00157 
00158