ctkVTKRenderView.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) 2010 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 __ctkVTKRenderView_h
  15. #define __ctkVTKRenderView_h
  16. // Qt includes
  17. #include <QWidget>
  18. // CTK includes
  19. #include <ctkPimpl.h>
  20. #include "CTKVisualizationVTKWidgetsExport.h"
  21. class ctkVTKRenderViewPrivate;
  22. class vtkInteractorObserver;
  23. class vtkRenderWindowInteractor;
  24. class vtkRenderWindow;
  25. class vtkRenderer;
  26. class vtkCamera;
  27. class CTK_VISUALIZATION_VTK_WIDGETS_EXPORT ctkVTKRenderView : public QWidget
  28. {
  29. Q_OBJECT
  30. Q_PROPERTY(QString cornerAnnotationText READ cornerAnnotationText WRITE setCornerAnnotationText)
  31. Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
  32. Q_PROPERTY(bool renderEnabled READ renderEnabled WRITE setRenderEnabled)
  33. public:
  34. /// Constructors
  35. typedef QWidget Superclass;
  36. explicit ctkVTKRenderView(QWidget* parent = 0);
  37. virtual ~ctkVTKRenderView();
  38. /// If a render has already been scheduled, this called is a no-op
  39. void scheduleRender();
  40. /// Force a render even if a render is already ocurring
  41. void forceRender();
  42. /// Get underlying RenderWindow
  43. vtkRenderWindow* renderWindow()const;
  44. /// Set/Get window interactor
  45. vtkRenderWindowInteractor* interactor()const;
  46. void setInteractor(vtkRenderWindowInteractor* newInteractor);
  47. /// Get current interactor style
  48. vtkInteractorObserver* interactorStyle();
  49. /// Set/Get corner annotation \a text
  50. void setCornerAnnotationText(const QString& text);
  51. QString cornerAnnotationText() const;
  52. /// Set/Get background color
  53. void setBackgroundColor(const QColor& newBackgroundColor);
  54. QColor backgroundColor() const;
  55. /// Get active camera
  56. vtkCamera* activeCamera();
  57. /// Reset camera
  58. void resetCamera();
  59. /// Get a reference to the associated vtkRenderer
  60. vtkRenderer* renderer()const;
  61. /// Return if rendering is enabled
  62. bool renderEnabled() const;
  63. /// Enable/Disable rendering
  64. void setRenderEnabled(bool value);
  65. private:
  66. CTK_DECLARE_PRIVATE(ctkVTKRenderView);
  67. };
  68. #endif