XPlor/libs/xassets/xpathnodetree.cpp

57 lines
1.0 KiB
C++
Raw Normal View History

2025-08-17 13:14:17 -04:00
#include "xpathnodetree.h"
XPathNodeTree::XPathNodeTree()
: XAsset() {
}
void XPathNodeTree::ParseData(QDataStream *aStream) {
if (GetPtr() == -1) {
aStream->read((char*)&mAxis, sizeof(int));
aStream->read((char*)&mDist, sizeof(float));
// Skip reading the union directly from the stream
// We'll assume we're parsing as children by default
for (int i = 0; i < 2; ++i) {
// Skip reading pointers directly from the stream
aStream->ignore(sizeof(PathNodeTree*));
}
}
}
int XPathNodeTree::GetAxis() const {
return mAxis;
}
void XPathNodeTree::SetAxis(int axis) {
mAxis = axis;
}
float XPathNodeTree::GetDist() const {
return mDist;
}
void XPathNodeTree::SetDist(float dist) {
mDist = dist;
}
PathNodeTreeInfo* XPathNodeTree::GetInfo() const {
return mInfo;
}
void XPathNodeTree::SetInfo(PathNodeTreeInfo* info) {
if (mInfo != nullptr) {
delete mInfo;
}
mInfo = new PathNodeTreeInfo(*info);
}