You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

abstractrenderdevice.h 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef ABSTRACTRENDERDEVICE_H
  2. #define ABSTRACTRENDERDEVICE_H
  3. #include <QObject>
  4. #include <QColor>
  5. #include "colorvector3d.h"
  6. class AbstractRenderDevice : public QObject
  7. {
  8. Q_OBJECT
  9. public:
  10. explicit AbstractRenderDevice(QObject *parent = 0);
  11. virtual ~AbstractRenderDevice();
  12. QColor getCurrentColor() const;
  13. Vector3D getLookEye() const;
  14. Vector3D getLookCenter() const;
  15. Vector3D getLookUp() const;
  16. QColor getClearColor() const;
  17. public slots:
  18. virtual void setClearColor(const QColor &getClearColor);
  19. virtual void setCurrentColor(const QColor &color);
  20. virtual void lookAt(const Vector3D& eye, const Vector3D& center, const Vector3D& up = Vector3D(0.0, 1.0, 0.0));
  21. virtual void initialize(int fov, int width, int height) = 0;
  22. virtual void resize(int width, int height) = 0;
  23. virtual void preDraw() = 0;
  24. virtual void postDraw() = 0;
  25. virtual void drawPoint(const ColorVector3D& point) = 0;
  26. virtual void drawLine(const ColorVector3D& begin, const ColorVector3D& end, double width = 1.0) = 0;
  27. virtual void drawPolygon(const QList<ColorVector3D>& points) = 0;
  28. protected:
  29. QColor _clearColor;
  30. QColor _currentColor;
  31. Vector3D _lookEye;
  32. Vector3D _lookCenter;
  33. Vector3D _lookUp;
  34. };
  35. #endif // ABSTRACTRENDERDEVICE_H