more serialization fixes

metadata
Wenzel Jakob 2012-10-16 13:24:46 -04:00
parent eabc3f17bc
commit b8d4aeb524
5 changed files with 10 additions and 3 deletions

View File

@ -231,7 +231,7 @@ protected:
return result;
}
inline StaticOctree() { }
inline StaticOctree() : m_root(NULL) { }
protected:
AABB m_aabb;
std::vector<Item> m_items;

View File

@ -437,7 +437,7 @@ public:
std::vector<IrradianceSample> &samples = proc->getIrradianceSampleVector()->get();
sa /= samples.size();
for (size_t i=0; i<samples.size(); ++i)
samples[i].area = sa;

View File

@ -114,6 +114,7 @@ public:
inline IrradianceSample(Stream *stream) {
p = Point(stream);
E = Spectrum(stream);
area = stream->readFloat();
}
/**
@ -127,6 +128,7 @@ public:
inline void serialize(Stream *stream) const {
p.serialize(stream);
E.serialize(stream);
stream->writeFloat(area);
}
/// Return the position (used by the octree code)

View File

@ -35,6 +35,8 @@ IrradianceOctree::IrradianceOctree(const AABB &bounds, Float solidAngleThreshold
IrradianceOctree::IrradianceOctree(Stream *stream, InstanceManager *manager) {
m_aabb = AABB(stream);
m_maxDepth = stream->readUInt();
m_maxItems = stream->readUInt();
m_solidAngleThreshold = stream->readFloat();
size_t items = stream->readSize();
@ -49,6 +51,8 @@ IrradianceOctree::IrradianceOctree(Stream *stream, InstanceManager *manager) {
void IrradianceOctree::serialize(Stream *stream, InstanceManager *manager) const {
m_aabb.serialize(stream);
stream->writeUInt(m_maxDepth);
stream->writeUInt(m_maxItems);
stream->writeFloat(m_solidAngleThreshold);
stream->writeSize(m_items.size());
@ -98,5 +102,5 @@ void IrradianceOctree::propagate(OctreeNode *node) {
++statsNumNodes;
}
MTS_IMPLEMENT_CLASS_S(IrradianceOctree, false, SerializableObject)
MTS_NAMESPACE_END

View File

@ -42,6 +42,7 @@ public:
performQuery(m_aabb, m_root, query);
}
MTS_DECLARE_CLASS()
protected:
/// Propagate irradiance approximations througout the tree
void propagate(OctreeNode *node);