VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vtkImageViewer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageViewer.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
34 #ifndef __vtkImageViewer_h
35 #define __vtkImageViewer_h
36 
37 #include "vtkInteractionImageModule.h" // For export macro
38 #include "vtkObject.h"
39 
40 #include "vtkImageMapper.h" // For all the inline methods
41 #include "vtkRenderWindow.h" // For all the inline methods
42 
44 
45 class VTKINTERACTIONIMAGE_EXPORT vtkImageViewer : public vtkObject
46 {
47 public:
48  static vtkImageViewer *New();
49 
50  vtkTypeMacro(vtkImageViewer,vtkObject);
51  void PrintSelf(ostream& os, vtkIndent indent);
52 
54  char *GetWindowName() {return this->RenderWindow->GetWindowName();};
55 
57  virtual void Render(void);
58 
60 
61  void SetInputData(vtkImageData *in) {this->ImageMapper->SetInputData(in);};
62  vtkImageData *GetInput() { return this->ImageMapper->GetInput();};
63  virtual void SetInputConnection(vtkAlgorithmOutput* input) {
64  this->ImageMapper->SetInputConnection(input);};
66 
68 
69  int GetWholeZMin() {return this->ImageMapper->GetWholeZMin();};
70  int GetWholeZMax() {return this->ImageMapper->GetWholeZMax();};
72 
74 
75  int GetZSlice() {return this->ImageMapper->GetZSlice();};
76  void SetZSlice(int s) {this->ImageMapper->SetZSlice(s);};
78 
80 
81  double GetColorWindow() {return this->ImageMapper->GetColorWindow();};
82  double GetColorLevel() {return this->ImageMapper->GetColorLevel();};
83  void SetColorWindow(double s) {this->ImageMapper->SetColorWindow(s);};
84  void SetColorLevel(double s) {this->ImageMapper->SetColorLevel(s);};
86 
88 
89  void SetDisplayId(void *a) {this->RenderWindow->SetDisplayId(a);};
90  void SetWindowId(void *a) {this->RenderWindow->SetWindowId(a);};
91  void SetParentId(void *a) {this->RenderWindow->SetParentId(a);};
93 
95 
96  int *GetPosition() {return this->RenderWindow->GetPosition();};
97  void SetPosition(int a,int b) {this->RenderWindow->SetPosition(a,b);};
98  virtual void SetPosition(int a[2]);
100 
102 
103  int *GetSize() {return this->RenderWindow->GetSize();};
104  void SetSize(int a,int b) {this->RenderWindow->SetSize(a,b);};
105  virtual void SetSize(int a[2]);
107 
109 
110  vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
111  vtkGetObjectMacro(Renderer, vtkRenderer);
112  vtkGetObjectMacro(ImageMapper,vtkImageMapper);
113  vtkGetObjectMacro(Actor2D,vtkActor2D);
115 
117  void SetupInteractor(vtkRenderWindowInteractor *);
118 
120 
123  void SetOffScreenRendering(int);
124  int GetOffScreenRendering();
125  void OffScreenRenderingOn();
126  void OffScreenRenderingOff();
128 
129 protected:
130  vtkImageViewer();
131  ~vtkImageViewer();
132 
133  vtkRenderWindow *RenderWindow;
134  vtkRenderer *Renderer;
135  vtkImageMapper *ImageMapper;
136  vtkActor2D *Actor2D;
138  vtkRenderWindowInteractor *Interactor;
140 
141  friend class vtkImageViewerCallback;
142  vtkAlgorithm* GetInputAlgorithm();
143 
144 private:
145  vtkImageViewer(const vtkImageViewer&); // Not implemented.
146  void operator=(const vtkImageViewer&); // Not implemented.
147 };
148 
149 #endif
vtkImageMapper * ImageMapper
vtkRenderWindowInteractor * Interactor
void SetColorWindow(double s)
void SetWindowId(void *a)
void SetParentId(void *a)
vtkInteractorStyleImage * InteractorStyle
vtkRenderer * Renderer
Display a 2d image.
double GetColorWindow()
Proxy object to connect input/output ports.
interactive manipulation of the camera specialized for images
void SetPosition(int a, int b)
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:60
vtkImageData * GetInput()
void SetColorLevel(double s)
void SetZSlice(int s)
char * GetWindowName()
int * GetPosition()
void SetSize(int a, int b)
double GetColorLevel()
vtkRenderWindow * RenderWindow
virtual void SetInputConnection(vtkAlgorithmOutput *input)
vtkActor2D * Actor2D
void SetInputData(vtkImageData *in)
void SetDisplayId(void *a)