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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef ABSTRACTRENDERDEVICE_H
  2. #define ABSTRACTRENDERDEVICE_H
  3. #include <QObject>
  4. #include <QColor>
  5. #include "utils/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. virtual Vector3D get2DFrom3D(const Vector3D& pos) = 0;
  18. virtual Vector3D get3DFrom2D(int x, int y) = 0;
  19. public slots:
  20. virtual void setClearColor(const QColor &getClearColor);
  21. virtual void setCurrentColor(const QColor &color);
  22. virtual void lookAt(const Vector3D& eye, const Vector3D& center, const Vector3D& up = Vector3D(0.0, 1.0, 0.0));
  23. // void loadTextureFromFile(const QVariant& id, const QString& filename);
  24. // virtual void loadTexture(const QVariant& id, const QImage& texture) = 0;
  25. virtual void initialize(int fov, int width, int height) = 0;
  26. virtual void resize(int width, int height) = 0;
  27. virtual void preDraw() = 0;
  28. virtual void postDraw() = 0;
  29. virtual void drawPoint(const ColorVector3D& point) = 0;
  30. virtual void drawLine(const ColorVector3D& begin, const ColorVector3D& end, double width = 1.0) = 0;
  31. virtual void drawPolygon(const QList<ColorVector3D>& points) = 0;
  32. // virtual void drawPolygonTexture(const QList<ColorVector3D>& points) = 0;
  33. protected:
  34. QColor _clearColor;
  35. QColor _currentColor;
  36. Vector3D _lookEye;
  37. Vector3D _lookCenter;
  38. Vector3D _lookUp;
  39. };
  40. #endif // ABSTRACTRENDERDEVICE_H