refactor: standardize object type identification using uLibTypeMacro and update serialization macros
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "Geometry.h"
|
||||
#include "Core/Object.h"
|
||||
#include "Core/Property.h"
|
||||
#include "Core/Serializable.h"
|
||||
#include "Math/Dense.h"
|
||||
#include "Math/Transform.h"
|
||||
#include <utility>
|
||||
@@ -48,16 +49,11 @@ namespace uLib {
|
||||
*/
|
||||
class ContainerBox : public TRS {
|
||||
|
||||
public:
|
||||
uLibTypeMacro(ContainerBox, TRS)
|
||||
ULIB_SERIALIZE_ACCESS
|
||||
ULIB_DECLARE_PROPERTIES(ContainerBox)
|
||||
|
||||
virtual const char * GetClassName() const override { return "ContainerBox"; }
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// PROPERTIES //
|
||||
|
||||
Vector3f Size;
|
||||
Vector3f Origin;
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief Default constructor.
|
||||
@@ -67,7 +63,6 @@ public:
|
||||
: m_LocalT(this), // BaseClass is Parent of m_LocalTransform
|
||||
Size(1.0f, 1.0f, 1.0f),
|
||||
Origin(0.0f, 0.0f, 0.0f) {
|
||||
ULIB_ACTIVATE_PROPERTIES(*this);
|
||||
this->Sync();
|
||||
}
|
||||
|
||||
@@ -79,7 +74,6 @@ public:
|
||||
: m_LocalT(this),
|
||||
Size(size),
|
||||
Origin(0.0f, 0.0f, 0.0f) {
|
||||
ULIB_ACTIVATE_PROPERTIES(*this);
|
||||
this->Sync();
|
||||
}
|
||||
|
||||
@@ -92,13 +86,12 @@ public:
|
||||
TRS(copy),
|
||||
Size(copy.Size),
|
||||
Origin(copy.Origin) {
|
||||
ULIB_ACTIVATE_PROPERTIES(*this);
|
||||
this->Sync();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Serialization template for property registration and persistence.
|
||||
*/
|
||||
// /**
|
||||
// * @brief Serialization template for property registration and persistence.
|
||||
// */
|
||||
template <class ArchiveT>
|
||||
void serialize(ArchiveT & ar, const unsigned int version) {
|
||||
ar & HRP(Size);
|
||||
@@ -236,9 +229,13 @@ private:
|
||||
|
||||
|
||||
private:
|
||||
Vector3f Size;
|
||||
Vector3f Origin;
|
||||
AffineTransform m_LocalT;
|
||||
|
||||
};
|
||||
|
||||
} // namespace uLib
|
||||
|
||||
|
||||
#endif // CONTAINERBOX_H
|
||||
|
||||
Reference in New Issue
Block a user