MeshLib C++ Docs
Loading...
Searching...
No Matches

Classes

struct  MR::CompressZipSettings

Functions

Expected< std::string > MR::serializeJsonValue (const Json::Value &root)
Expected< void > MR::serializeJsonValue (const Json::Value &root, std::ostream &out)
Expected< void > MR::serializeJsonValue (const Json::Value &root, const std::filesystem::path &path)
 important on Windows: in stream must be open in binary mode
Expected< Json::Value > MR::deserializeJsonValue (std::istream &in)
Expected< Json::Value > MR::deserializeJsonValue (const char *data, size_t size)
 important on Windows: in stream must be open in binary mode
Expected< Json::Value > MR::deserializeJsonValue (const std::string &str)
Expected< Json::Value > MR::deserializeJsonValue (const std::filesystem::path &path)
Expected< void > MR::serializeMesh (const Mesh &mesh, const std::filesystem::path &path, const FaceBitSet *selection=nullptr, const char *serializeFormat=".mrmesh")
void MR::serializeToJson (const Vector2i &vec, Json::Value &root)
 saves an object into json value
void MR::serializeToJson (const Vector2f &vec, Json::Value &root)
void MR::serializeToJson (const Vector3i &vec, Json::Value &root)
void MR::serializeToJson (const Vector3f &vec, Json::Value &root)
void MR::serializeToJson (const Vector4f &vec, Json::Value &root)
void MR::serializeToJson (const Box3i &box, Json::Value &root)
void MR::serializeToJson (const Box3f &box, Json::Value &root)
void MR::serializeToJson (const Color &col, Json::Value &root)
void MR::serializeToJson (const Matrix2f &matrix, Json::Value &root, bool skipIdentity=true)
void MR::serializeToJson (const Matrix3f &matrix, Json::Value &root, bool skipIdentity=true)
void MR::serializeToJson (const AffineXf2f &xf, Json::Value &root, bool skipIdentity=true)
void MR::serializeToJson (const AffineXf3f &xf, Json::Value &root, bool skipIdentity=true)
void MR::serializeToJson (const BitSet &bitset, Json::Value &root)
Expected< void > MR::serializeToJson (const Mesh &mesh, Json::Value &root)
void MR::serializeToJson (const Plane3f &plane, Json::Value &root)
void MR::serializeToJson (const TriPointf &tp, Json::Value &root)
void MR::serializeToJson (const MeshTexture &texture, Json::Value &root)
void MR::serializeToJson (const std::vector< TextureId > &texturePerFace, Json::Value &root)
void MR::serializeToJson (const std::vector< UVCoord > &uvCoords, Json::Value &root)
void MR::serializeToJson (const std::vector< Color > &colors, Json::Value &root)
void MR::serializeToJson (const MeshTriPoint &mtp, const MeshTopology &topology, Json::Value &root)
void MR::serializeToJson (const PointOnFace &pf, Json::Value &root)
void MR::serializeViaVerticesToJson (const UndirectedEdgeBitSet &edges, const MeshTopology &topology, Json::Value &root)
void MR::deserializeViaVerticesFromJson (const Json::Value &root, UndirectedEdgeBitSet &edges, const MeshTopology &topology)
void MR::deserializeFromJson (const Json::Value &root, Vector2i &vec)
 loads an object from json value
void MR::deserializeFromJson (const Json::Value &root, Vector2f &vec)
void MR::deserializeFromJson (const Json::Value &root, Vector3i &vec)
void MR::deserializeFromJson (const Json::Value &root, Vector3f &vec)
void MR::deserializeFromJson (const Json::Value &root, Vector4f &vec)
void MR::deserializeFromJson (const Json::Value &root, Color &col)
void MR::deserializeFromJson (const Json::Value &root, Matrix2f &matrix)
void MR::deserializeFromJson (const Json::Value &root, Matrix3f &matrix)
void MR::deserializeFromJson (const Json::Value &root, AffineXf2f &xf)
void MR::deserializeFromJson (const Json::Value &root, AffineXf3f &xf)
void MR::deserializeFromJson (const Json::Value &root, BitSet &bitset)
Expected< MeshMR::deserializeFromJson (const Json::Value &root, VertColors *colors=nullptr)
void MR::deserializeFromJson (const Json::Value &root, Plane3f &plane)
void MR::deserializeFromJson (const Json::Value &root, TriPointf &tp)
void MR::deserializeFromJson (const Json::Value &root, MeshTexture &texture)
void MR::deserializeFromJson (const Json::Value &root, std::vector< TextureId > &texturePerFace)
void MR::deserializeFromJson (const Json::Value &root, std::vector< UVCoord > &uvCoords)
void MR::deserializeFromJson (const Json::Value &root, std::vector< Color > &colors)
void MR::deserializeFromJson (const Json::Value &root, MeshTriPoint &mtp, const MeshTopology &topology)
void MR::deserializeFromJson (const Json::Value &root, PointOnFace &pf)
Expected< void > MR::decompressZip (const std::filesystem::path &zipFile, const std::filesystem::path &targetFolder, const char *password=nullptr)
 decompresses given zip-file into given folder
Expected< void > MR::decompressZip (std::istream &zipStream, const std::filesystem::path &targetFolder, const char *password=nullptr)
 decompresses given binary stream (containing the data of a zip file only) into given folder
Expected< void > MR::compressZip (const std::filesystem::path &zipFile, const std::filesystem::path &sourceFolder, const CompressZipSettings &settings={})
 compresses given folder in given zip-file
Expected< void > MR::compressZip (const std::filesystem::path &zipFile, const std::filesystem::path &sourceFolder, const std::vector< std::filesystem::path > &excludeFiles, const char *password=nullptr, ProgressCallback cb={})
 compresses given folder in given zip-file

Detailed Description

Function Documentation

◆ compressZip() [1/2]

Expected< void > MR::compressZip ( const std::filesystem::path & zipFile,
const std::filesystem::path & sourceFolder,
const CompressZipSettings & settings = {} )

#include <MRMesh/MRZip.h>

compresses given folder in given zip-file

◆ compressZip() [2/2]

Expected< void > MR::compressZip ( const std::filesystem::path & zipFile,
const std::filesystem::path & sourceFolder,
const std::vector< std::filesystem::path > & excludeFiles,
const char * password = nullptr,
ProgressCallback cb = {} )

#include <MRMesh/MRZip.h>

compresses given folder in given zip-file

Parameters
excludeFilesfiles that should not be included to result zip
passwordif password is given then the archive will be encrypted
cban option to get progress notifications and cancel the operation

◆ decompressZip() [1/2]

Expected< void > MR::decompressZip ( const std::filesystem::path & zipFile,
const std::filesystem::path & targetFolder,
const char * password = nullptr )

#include <MRMesh/MRZip.h>

decompresses given zip-file into given folder

Parameters
passwordif password is given then it will be used to decipher encrypted archive

◆ decompressZip() [2/2]

Expected< void > MR::decompressZip ( std::istream & zipStream,
const std::filesystem::path & targetFolder,
const char * password = nullptr )

#include <MRMesh/MRZip.h>

decompresses given binary stream (containing the data of a zip file only) into given folder

Parameters
passwordif password is given then it will be used to decipher encrypted archive

◆ deserializeFromJson() [1/20]

void MR::deserializeFromJson ( const Json::Value & root,
AffineXf2f & xf )

◆ deserializeFromJson() [2/20]

void MR::deserializeFromJson ( const Json::Value & root,
AffineXf3f & xf )

◆ deserializeFromJson() [3/20]

void MR::deserializeFromJson ( const Json::Value & root,
BitSet & bitset )

◆ deserializeFromJson() [4/20]

void MR::deserializeFromJson ( const Json::Value & root,
Color & col )

◆ deserializeFromJson() [5/20]

void MR::deserializeFromJson ( const Json::Value & root,
Matrix2f & matrix )

◆ deserializeFromJson() [6/20]

void MR::deserializeFromJson ( const Json::Value & root,
Matrix3f & matrix )

◆ deserializeFromJson() [7/20]

void MR::deserializeFromJson ( const Json::Value & root,
MeshTexture & texture )

◆ deserializeFromJson() [8/20]

void MR::deserializeFromJson ( const Json::Value & root,
MeshTriPoint & mtp,
const MeshTopology & topology )

#include <MRMesh/MRSerializer.h>

this version takes topology to construct MeshTriPoint from its representation relative a face; also beware that de-serialization will work only if faces are not renumbered (so please pack mesh before saving)

◆ deserializeFromJson() [9/20]

void MR::deserializeFromJson ( const Json::Value & root,
Plane3f & plane )

◆ deserializeFromJson() [10/20]

void MR::deserializeFromJson ( const Json::Value & root,
PointOnFace & pf )

◆ deserializeFromJson() [11/20]

void MR::deserializeFromJson ( const Json::Value & root,
std::vector< Color > & colors )

◆ deserializeFromJson() [12/20]

void MR::deserializeFromJson ( const Json::Value & root,
std::vector< TextureId > & texturePerFace )

◆ deserializeFromJson() [13/20]

void MR::deserializeFromJson ( const Json::Value & root,
std::vector< UVCoord > & uvCoords )

◆ deserializeFromJson() [14/20]

void MR::deserializeFromJson ( const Json::Value & root,
TriPointf & tp )

◆ deserializeFromJson() [15/20]

void MR::deserializeFromJson ( const Json::Value & root,
Vector2f & vec )

◆ deserializeFromJson() [16/20]

void MR::deserializeFromJson ( const Json::Value & root,
Vector2i & vec )

#include <MRMesh/MRSerializer.h>

loads an object from json value

◆ deserializeFromJson() [17/20]

void MR::deserializeFromJson ( const Json::Value & root,
Vector3f & vec )

◆ deserializeFromJson() [18/20]

void MR::deserializeFromJson ( const Json::Value & root,
Vector3i & vec )

◆ deserializeFromJson() [19/20]

void MR::deserializeFromJson ( const Json::Value & root,
Vector4f & vec )

◆ deserializeFromJson() [20/20]

Expected< Mesh > MR::deserializeFromJson ( const Json::Value & root,
VertColors * colors = nullptr )

◆ deserializeJsonValue() [1/4]

Expected< Json::Value > MR::deserializeJsonValue ( const char * data,
size_t size )

#include <MRMesh/MRSerializer.h>

important on Windows: in stream must be open in binary mode

◆ deserializeJsonValue() [2/4]

Expected< Json::Value > MR::deserializeJsonValue ( const std::filesystem::path & path)

◆ deserializeJsonValue() [3/4]

Expected< Json::Value > MR::deserializeJsonValue ( const std::string & str)

◆ deserializeJsonValue() [4/4]

Expected< Json::Value > MR::deserializeJsonValue ( std::istream & in)

◆ deserializeViaVerticesFromJson()

void MR::deserializeViaVerticesFromJson ( const Json::Value & root,
UndirectedEdgeBitSet & edges,
const MeshTopology & topology )

◆ serializeJsonValue() [1/3]

Expected< std::string > MR::serializeJsonValue ( const Json::Value & root)

◆ serializeJsonValue() [2/3]

Expected< void > MR::serializeJsonValue ( const Json::Value & root,
const std::filesystem::path & path )

#include <MRMesh/MRSerializer.h>

important on Windows: in stream must be open in binary mode

◆ serializeJsonValue() [3/3]

Expected< void > MR::serializeJsonValue ( const Json::Value & root,
std::ostream & out )

◆ serializeMesh()

Expected< void > MR::serializeMesh ( const Mesh & mesh,
const std::filesystem::path & path,
const FaceBitSet * selection = nullptr,
const char * serializeFormat = ".mrmesh" )

#include <MRMesh/MRSerializer.h>

saves mesh with optional selection to mru format; this is very convenient for saving intermediate states during algorithm debugging; ".mrmesh" save mesh format is not space efficient, but guaranties no changes in the topology after loading

◆ serializeToJson() [1/22]

void MR::serializeToJson ( const AffineXf2f & xf,
Json::Value & root,
bool skipIdentity = true )

◆ serializeToJson() [2/22]

void MR::serializeToJson ( const AffineXf3f & xf,
Json::Value & root,
bool skipIdentity = true )

◆ serializeToJson() [3/22]

void MR::serializeToJson ( const BitSet & bitset,
Json::Value & root )

◆ serializeToJson() [4/22]

void MR::serializeToJson ( const Box3f & box,
Json::Value & root )

◆ serializeToJson() [5/22]

void MR::serializeToJson ( const Box3i & box,
Json::Value & root )

◆ serializeToJson() [6/22]

void MR::serializeToJson ( const Color & col,
Json::Value & root )

◆ serializeToJson() [7/22]

void MR::serializeToJson ( const Matrix2f & matrix,
Json::Value & root,
bool skipIdentity = true )

◆ serializeToJson() [8/22]

void MR::serializeToJson ( const Matrix3f & matrix,
Json::Value & root,
bool skipIdentity = true )

◆ serializeToJson() [9/22]

Expected< void > MR::serializeToJson ( const Mesh & mesh,
Json::Value & root )

◆ serializeToJson() [10/22]

void MR::serializeToJson ( const MeshTexture & texture,
Json::Value & root )

◆ serializeToJson() [11/22]

void MR::serializeToJson ( const MeshTriPoint & mtp,
const MeshTopology & topology,
Json::Value & root )

#include <MRMesh/MRSerializer.h>

this version takes topology to convert MeshTriPoint in its representation relative a face; also beware that de-serialization will work only if faces are not renumbered (so please pack mesh before saving)

◆ serializeToJson() [12/22]

void MR::serializeToJson ( const Plane3f & plane,
Json::Value & root )

◆ serializeToJson() [13/22]

void MR::serializeToJson ( const PointOnFace & pf,
Json::Value & root )

◆ serializeToJson() [14/22]

void MR::serializeToJson ( const std::vector< Color > & colors,
Json::Value & root )

◆ serializeToJson() [15/22]

void MR::serializeToJson ( const std::vector< TextureId > & texturePerFace,
Json::Value & root )

◆ serializeToJson() [16/22]

void MR::serializeToJson ( const std::vector< UVCoord > & uvCoords,
Json::Value & root )

◆ serializeToJson() [17/22]

void MR::serializeToJson ( const TriPointf & tp,
Json::Value & root )

◆ serializeToJson() [18/22]

void MR::serializeToJson ( const Vector2f & vec,
Json::Value & root )

◆ serializeToJson() [19/22]

void MR::serializeToJson ( const Vector2i & vec,
Json::Value & root )

#include <MRMesh/MRSerializer.h>

saves an object into json value

◆ serializeToJson() [20/22]

void MR::serializeToJson ( const Vector3f & vec,
Json::Value & root )

◆ serializeToJson() [21/22]

void MR::serializeToJson ( const Vector3i & vec,
Json::Value & root )

◆ serializeToJson() [22/22]

void MR::serializeToJson ( const Vector4f & vec,
Json::Value & root )

◆ serializeViaVerticesToJson()

void MR::serializeViaVerticesToJson ( const UndirectedEdgeBitSet & edges,
const MeshTopology & topology,
Json::Value & root )

#include <MRMesh/MRSerializer.h>

serialize given edges into json first converting them into pairs of vertices, which is safer when edge ids change after saving/loading, but vertex ids are not