ctkVTKRenderView.h 2.0 KB

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