CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkVTKSliceView.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __ctkVTKSliceView_h
22 #define __ctkVTKSliceView_h
23 
24 // CTK includes
25 #include "ctkVTKAbstractView.h"
26 #include "vtkVersion.h"
28 class ctkVTKSliceViewPrivate;
29 
30 class vtkCamera;
31 class vtkImageData;
32 class vtkRenderer;
33 class vtkAlgorithmOutput;
34 
38 class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKSliceView : public ctkVTKAbstractView
39 {
40  Q_OBJECT
41  Q_ENUMS(RenderWindowLayoutType)
42  Q_PROPERTY(RenderWindowLayoutType renderWindowLayoutType
43  READ renderWindowLayoutType WRITE setRenderWindowLayoutType)
44  Q_PROPERTY(QColor highlightedBoxColor READ highlightedBoxColor WRITE setHighlightedBoxColor)
45  Q_PROPERTY(double colorLevel READ colorLevel WRITE setColorLevel)
46  Q_PROPERTY(double colorWindow READ colorWindow WRITE setColorWindow)
47 
48 public:
51  explicit ctkVTKSliceView(QWidget* parent = 0);
52  virtual ~ctkVTKSliceView();
53 
57  enum RenderWindowLayoutType{LeftRightTopBottom = 0, LeftRightBottomTop};
58 
60  void setActiveCamera(vtkCamera * newActiveCamera);
61 
63  Q_INVOKABLE vtkLightBoxRendererManager* lightBoxRendererManager() const;
64 
66  vtkRenderer* overlayRenderer() const;
67 
70  vtkCornerAnnotation* overlayCornerAnnotation()const;
71 
74  virtual void setBackgroundColor(const QColor& newBackgroundColor);
75 
78  virtual QColor backgroundColor()const;
79 
82  QColor highlightedBoxColor()const;
83 
86  RenderWindowLayoutType renderWindowLayoutType()const;
87 
90  double colorLevel()const;
91 
94  double colorWindow()const;
95 
96 public Q_SLOTS:
97 
100  void resetCamera();
101 
104 #if (VTK_MAJOR_VERSION <= 5)
105  void setImageData(vtkImageData* newImageData);
106 #else
107  void setImageDataConnection(vtkAlgorithmOutput* newImageDataPort);
108 #endif
109 
112  void setHighlightedBoxColor(const QColor& newHighlightedBoxColor);
113 
116  void setRenderWindowLayoutType(RenderWindowLayoutType layoutType);
117 
120  void setColorLevel(double newColorLevel);
121 
124  void setColorWindow(double newColorWindow);
125 
129  void setLightBoxRendererManagerRowCount(int newRowCount);
130 
134  void setLightBoxRendererManagerColumnCount(int newColumnCount);
135 
136 Q_SIGNALS:
137  void resized(const QSize& size);
138 
139 protected:
140  virtual bool eventFilter(QObject *object, QEvent *event);
141 
142 private:
143  Q_DECLARE_PRIVATE(ctkVTKSliceView);
144  Q_DISABLE_COPY(ctkVTKSliceView);
145 };
146 
147 #endif
virtual void setBackgroundColor(const QColor &newBackgroundColor)
Set the background color of the rendering screen.
virtual QColor backgroundColor() const
Get background color.