mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
More comments, stubbing out incremental streaming.
This commit is contained in:
parent
71bbbac1c0
commit
531c32fdd3
3 changed files with 21 additions and 4 deletions
|
@ -1104,7 +1104,7 @@ private:
|
||||||
Q_DECLARE_METATYPE(const QMetaObject*)
|
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
|
/// 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);
|
#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
|
/// 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>());
|
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
|
/// 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
|
/// type flagged as STREAMABLE in its header file. The type should have a no-argument constructor. The last lines of this
|
||||||
/// phase.
|
/// macro ensure that the generated file will be included in the link phase.
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define DECLARE_STREAMABLE_METATYPE(X) Q_DECLARE_METATYPE(X) \
|
#define DECLARE_STREAMABLE_METATYPE(X) Q_DECLARE_METATYPE(X) \
|
||||||
Bitstream& operator<<(Bitstream& out, const X& obj); \
|
Bitstream& operator<<(Bitstream& out, const X& obj); \
|
||||||
|
|
|
@ -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* MetavoxelData::createRoot(const AttributePointer& attribute) {
|
||||||
MetavoxelNode*& root = _roots[attribute];
|
MetavoxelNode*& root = _roots[attribute];
|
||||||
if (root) {
|
if (root) {
|
||||||
|
|
|
@ -54,7 +54,8 @@ public:
|
||||||
|
|
||||||
DECLARE_STREAMABLE_METATYPE(MetavoxelLOD)
|
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 {
|
class MetavoxelData {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -64,11 +65,14 @@ public:
|
||||||
|
|
||||||
MetavoxelData& operator=(const MetavoxelData& other);
|
MetavoxelData& operator=(const MetavoxelData& other);
|
||||||
|
|
||||||
|
/// Sets the size in all dimensions.
|
||||||
void setSize(float size) { _size = size; }
|
void setSize(float size) { _size = size; }
|
||||||
float getSize() const { return _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; }
|
glm::vec3 getMinimum() const { return glm::vec3(_size, _size, _size) * -0.5f; }
|
||||||
|
|
||||||
|
/// Returns the bounds of the octrees.
|
||||||
Box getBounds() const;
|
Box getBounds() const;
|
||||||
|
|
||||||
/// Applies the specified visitor to the contained voxels.
|
/// Applies the specified visitor to the contained voxels.
|
||||||
|
@ -107,6 +111,11 @@ public:
|
||||||
void writeDelta(const MetavoxelData& reference, const MetavoxelLOD& referenceLOD,
|
void writeDelta(const MetavoxelData& reference, const MetavoxelLOD& referenceLOD,
|
||||||
Bitstream& out, const MetavoxelLOD& lod) const;
|
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* getRoot(const AttributePointer& attribute) const { return _roots.value(attribute); }
|
||||||
MetavoxelNode* createRoot(const AttributePointer& attribute);
|
MetavoxelNode* createRoot(const AttributePointer& attribute);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue