ctkVTKRenderView_p.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) 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_p_h
  15. #define __ctkVTKRenderView_p_h
  16. // Qt includes
  17. #include <QObject>
  18. // CTK includes
  19. #include <ctkPimpl.h>
  20. #include <ctkVTKObject.h>
  21. #include "ctkVTKRenderView.h"
  22. // VTK includes
  23. #include <QVTKWidget.h>
  24. #include <vtkAxesActor.h>
  25. #include <vtkCornerAnnotation.h>
  26. #include <vtkOrientationMarkerWidget.h>
  27. #include <vtkRenderer.h>
  28. #include <vtkRenderWindow.h>
  29. #include <vtkSmartPointer.h>
  30. #include <vtkWeakPointer.h>
  31. class vtkRenderWindowInteractor;
  32. //-----------------------------------------------------------------------------
  33. class ctkVTKRenderViewPrivate : public QObject
  34. {
  35. Q_OBJECT
  36. Q_DECLARE_PUBLIC(ctkVTKRenderView);
  37. protected:
  38. ctkVTKRenderView* const q_ptr;
  39. public:
  40. ctkVTKRenderViewPrivate(ctkVTKRenderView& object);
  41. /// Convenient setup methods
  42. void setupCornerAnnotation();
  43. void setupRendering();
  44. void setupDefaultInteractor();
  45. void zoom(double zoomFactor);
  46. void pitch(int rotateDegrees, ctkVTKRenderView::RotateDirection pitchDirection);
  47. void roll(int rotateDegrees, ctkVTKRenderView::RotateDirection rollDirection);
  48. void yaw(int rotateDegrees, ctkVTKRenderView::RotateDirection yawDirection);
  49. public slots:
  50. void doSpin();
  51. void doRock();
  52. public:
  53. QVTKWidget* VTKWidget;
  54. vtkSmartPointer<vtkRenderer> Renderer;
  55. vtkSmartPointer<vtkRenderWindow> RenderWindow;
  56. bool RenderPending;
  57. bool RenderEnabled;
  58. vtkSmartPointer<vtkAxesActor> Axes;
  59. vtkSmartPointer<vtkOrientationMarkerWidget> Orientation;
  60. vtkSmartPointer<vtkCornerAnnotation> CornerAnnotation;
  61. double ZoomFactor;
  62. int PitchRollYawIncrement;
  63. ctkVTKRenderView::RotateDirection PitchDirection;
  64. ctkVTKRenderView::RotateDirection RollDirection;
  65. ctkVTKRenderView::RotateDirection YawDirection;
  66. ctkVTKRenderView::RotateDirection SpinDirection;
  67. bool SpinEnabled;
  68. int AnimationIntervalMs;
  69. int SpinIncrement;
  70. bool RockEnabled;
  71. int RockIncrement;
  72. int RockLength;
  73. vtkWeakPointer<vtkRenderWindowInteractor> CurrentInteractor;
  74. };
  75. #endif