object3d.cpp 407 B

12345678910111213141516171819202122232425
  1. #include "object3d.h"
  2. #include "image.h"
  3. namespace wp
  4. {
  5. object3d::object3d (object3d::Type type)
  6. {
  7. this->m_type = type;
  8. }
  9. template <class T> T* object3d::as()
  10. {
  11. return (T*) this;
  12. }
  13. template <class T> bool object3d::is()
  14. {
  15. return false;
  16. }
  17. template <> bool object3d::is<image>()
  18. {
  19. return this->m_type == Type::Type_Image;
  20. }
  21. }