28using FolderCallback = std::function<void(
const std::filesystem::path& tempFolderName )>;
38 explicit operator bool()
const
40 return !folder_.empty();
42 operator const std::filesystem::path& ( )
const
46 std::filesystem::path
operator /(
const std::filesystem::path& child )
const
48 return folder_ / child;
52 std::filesystem::path folder_;
101 const char * saveMeshFormat =
".mrmesh" );
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRDotNet/MRBitSet.h:39
container of bits
Definition MRMesh/MRBitSet.h:26
Definition MRMesh/MRMeshTopology.h:18
named object in the data model
Definition MRObject.h:60
Definition MRSerializer.h:31
MRMESH_API ~UniqueTemporaryFolder()
removes folder with all its content
MRMESH_API UniqueTemporaryFolder(FolderCallback onPreTempFolderDelete)
creates new folder in temp directory
std::filesystem::path operator/(const std::filesystem::path &child) const
Definition MRSerializer.h:46
represents a 3-dimentional float-typed vector
Definition MRDotNet/MRVector3.h:8
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:589
std::vector< IOFilter > IOFilters
Definition MRIOFilters.h:23
MRMESH_API const IOFilters SceneFileFilters
std::function< void(const std::filesystem::path &tempFolderName)> FolderCallback
this callback will be called before compression on serialization and after decompression on deseriali...
Definition MRSerializer.h:28
MRMESH_API Expected< std::shared_ptr< Object > > deserializeObjectTree(const std::filesystem::path &path, FolderCallback postDecompress={}, ProgressCallback progressCb={})
loads objects tree from given scene file (zip/mru)
MRMESH_API Expected< Json::Value > deserializeJsonValue(std::istream &in)
MRMESH_API const IOFilters SceneFileWriteFilters
MRMESH_API void deserializeFromJson(const Json::Value &root, Vector2i &vec)
loads an object from json value
MRMESH_API Expected< std::shared_ptr< Object > > deserializeObjectTreeFromFolder(const std::filesystem::path &folder, ProgressCallback progressCb={})
loads objects tree from given scene folder
MRMESH_API void serializeViaVerticesToJson(const UndirectedEdgeBitSet &edges, const MeshTopology &topology, Json::Value &root)
MRMESH_API void deserializeViaVerticesFromJson(const Json::Value &root, UndirectedEdgeBitSet &edges, const MeshTopology &topology)
MRMESH_API VoidOrErrStr serializeObjectTree(const Object &object, const std::filesystem::path &path, ProgressCallback progress={}, FolderCallback preCompress={})
saves object subtree in given scene file (zip/mru)
MRMESH_API VoidOrErrStr serializeMesh(const Mesh &mesh, const std::filesystem::path &path, const FaceBitSet *selection=nullptr, const char *saveMeshFormat=".mrmesh")
MRMESH_API void serializeToJson(const Vector2i &vec, Json::Value &root)
saves an object into json value
Definition MRCameraOrientationPlugin.h:7
tl::expected< T, E > Expected
Definition MRExpected.h:49
MRMESH_CLASS Vector3< double > Matrix2< double > Matrix4< double > SymMatrix3< double > AffineXf2f
Definition MRMesh/MRMeshFwd.h:201
Expected< void > VoidOrErrStr
return type for a void function that can produce an error string
Definition MRExpected.h:60
Definition MRMeshTexture.h:13
Definition MRMesh/MRMeshTriPoint.h:23
Definition MRMesh/MRMesh.h:23
Definition MRPointOnFace.h:11