ModelInfo.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #include <Array.h>
  3. #include <Text.h>
  4. #include <Writer.h>
  5. #include "TypeRegistry.h"
  6. class ModelInfoFactory;
  7. class ModelInfo : public virtual Framework::ReferenceCounter
  8. {
  9. private:
  10. Framework::Text modelPath;
  11. Framework::RCArray<Framework::Text> texturePaths;
  12. bool transparent;
  13. float size;
  14. public:
  15. ModelInfo();
  16. ModelInfo(const char* modelPath,
  17. Framework::RCArray<Framework::Text> texturePaths,
  18. bool transparent,
  19. float size);
  20. void writeTo(Framework::StreamWriter* zWriter) const;
  21. void setModelPath(Framework::Text path);
  22. void addTexturePath(Framework::Text path);
  23. void setTransparent(bool transparent);
  24. void setSize(float size);
  25. Framework::Text getModelPath() const;
  26. Framework::RCArray<Framework::Text> getTexturePaths() const;
  27. bool isTransparent() const;
  28. float getSize() const;
  29. friend ModelInfoFactory;
  30. };
  31. class ModelInfoFactory : public TypeFactory<ModelInfo>
  32. {
  33. public:
  34. ModelInfoFactory();
  35. ModelInfo* createValue(Framework::JSON::JSONObject* zJson) const override;
  36. void fromJson(
  37. ModelInfo* zResult, Framework::JSON::JSONObject* zJson) const override;
  38. void toJson(ModelInfo* zObject,
  39. Framework::JSON::JSONObject* zResult) const override;
  40. JSONObjectValidationBuilder* addToValidator(
  41. JSONObjectValidationBuilder* builder) const override;
  42. };