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

This chapter represents documentation about data models. More...

Topics

 Features
 Viewport group
 Visual Object group

Classes

class  MR::ObjectChildrenHolder
class  MR::Object
 named object in the data model More...
class  MR::ObjectDistanceMap
class  MR::ObjectGcode
class  MR::ObjectLines
class  MR::ObjectLinesHolder
class  MR::ObjectMesh
class  MR::ObjectPoints
class  MR::SceneRoot
class  MR::XfBasedCache< T >
class  MR::ObjectLabel
class  MR::ObjectVoxels

Functions

template<typename T>
std::shared_ptr< const T > MR::Object::find () const
 finds a direct child by type
template<typename T>
std::shared_ptr< const T > MR::Object::find (const std::string_view &name) const
 finds a direct child by name and type
std::shared_ptr< ObjectMR::createObject (const std::string &className)
 the function to create new object instance by registered class name
Expected< LoadedObjectMeshMR::makeObjectMeshFromFile (const std::filesystem::path &file, const ProgressCallback &cb={})
 loads mesh from given file in new object
Expected< LoadedObjectMR::makeObjectFromMeshFile (const std::filesystem::path &file, const ProgressCallback &cb={}, bool returnOnlyMesh=false)
 loads data from given file and makes either ObjectMesh, ObjectLines or ObjectPoints (if the file has points or edges but not faces)
Expected< ObjectLinesMR::makeObjectLinesFromFile (const std::filesystem::path &file, ProgressCallback callback={})
 loads lines from given file in new object
Expected< ObjectPointsMR::makeObjectPointsFromFile (const std::filesystem::path &file, ProgressCallback callback={})
 loads points from given file in new object
Expected< ObjectDistanceMapMR::makeObjectDistanceMapFromFile (const std::filesystem::path &file, ProgressCallback callback={})
 loads distance map from given file in new object
Expected< ObjectGcodeMR::makeObjectGcodeFromFile (const std::filesystem::path &file, ProgressCallback callback={})
 loads gcode from given file in new object
Expected< LoadedObjectsMR::loadObjectFromFile (const std::filesystem::path &filename, const ProgressCallback &callback={})
 load all objects (or any type: mesh, lines, points, voxels or scene) from file
bool MR::isSupportedFileInSubfolders (const std::filesystem::path &folder)
 checks if there are any supported files folder and subfolders
Expected< LoadedObjectMR::loadSceneFromAnySupportedFormat (const std::filesystem::path &path, const ProgressCallback &callback={})
 tries to load scene from every format listed in SceneFormatFilters
LoadedObject MR::makeObjectMesh (std::string objName, LoadedMeshData data)
 constructs new ObjectMesh from the given data
Expected< LoadedObjectMR::deserializeObjectTree (const std::filesystem::path &path, const FolderCallback &postDecompress={}, const ProgressCallback &progressCb={})
 loads objects tree from given scene file (zip/mru)
Expected< LoadedObjectMR::deserializeObjectTreeFromFolder (const std::filesystem::path &folder, const ProgressCallback &progressCb={})
 loads objects tree from given scene folder
IOFilters MR::getAllFilters ()
 returns filters for all supported file formats for all types of objects

Detailed Description

This chapter represents documentation about data models.

Function Documentation

◆ createObject()

std::shared_ptr< Object > MR::createObject ( const std::string & className)

#include <MRMesh/MRObjectFactory.h>

the function to create new object instance by registered class name

◆ deserializeObjectTree()

Expected< LoadedObject > MR::deserializeObjectTree ( const std::filesystem::path & path,
const FolderCallback & postDecompress = {},
const ProgressCallback & progressCb = {} )

#include <MRMesh/MRObjectLoad.h>

loads objects tree from given scene file (zip/mru)

format specification: children are saved under folder with name of their parent object all objects parameters are saved in one JSON file in the root folder

if postDecompress is set, it is called after decompression loading is controlled with Object::deserializeModel_ and Object::deserializeFields_

◆ deserializeObjectTreeFromFolder()

Expected< LoadedObject > MR::deserializeObjectTreeFromFolder ( const std::filesystem::path & folder,
const ProgressCallback & progressCb = {} )

#include <MRMesh/MRObjectLoad.h>

loads objects tree from given scene folder

format specification: children are saved under folder with name of their parent object all objects parameters are saved in one JSON file in the root folder

loading is controlled with Object::deserializeModel_ and Object::deserializeFields_

◆ find() [1/2]

template<typename T>
std::shared_ptr< const T > MR::Object::find ( ) const

#include <MRMesh/MRObject.h>

finds a direct child by type

not found

◆ find() [2/2]

template<typename T>
std::shared_ptr< const T > MR::Object::find ( const std::string_view & name) const

#include <MRMesh/MRObject.h>

finds a direct child by name and type

not found

◆ getAllFilters()

IOFilters MR::getAllFilters ( )
nodiscard

#include <MRMesh/MRObjectLoad.h>

returns filters for all supported file formats for all types of objects

◆ isSupportedFileInSubfolders()

bool MR::isSupportedFileInSubfolders ( const std::filesystem::path & folder)
nodiscard

#include <MRMesh/MRObjectLoad.h>

checks if there are any supported files folder and subfolders

◆ loadObjectFromFile()

Expected< LoadedObjects > MR::loadObjectFromFile ( const std::filesystem::path & filename,
const ProgressCallback & callback = {} )

#include <MRMesh/MRObjectLoad.h>

load all objects (or any type: mesh, lines, points, voxels or scene) from file

Parameters
callback- callback function to set progress (for progress bar)

◆ loadSceneFromAnySupportedFormat()

Expected< LoadedObject > MR::loadSceneFromAnySupportedFormat ( const std::filesystem::path & path,
const ProgressCallback & callback = {} )

#include <MRMesh/MRObjectLoad.h>

tries to load scene from every format listed in SceneFormatFilters

◆ makeObjectDistanceMapFromFile()

Expected< ObjectDistanceMap > MR::makeObjectDistanceMapFromFile ( const std::filesystem::path & file,
ProgressCallback callback = {} )

#include <MRMesh/MRObjectLoad.h>

loads distance map from given file in new object

◆ makeObjectFromMeshFile()

Expected< LoadedObject > MR::makeObjectFromMeshFile ( const std::filesystem::path & file,
const ProgressCallback & cb = {},
bool returnOnlyMesh = false )

#include <MRMesh/MRObjectLoad.h>

loads data from given file and makes either ObjectMesh, ObjectLines or ObjectPoints (if the file has points or edges but not faces)

if true the function can return only ObjectMesh and never other object type

◆ makeObjectGcodeFromFile()

Expected< ObjectGcode > MR::makeObjectGcodeFromFile ( const std::filesystem::path & file,
ProgressCallback callback = {} )

#include <MRMesh/MRObjectLoad.h>

loads gcode from given file in new object

◆ makeObjectLinesFromFile()

Expected< ObjectLines > MR::makeObjectLinesFromFile ( const std::filesystem::path & file,
ProgressCallback callback = {} )

#include <MRMesh/MRObjectLoad.h>

loads lines from given file in new object

◆ makeObjectMesh()

LoadedObject MR::makeObjectMesh ( std::string objName,
LoadedMeshData data )
nodiscard

#include <MRMesh/MRObjectLoad.h>

constructs new ObjectMesh from the given data

◆ makeObjectMeshFromFile()

Expected< LoadedObjectMesh > MR::makeObjectMeshFromFile ( const std::filesystem::path & file,
const ProgressCallback & cb = {} )

#include <MRMesh/MRObjectLoad.h>

loads mesh from given file in new object

◆ makeObjectPointsFromFile()

Expected< ObjectPoints > MR::makeObjectPointsFromFile ( const std::filesystem::path & file,
ProgressCallback callback = {} )

#include <MRMesh/MRObjectLoad.h>

loads points from given file in new object