MeshLib
 
Loading...
Searching...
No Matches
MRSerializer.h File Reference
#include "MRMeshFwd.h"
#include "MRVector2.h"
#include "MRVector3.h"
#include "MRVector4.h"
#include "MRMatrix2.h"
#include "MRColor.h"
#include "MRPlane3.h"
#include "MRIOFilters.h"
#include "MRProgressCallback.h"
#include "MRExpected.h"
#include <filesystem>

Go to the source code of this file.

Classes

class  MR::UniqueTemporaryFolder
 

Namespaces

namespace  MR
 

Typedefs

using MR::FolderCallback = std::function<void( const std::filesystem::path& tempFolderName )>
 this callback will be called before compression on serialization and after decompression on deserialization
 

Functions

MRMESH_API Expected< Json::Value > MR::deserializeJsonValue (std::istream &in)
 
MRMESH_API Expected< Json::Value > MR::deserializeJsonValue (const std::string &str)
 
MRMESH_API Expected< Json::Value > MR::deserializeJsonValue (const std::filesystem::path &path)
 
MRMESH_API VoidOrErrStr MR::serializeObjectTree (const Object &object, const std::filesystem::path &path, ProgressCallback progress={}, FolderCallback preCompress={})
 saves object subtree in given scene file (zip/mru)
 
MRMESH_API Expected< std::shared_ptr< Object > > MR::deserializeObjectTree (const std::filesystem::path &path, FolderCallback postDecompress={}, ProgressCallback progressCb={})
 loads objects tree from given scene file (zip/mru)
 
MRMESH_API Expected< std::shared_ptr< Object > > MR::deserializeObjectTreeFromFolder (const std::filesystem::path &folder, ProgressCallback progressCb={})
 loads objects tree from given scene folder
 
MRMESH_API VoidOrErrStr MR::serializeMesh (const Mesh &mesh, const std::filesystem::path &path, const FaceBitSet *selection=nullptr, const char *saveMeshFormat=".mrmesh")
 
MRMESH_API void MR::serializeToJson (const Vector2i &vec, Json::Value &root)
 saves an object into json value
 
MRMESH_API void MR::serializeToJson (const Vector2f &vec, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const Vector3i &vec, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const Vector3f &vec, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const Vector4f &vec, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const Box3i &box, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const Box3f &box, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const Color &col, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const Matrix2f &matrix, Json::Value &root, bool skipIdentity=true)
 
MRMESH_API void MR::serializeToJson (const Matrix3f &matrix, Json::Value &root, bool skipIdentity=true)
 
MRMESH_API void MR::serializeToJson (const AffineXf2f &xf, Json::Value &root, bool skipIdentity=true)
 
MRMESH_API void MR::serializeToJson (const AffineXf3f &xf, Json::Value &root, bool skipIdentity=true)
 
MRMESH_API void MR::serializeToJson (const BitSet &bitset, Json::Value &root)
 
MRMESH_API VoidOrErrStr MR::serializeToJson (const Mesh &mesh, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const Plane3f &plane, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const TriPointf &tp, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const MeshTexture &texture, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const std::vector< TextureId > &texturePerFace, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const std::vector< UVCoord > &uvCoords, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const std::vector< Color > &colors, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const MeshTriPoint &mtp, const MeshTopology &topology, Json::Value &root)
 
MRMESH_API void MR::serializeToJson (const PointOnFace &pf, Json::Value &root)
 
MRMESH_API void MR::serializeViaVerticesToJson (const UndirectedEdgeBitSet &edges, const MeshTopology &topology, Json::Value &root)
 
MRMESH_API void MR::deserializeViaVerticesFromJson (const Json::Value &root, UndirectedEdgeBitSet &edges, const MeshTopology &topology)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, Vector2i &vec)
 loads an object from json value
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, Vector2f &vec)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, Vector3i &vec)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, Vector3f &vec)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, Vector4f &vec)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, Color &col)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, Matrix2f &matrix)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, Matrix3f &matrix)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, AffineXf2f &xf)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, AffineXf3f &xf)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, BitSet &bitset)
 
MRMESH_API Expected< MeshMR::deserializeFromJson (const Json::Value &root, VertColors *colors=nullptr)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, Plane3f &plane)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, TriPointf &tp)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, MeshTexture &texture)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, std::vector< TextureId > &texturePerFace)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, std::vector< UVCoord > &uvCoords)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, std::vector< Color > &colors)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, MeshTriPoint &mtp, const MeshTopology &topology)
 
MRMESH_API void MR::deserializeFromJson (const Json::Value &root, PointOnFace &pf)
 

Variables

MRMESH_API const IOFilters MR::SceneFileFilters
 
MRMESH_API const IOFilters MR::SceneFileWriteFilters