ctkVTKSliceView.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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.commontk.org/LICENSE
  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. class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKSliceView : public ctkVTKAbstractView
  24. {
  25. Q_OBJECT
  26. Q_ENUMS(RenderWindowLayoutType)
  27. Q_PROPERTY(RenderWindowLayoutType renderWindowLayoutType
  28. READ renderWindowLayoutType WRITE setRenderWindowLayoutType)
  29. Q_PROPERTY(QColor highlightedBoxColor READ highlightedBoxColor WRITE setHighlightedBoxColor)
  30. Q_PROPERTY(double colorLevel READ colorLevel WRITE setColorLevel)
  31. Q_PROPERTY(double colorWindow READ colorWindow WRITE setColorWindow)
  32. public:
  33. /// Constructors
  34. typedef ctkVTKAbstractView Superclass;
  35. explicit ctkVTKSliceView(QWidget* parent = 0);
  36. virtual ~ctkVTKSliceView();
  37. /// The layout type determines how the image slices should be displayed
  38. /// within the different render view items.
  39. /// \sa setRenderWindowLayout() renderWindowLayoutType()
  40. enum RenderWindowLayoutType{LeftRightTopBottom = 0, LeftRightBottomTop};
  41. /// Set active camera
  42. void setActiveCamera(vtkCamera * newActiveCamera);
  43. /// Get lightBoxRendererManager
  44. vtkLightBoxRendererManager* lightBoxRendererManager() const;
  45. /// Get overlay renderer
  46. vtkRenderer* overlayRenderer() const;
  47. /// Get overlay corner annotation actor
  48. /// This corresponds to the cornerAnnotation associated added in the single overlay renderer
  49. vtkCornerAnnotation* overlayCornerAnnotation()const;
  50. /// Set background color
  51. /// \sa vtkLightBoxRendererManager::SetBackgroundColor
  52. virtual void setBackgroundColor(const QColor& newBackgroundColor);
  53. /// Get background color
  54. /// \sa setBackgroundColor();
  55. virtual QColor backgroundColor()const;
  56. /// Get highlightedBox color
  57. /// \sa setHighlightedBoxColor();
  58. QColor highlightedBoxColor()const;
  59. /// Get renderWindow layout type
  60. /// \sa setRenderWindowLayoutType();
  61. RenderWindowLayoutType renderWindowLayoutType()const;
  62. /// Get color level
  63. /// \sa setColorLevel();
  64. double colorLevel()const;
  65. /// Get color window
  66. /// \sa setColorWindow();
  67. double colorWindow()const;
  68. public slots:
  69. /// Reset cameras associated with all renderWindowItem
  70. /// \sa vtkLightBoxRendererManager::ResetCamera
  71. void resetCamera();
  72. /// Set image data
  73. /// \sa vtkLightBoxRendererManager::SetImageData
  74. void setImageData(vtkImageData* newImageData);
  75. /// Set highlightedBox color
  76. /// \sa vtkLightBoxRendererManager::SetHighlightedBoxColor
  77. void setHighlightedBoxColor(const QColor& newHighlightedBoxColor);
  78. /// Set RenderWindow layout type
  79. /// \sa vtkLightBoxRendererManager::SetRenderWindowLayoutType
  80. void setRenderWindowLayoutType(RenderWindowLayoutType layoutType);
  81. /// Set color level
  82. /// \sa vtkLightBoxRendererManager::SetColorLevel
  83. void setColorLevel(double newColorLevel);
  84. /// Set color window
  85. /// \sa vtkLightBoxRendererManager::SetColorWindow
  86. void setColorWindow(double newColorWindow);
  87. /// Change the number of row of the associated lightBox
  88. /// \sa lightBoxRendererManager()
  89. /// \sa vtkLightBoxRendererManager::SetRenderWindowRowCount
  90. void setLightBoxRendererManagerRowCount(int newRowCount);
  91. /// Change the number of column of the associated lightBox
  92. /// \sa lightBoxRendererManager()
  93. /// \sa vtkLightBoxRendererManager::SetRenderWindowColumnCount
  94. void setLightBoxRendererManagerColumnCount(int newColumnCount);
  95. signals:
  96. void resized(const QSize& size);
  97. protected:
  98. virtual void resizeEvent(QResizeEvent * event);
  99. private:
  100. Q_DECLARE_PRIVATE(ctkVTKSliceView);
  101. Q_DISABLE_COPY(ctkVTKSliceView);
  102. };
  103. #endif