Advertisement
johan_solo

Test3D-windows-header

Oct 18th, 2017
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. #ifndef WINDOW_H
  2. #define WINDOW_H
  3.  
  4. #include <QtCore/QList>
  5. #include <QtCore/QPoint>
  6.  
  7. #include <Qt3DRender/QWindow>
  8.  
  9. class QWheelEvent;
  10. class QWidget;
  11.  
  12. namespace Qt3DCore
  13. {
  14.     class QAspectEngine;
  15.     class QCamera;
  16.     class QEntity;
  17. }
  18.  
  19. namespace Qt3DInput
  20. {
  21.     class QInputAspect;
  22. }
  23.  
  24. class Window : public Qt3DRender::QWindow
  25. {
  26.     Q_OBJECT
  27. public:
  28.     Window();
  29.     ~Window();
  30.  
  31.     bool initialise();
  32.  
  33.     QWidget* widget();
  34.  
  35. protected slots:
  36.     void wheelEvent( QWheelEvent* event );
  37.     void poorMansZoom( float factor );
  38.     void pan( const QPoint& pt );
  39. private:
  40.     Qt3DCore::QAspectEngine* _Engine;
  41.     Qt3DInput::QInputAspect* _Input;
  42.  
  43.     Qt3DCore::QCamera* _Camera;
  44.  
  45.     Qt3DCore::QEntity* _RootEntity;
  46.     QList< Qt3DCore::QEntity* > _SphereEntities;
  47.  
  48.     QWidget* _Widget;
  49.  
  50.     bool _PanEngaged;
  51.     QPoint _OriginPan;
  52. };
  53.  
  54. #endif // WINDOW_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement