ctkVTKRenderView.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. public:
  31. /// Constructors
  32. typedef QWidget Superclass;
  33. explicit ctkVTKRenderView(QWidget* parent = 0);
  34. virtual ~ctkVTKRenderView();
  35. /// If a render has already been scheduled, this called is a no-op
  36. void scheduleRender();
  37. /// Force a render even if a render is already ocurring
  38. void forceRender();
  39. /// Get underlying RenderWindow
  40. vtkRenderWindow* renderWindow()const;
  41. /// Set/Get window interactor
  42. vtkRenderWindowInteractor* interactor()const;
  43. void setInteractor(vtkRenderWindowInteractor* newInteractor);
  44. /// Get current interactor style
  45. vtkInteractorObserver* interactorStyle();
  46. /// Set corner annotation text
  47. void setCornerAnnotationText(const QString& text);
  48. /// Set background color
  49. void setBackgroundColor(double r, double g, double b);
  50. /// Get active camera
  51. vtkCamera* activeCamera();
  52. /// Reset camera
  53. void resetCamera();
  54. /// Get a reference to the associated vtkRenderer
  55. vtkRenderer* renderer()const;
  56. /// Enable/Disable rendering
  57. void setRenderEnabled(bool value);
  58. private:
  59. CTK_DECLARE_PRIVATE(ctkVTKRenderView);
  60. };
  61. #endif