Asynchronous loading of Scene3D resources
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / loader / mesh-definition.h
index 445fbe7..1030c7c 100644 (file)
@@ -86,6 +86,12 @@ struct DALI_SCENE3D_API MeshDefinition
 
     Blob() = default;
 
+    Blob(const Blob&) = default;
+    Blob& operator=(const Blob&) = default;
+
+    Blob(Blob&&)  = default;
+    Blob& operator=(Blob&&) = default;
+
     Blob(uint32_t offset, uint32_t length, uint16_t stride = 0, uint16_t elementSizeHint = 0, const std::vector<float>& min = {}, const std::vector<float>& max = {});
 
     /**
@@ -138,7 +144,14 @@ struct DALI_SCENE3D_API MeshDefinition
   {
     SparseBlob() = default;
 
+    SparseBlob(const SparseBlob&) = default;
+    SparseBlob& operator=(const SparseBlob&) = default;
+
+    SparseBlob(SparseBlob&&) = default;
+    SparseBlob& operator=(SparseBlob&&) = default;
+
     SparseBlob(const Blob& indices, const Blob& values, uint32_t count);
+    SparseBlob(Blob&& indices, Blob&& values, uint32_t count);
 
     Blob     mIndices;
     Blob     mValues;
@@ -160,6 +173,8 @@ struct DALI_SCENE3D_API MeshDefinition
 
     Accessor(const MeshDefinition::Blob&       blob,
              const MeshDefinition::SparseBlob& sparse);
+    Accessor(MeshDefinition::Blob&&       blob,
+             MeshDefinition::SparseBlob&& sparse);
 
     bool IsDefined() const
     {
@@ -253,18 +268,19 @@ struct DALI_SCENE3D_API MeshDefinition
   MeshGeometry Load(RawData&& raw) const;
 
 public: // DATA
-  uint32_t       mFlags         = 0x0;
-  Geometry::Type mPrimitiveType = Geometry::TRIANGLES;
-  std::string    mUri;
-  Accessor       mIndices;
-  Accessor       mPositions;
-  Accessor       mNormals; // data can be generated based on positions
-  Accessor       mTexCoords;
-  Accessor       mColors;
-  Accessor       mTangents; // data can be generated based on normals and texCoords (the latter isn't mandatory; the results will be better if available)
-  Accessor       mJoints0;
-  Accessor       mWeights0;
-  Property::Type mTangentType{Property::VECTOR3};
+  std::shared_ptr<RawData> mRawData;
+  uint32_t                 mFlags         = 0x0;
+  Geometry::Type           mPrimitiveType = Geometry::TRIANGLES;
+  std::string              mUri;
+  Accessor                 mIndices;
+  Accessor                 mPositions;
+  Accessor                 mNormals; // data can be generated based on positions
+  Accessor                 mTexCoords;
+  Accessor                 mColors;
+  Accessor                 mTangents; // data can be generated based on normals and texCoords (the latter isn't mandatory; the results will be better if available)
+  Accessor                 mJoints0;
+  Accessor                 mWeights0;
+  Property::Type           mTangentType{Property::VECTOR3};
 
   Blob                    mBlendShapeHeader;
   std::vector<BlendShape> mBlendShapes;