More comments, stubbing out incremental streaming.

This commit is contained in:
Andrzej Kapolka 2014-06-18 18:07:50 -07:00
parent 71bbbac1c0
commit 531c32fdd3
3 changed files with 21 additions and 4 deletions

View file

@ -1104,7 +1104,7 @@ private:
Q_DECLARE_METATYPE(const QMetaObject*)
/// Macro for registering streamable meta-objects. Typically, one would use this macro at the top level of the source file
/// associated with the class.
/// associated with the class. The class should have a no-argument constructor flagged with Q_INVOKABLE.
#define REGISTER_META_OBJECT(x) static int x##Registration = Bitstream::registerMetaObject(#x, &x::staticMetaObject);
/// Contains a value along with a pointer to its streamer. This is stored in QVariants when using fallback generics and
@ -1563,8 +1563,8 @@ public:
Bitstream::registerTypeStreamer(qMetaTypeId<X>(), new CollectionTypeStreamer<X>());
/// Declares the metatype and the streaming operators. Typically, one would use this immediately after the definition of a
/// type flagged as STREAMABLE in its header file. The last lines ensure that the generated file will be included in the link
/// phase.
/// type flagged as STREAMABLE in its header file. The type should have a no-argument constructor. The last lines of this
/// macro ensure that the generated file will be included in the link phase.
#ifdef _WIN32
#define DECLARE_STREAMABLE_METATYPE(X) Q_DECLARE_METATYPE(X) \
Bitstream& operator<<(Bitstream& out, const X& obj); \

View file

@ -602,6 +602,14 @@ void MetavoxelData::writeDelta(const MetavoxelData& reference, const MetavoxelLO
}
}
void MetavoxelData::readIncrementalDelta(const MetavoxelData& reference, const MetavoxelLOD& referenceLOD,
Bitstream& in, const MetavoxelLOD& lod) {
}
void MetavoxelData::writeIncrementalDelta(const MetavoxelData& reference, const MetavoxelLOD& referenceLOD,
Bitstream& out, const MetavoxelLOD& lod) const {
}
MetavoxelNode* MetavoxelData::createRoot(const AttributePointer& attribute) {
MetavoxelNode*& root = _roots[attribute];
if (root) {

View file

@ -54,7 +54,8 @@ public:
DECLARE_STREAMABLE_METATYPE(MetavoxelLOD)
/// The base metavoxel representation shared between server and client.
/// The base metavoxel representation shared between server and client. Contains a size (for all dimensions) and a set of
/// octrees for different attributes.
class MetavoxelData {
public:
@ -64,11 +65,14 @@ public:
MetavoxelData& operator=(const MetavoxelData& other);
/// Sets the size in all dimensions.
void setSize(float size) { _size = size; }
float getSize() const { return _size; }
/// Returns the minimum extent of the octrees (which are centered about the origin).
glm::vec3 getMinimum() const { return glm::vec3(_size, _size, _size) * -0.5f; }
/// Returns the bounds of the octrees.
Box getBounds() const;
/// Applies the specified visitor to the contained voxels.
@ -107,6 +111,11 @@ public:
void writeDelta(const MetavoxelData& reference, const MetavoxelLOD& referenceLOD,
Bitstream& out, const MetavoxelLOD& lod) const;
void readIncrementalDelta(const MetavoxelData& reference, const MetavoxelLOD& referenceLOD,
Bitstream& in, const MetavoxelLOD& lod);
void writeIncrementalDelta(const MetavoxelData& reference, const MetavoxelLOD& referenceLOD,
Bitstream& out, const MetavoxelLOD& lod) const;
MetavoxelNode* getRoot(const AttributePointer& attribute) const { return _roots.value(attribute); }
MetavoxelNode* createRoot(const AttributePointer& attribute);