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.cpp 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #include "abstractrenderdevice.h"
  2. #include <QImage>
  3. #include <QDir>
  4. AbstractRenderDevice::AbstractRenderDevice(QObject *parent) :
  5. QObject(parent)
  6. {
  7. }
  8. AbstractRenderDevice::~AbstractRenderDevice()
  9. {
  10. }
  11. QColor AbstractRenderDevice::getCurrentColor() const
  12. {
  13. return _currentColor;
  14. }
  15. Vector3D AbstractRenderDevice::getLookEye() const
  16. {
  17. return _lookEye;
  18. }
  19. Vector3D AbstractRenderDevice::getLookCenter() const
  20. {
  21. return _lookCenter;
  22. }
  23. Vector3D AbstractRenderDevice::getLookUp() const
  24. {
  25. return _lookUp;
  26. }
  27. void AbstractRenderDevice::setCurrentColor(const QColor &color)
  28. {
  29. _currentColor = color;
  30. }
  31. void AbstractRenderDevice::lookAt(const Vector3D &eye, const Vector3D &center, const Vector3D &up)
  32. {
  33. _lookEye = eye;
  34. _lookCenter = center;
  35. _lookUp = up;
  36. }
  37. void AbstractRenderDevice::loadTextureFromFile(const QVariant &id, const QString &filename)
  38. {
  39. QImage img;
  40. qDebug() << QDir::currentPath() << filename;
  41. if (img.load(filename)) {
  42. loadTexture(id, img);
  43. }
  44. }
  45. QColor AbstractRenderDevice::getClearColor() const
  46. {
  47. return _clearColor;
  48. }
  49. void AbstractRenderDevice::setClearColor(const QColor &clearColor)
  50. {
  51. _clearColor = clearColor;
  52. }