ctkVTKSliceView.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0.txt
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkVTKSliceView_h
  15. #define __ctkVTKSliceView_h
  16. // CTK includes
  17. #include "ctkVTKAbstractView.h"
  18. class vtkLightBoxRendererManager;
  19. class ctkVTKSliceViewPrivate;
  20. class vtkCamera;
  21. class vtkImageData;
  22. class vtkRenderer;
  23. /// \ingroup Visualization_VTK_Widgets
  24. /// Specific implementation for a 2D view that supports lightbox display.
  25. /// \note There is no support for gradient background yet.
  26. class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKSliceView : public ctkVTKAbstractView
  27. {
  28. Q_OBJECT
  29. Q_ENUMS(RenderWindowLayoutType)
  30. Q_PROPERTY(RenderWindowLayoutType renderWindowLayoutType
  31. READ renderWindowLayoutType WRITE setRenderWindowLayoutType)
  32. Q_PROPERTY(QColor highlightedBoxColor READ highlightedBoxColor WRITE setHighlightedBoxColor)
  33. Q_PROPERTY(double colorLevel READ colorLevel WRITE setColorLevel)
  34. Q_PROPERTY(double colorWindow READ colorWindow WRITE setColorWindow)
  35. public:
  36. /// Constructors
  37. typedef ctkVTKAbstractView Superclass;
  38. explicit ctkVTKSliceView(QWidget* parent = 0);
  39. virtual ~ctkVTKSliceView();
  40. /// The layout type determines how the image slices should be displayed
  41. /// within the different render view items.
  42. /// \sa setRenderWindowLayout() renderWindowLayoutType()
  43. enum RenderWindowLayoutType{LeftRightTopBottom = 0, LeftRightBottomTop};
  44. /// Set active camera
  45. void setActiveCamera(vtkCamera * newActiveCamera);
  46. /// Get lightBoxRendererManager
  47. vtkLightBoxRendererManager* lightBoxRendererManager() const;
  48. /// Get overlay renderer
  49. vtkRenderer* overlayRenderer() const;
  50. /// Get overlay corner annotation actor
  51. /// This corresponds to the cornerAnnotation associated added in the single overlay renderer
  52. vtkCornerAnnotation* overlayCornerAnnotation()const;
  53. /// Set background color
  54. /// \sa vtkLightBoxRendererManager::SetBackgroundColor
  55. virtual void setBackgroundColor(const QColor& newBackgroundColor);
  56. /// Get background color
  57. /// \sa setBackgroundColor();
  58. virtual QColor backgroundColor()const;
  59. /// Get highlightedBox color
  60. /// \sa setHighlightedBoxColor();
  61. QColor highlightedBoxColor()const;
  62. /// Get renderWindow layout type
  63. /// \sa setRenderWindowLayoutType();
  64. RenderWindowLayoutType renderWindowLayoutType()const;
  65. /// Get color level
  66. /// \sa setColorLevel();
  67. double colorLevel()const;
  68. /// Get color window
  69. /// \sa setColorWindow();
  70. double colorWindow()const;
  71. public Q_SLOTS:
  72. /// Reset cameras associated with all renderWindowItem
  73. /// \sa vtkLightBoxRendererManager::ResetCamera
  74. void resetCamera();
  75. /// Set image data
  76. /// \sa vtkLightBoxRendererManager::SetImageData
  77. void setImageData(vtkImageData* newImageData);
  78. /// Set highlightedBox color
  79. /// \sa vtkLightBoxRendererManager::SetHighlightedBoxColor
  80. void setHighlightedBoxColor(const QColor& newHighlightedBoxColor);
  81. /// Set RenderWindow layout type
  82. /// \sa vtkLightBoxRendererManager::SetRenderWindowLayoutType
  83. void setRenderWindowLayoutType(RenderWindowLayoutType layoutType);
  84. /// Set color level
  85. /// \sa vtkLightBoxRendererManager::SetColorLevel
  86. void setColorLevel(double newColorLevel);
  87. /// Set color window
  88. /// \sa vtkLightBoxRendererManager::SetColorWindow
  89. void setColorWindow(double newColorWindow);
  90. /// Change the number of row of the associated lightBox
  91. /// \sa lightBoxRendererManager()
  92. /// \sa vtkLightBoxRendererManager::SetRenderWindowRowCount
  93. void setLightBoxRendererManagerRowCount(int newRowCount);
  94. /// Change the number of column of the associated lightBox
  95. /// \sa lightBoxRendererManager()
  96. /// \sa vtkLightBoxRendererManager::SetRenderWindowColumnCount
  97. void setLightBoxRendererManagerColumnCount(int newColumnCount);
  98. Q_SIGNALS:
  99. void resized(const QSize& size);
  100. protected:
  101. virtual void resizeEvent(QResizeEvent * event);
  102. private:
  103. Q_DECLARE_PRIVATE(ctkVTKSliceView);
  104. Q_DISABLE_COPY(ctkVTKSliceView);
  105. };
  106. #endif