vtkLightBoxRendererManager.h 4.3 KB

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