COGS
Computer Graphics Structures library
ScalePreservingTransformSerializer.h
1 /*
2  Copyright (C) Skeletex Research, s.r.o. - All Rights Reserved
3  Unauthorized copying of this file, via any medium is strictly prohibited
4  Proprietary and confidential
5 */
6 #ifndef COGS_SCALE_PRESERVING_TRANSFORM_SERIALIZER_H
7 #define COGS_SCALE_PRESERVING_TRANSFORM_SERIALIZER_H
8 
9 #include <Utils/Serializer.h>
10 #include <Utils/Serializables.h>
11 
12 #include <COGS/API.h>
13 #include <COGS/ScalePreservingTransform.h>
14 
15 
16 namespace cogs
17 {
18 
19  class COGS_API ScalePreservingTransformSerializable
20  {
21  public:
22  ScalePreservingTransformSerializable() = default;
23  ScalePreservingTransformSerializable(const ScalePreservingTransform &);
24 
25  ScalePreservingTransform To() const;
26 
27  friend class cereal::access;
28 
29  public:
30  utils::GlmVec3Serializable translation;
31  utils::GlmQuatSerializable rotation;
32 
33  private:
34  template <class Archive>
35  void serialize(Archive &ar);
36  };
37 
42  : public utils::Serializer<cogs::ScalePreservingTransform, cogs::ScalePreservingTransformSerializable>
43  {
44  public:
46  : Serializer("transformation")
47  {
48  }
49  };
50 
51 
52  template <class Archive>
53  void cogs::ScalePreservingTransformSerializable::serialize(Archive &ar)
54  {
55  ar(
56  CEREAL_NVP(translation),
57  CEREAL_NVP(rotation)
58  );
59  }
60 
61 }
62 
63 #endif /* !COGS_SCALE_PRESERVING_TRANSFORM_SERIALIZER_H */
Namespace of "Computer Graphic Structures" library, which implement many core classes and structures...
Definition: AabbHierarchy.h:8
ScalePreservingTransformSerializer - serialize read and write cogs::ScalePreservingTransform.
Definition: ScalePreservingTransformSerializer.h:41