vtkLightBoxRendererManager.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. #ifndef __vtkLightBoxRendererManager_h
  2. #define __vtkLightBoxRendererManager_h
  3. #include <vtkObject.h>
  4. #include "ctkVisualizationVTKCoreExport.h"
  5. class vtkRenderWindow;
  6. class vtkRenderer;
  7. class vtkImageData;
  8. class vtkCamera;
  9. class vtkCornerAnnotation;
  10. class CTK_VISUALIZATION_VTK_CORE_EXPORT vtkLightBoxRendererManager : public vtkObject
  11. {
  12. vtkTypeRevisionMacro(vtkLightBoxRendererManager,vtkObject);
  13. void PrintSelf(ostream& os, vtkIndent indent);
  14. static vtkLightBoxRendererManager *New();
  15. void Initialize(vtkRenderWindow* renderWindow);
  16. bool IsInitialized();
  17. /// Set the layer associated with the renderers
  18. /// \note By default, the value is 0
  19. /// \sa vtkRenderer::SetLayer
  20. void SetRendererLayer(int newLayer);
  21. /// Get associated RenderWindow
  22. vtkRenderWindow* GetRenderWindow();
  23. /// Set image data
  24. void SetImageData(vtkImageData* newImageData);
  25. /// Get active camera
  26. /// Note that the same camera is used with all the renderWindowItem
  27. vtkCamera* GetActiveCamera();
  28. /// Set actice camera
  29. void SetActiveCamera(vtkCamera* newActiveCamera);
  30. /// Reset cameras associated with all renderWindowItem
  31. void ResetCamera();
  32. /// Return number of underlying render window Item
  33. /// \note In the current implementation
  34. int GetRenderWindowItemCount();
  35. /// Get a reference to the associated vtkRenderer(s) identified by its \a id
  36. vtkRenderer* GetRenderer(int id);
  37. /// Get a reference to the associated vtkRenderer(s) given its position in the grid
  38. /// \sa GetRenderer(int)
  39. vtkRenderer* GetRenderer(int rowId, int columnId);
  40. /// The layout type determines how the image slices should be displayed
  41. /// within the different render view items.
  42. /// \sa SetRenderWindowLayout() GetRenderWindowLayoutType()
  43. enum RenderWindowLayoutType{LeftRightTopBottom = 0, LeftRightBottomTop};
  44. /// Get current layout type
  45. int GetRenderWindowLayoutType() const;
  46. /// Set current \a layoutType
  47. void SetRenderWindowLayoutType(int layoutType);
  48. /// Split the current vtkRenderWindow in \a rowCount per \a columnCount grid
  49. void SetRenderWindowLayout(int rowCount, int columnCount);
  50. /// Set the \a rowCount
  51. /// \sa SetRenderWindowLayout
  52. void SetRenderWindowRowCount(int newRowCount);
  53. /// Get number of rows
  54. /// \sa SetRenderWindowLayout
  55. int GetRenderWindowRowCount();
  56. /// Set the \a columnCount
  57. /// \sa SetRenderWindowLayout
  58. void SetRenderWindowColumnCount(int newColumnCount);
  59. /// Get number of columns
  60. /// \sa SetRenderWindowLayout
  61. int GetRenderWindowColumnCount();
  62. /// Return True if the render view item identified by \a id is highlighted
  63. bool GetHighlightedById(int id);
  64. /// \brief Return True if the render view item identified by its position in the grid
  65. /// is highlighted
  66. /// \sa GetHighlightedById(int)
  67. bool GetHighlighted(int rowId, int columnId);
  68. /// Highlight / Unhighlight a render view item given its \a id
  69. void SetHighlightedById(int id, bool highlighted);
  70. /// Highlight / Unhighlight a render view item given its position in the grid
  71. /// \sa setHighlighted(int, bool)
  72. void SetHighlighted(int rowId, int columnId, bool highlighted);
  73. /// \sa SetHighlighted SetHighlightedBoxColorById
  74. void SetHighlightedBoxColor(double highlightedBoxColor[3]);
  75. /// \brief Set the color of the box displayed around the highlighted item
  76. /// identified by \a id
  77. /// The highlightedBox is set with a width of 3 screen units.
  78. /// \sa SetHighlightedById SetHighlighted vtkProperty2D::SetLineWidth
  79. double* GetHighlightedBoxColor()const;
  80. /// Convenient function allowing to compute the renderWindowItemId
  81. /// given \a rowId and \a columnId.
  82. /// The following formula is used: ColumnCount * rowId + columnId
  83. /// \note The \a rowCount and \a columnCount correspond to the one set
  84. /// using setRenderWindowLayout.
  85. inline int ComputeRenderWindowItemId(int rowId, int columnId);
  86. /// Set corner annotation \a text
  87. void SetCornerAnnotationText(const std::string& text);
  88. /// Get current corner annotation
  89. const std::string GetCornerAnnotationText()const;
  90. /// Get corner annotation actor
  91. /// The same annotation is associated with all renderers managed by the light box
  92. vtkCornerAnnotation * GetCornerAnnotation()const;
  93. /// Set background color
  94. void SetBackgroundColor(const double newBackgroundColor[3]);
  95. /// Get background color
  96. double* GetBackgroundColor()const;
  97. /// Set color level
  98. void SetColorLevel(double colorLevel);
  99. /// Get color level
  100. double GetColorLevel()const;
  101. /// Set color window
  102. void SetColorWindow(double colorWindow);
  103. /// Get color window
  104. double GetColorWindow()const;
  105. /// Set color Window and color level
  106. void SetColorWindowAndLevel(double colorWindow, double colorLevel);
  107. protected:
  108. vtkLightBoxRendererManager();
  109. ~vtkLightBoxRendererManager();
  110. private:
  111. vtkLightBoxRendererManager(const vtkLightBoxRendererManager&); // Not implemented.
  112. void operator=(const vtkLightBoxRendererManager&); // Not implemented.
  113. //BTX
  114. class vtkInternal;
  115. vtkInternal* Internal;
  116. //ETX
  117. };
  118. #endif