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 | |
enum class | MR::ObjectSelectivityType { MR::ObjectSelectivityType::Selectable , MR::ObjectSelectivityType::Selected , MR::ObjectSelectivityType::Any } |
template<typename ObjectT = Object> | |
std::shared_ptr< ObjectT > | MR::asSelectivityType (std::shared_ptr< Object > obj, const ObjectSelectivityType &type) |
if input object is of given type then returns another pointer on it | |
template<typename ObjectT = Object> | |
std::vector< std::shared_ptr< ObjectT > > | MR::getAllObjectsInTree (Object *root, const ObjectSelectivityType &type=ObjectSelectivityType::Selectable) |
template<typename ObjectT = Object> | |
MR_BIND_IGNORE std::vector< std::shared_ptr< ObjectT > > | MR::getAllObjectsInTree (Object &root, const ObjectSelectivityType &type=ObjectSelectivityType::Selectable) |
template<typename ObjectT = Object> | |
std::vector< std::shared_ptr< ObjectT > > | MR::getTopmostVisibleObjects (Object *root, const ObjectSelectivityType &type=ObjectSelectivityType::Selectable) |
Returns all topmost visible objects of given type (if an object is returned, its children are not) excluding root. | |
template<typename ObjectT = Object> | |
MR_BIND_IGNORE std::vector< std::shared_ptr< ObjectT > > | MR::getTopmostVisibleObjects (Object &root, const ObjectSelectivityType &type=ObjectSelectivityType::Selectable) |
template<typename ObjectT = Object> | |
std::shared_ptr< ObjectT > | MR::getDepthFirstObject (Object *root, const ObjectSelectivityType &type) |
return first object of given type in depth-first traverse order excluding root | |
template<typename ObjectT = Object> | |
MR_BIND_IGNORE std::shared_ptr< ObjectT > | MR::getDepthFirstObject (Object &root, const ObjectSelectivityType &type) |
MRMESH_API std::shared_ptr< Object > | MR::createObject (const std::string &className) |
the function to create new object instance by registered class name | |
MRMESH_API Expected< LoadedObjectMesh > | MR::makeObjectMeshFromFile (const std::filesystem::path &file, const ProgressCallback &cb={}) |
loads mesh from given file in new object | |
MRMESH_API Expected< LoadedObject > | MR::makeObjectFromMeshFile (const std::filesystem::path &file, const ProgressCallback &cb={}, bool returnOnlyMesh=false) |
loads data from given file and makes either ObjectMesh or ObjectPoints (if the file has points but not faces) | |
MRMESH_API Expected< ObjectLines > | MR::makeObjectLinesFromFile (const std::filesystem::path &file, ProgressCallback callback={}) |
loads lines from given file in new object | |
MRMESH_API Expected< ObjectPoints > | MR::makeObjectPointsFromFile (const std::filesystem::path &file, ProgressCallback callback={}) |
loads points from given file in new object | |
MRMESH_API Expected< ObjectDistanceMap > | MR::makeObjectDistanceMapFromFile (const std::filesystem::path &file, ProgressCallback callback={}) |
loads distance map from given file in new object | |
MRMESH_API Expected< ObjectGcode > | MR::makeObjectGcodeFromFile (const std::filesystem::path &file, ProgressCallback callback={}) |
loads gcode from given file in new object | |
MRMESH_API Expected< LoadedObjects > | MR::loadObjectFromFile (const std::filesystem::path &filename, const ProgressCallback &callback={}) |
load all objects (or any type: mesh, lines, points, voxels or scene) from file | |
MRMESH_API bool | MR::isSupportedFileInSubfolders (const std::filesystem::path &folder) |
MRMESH_API Expected< LoadedObject > | MR::loadSceneFromAnySupportedFormat (const std::filesystem::path &path, const ProgressCallback &callback={}) |
MRMESH_API Expected< LoadedObject > | MR::deserializeObjectTree (const std::filesystem::path &path, const FolderCallback &postDecompress={}, const ProgressCallback &progressCb={}) |
loads objects tree from given scene file (zip/mru) | |
MRMESH_API Expected< LoadedObject > | MR::deserializeObjectTreeFromFolder (const std::filesystem::path &folder, const ProgressCallback &progressCb={}) |
loads objects tree from given scene folder | |
MRMESH_API IOFilters | MR::getAllFilters () |
returns filters for all supported file formats for all types of objects | |
This chapter represents documentation about data models.
|
strong |
std::shared_ptr< ObjectT > MR::asSelectivityType | ( | std::shared_ptr< Object > | obj, |
const ObjectSelectivityType & | type ) |
if input object is of given type then returns another pointer on it
MRMESH_API std::shared_ptr< Object > MR::createObject | ( | const std::string & | className | ) |
the function to create new object instance by registered class name
MRMESH_API Expected< LoadedObject > MR::deserializeObjectTree | ( | const std::filesystem::path & | path, |
const FolderCallback & | postDecompress = {}, | ||
const ProgressCallback & | progressCb = {} ) |
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_
MRMESH_API Expected< LoadedObject > MR::deserializeObjectTreeFromFolder | ( | const std::filesystem::path & | folder, |
const ProgressCallback & | progressCb = {} ) |
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_
std::shared_ptr< const T > MR::Object::find | ( | ) | const |
finds a direct child by type
std::shared_ptr< const T > MR::Object::find | ( | const std::string_view & | name | ) | const |
finds a direct child by name and type
MRMESH_API IOFilters MR::getAllFilters | ( | ) |
returns filters for all supported file formats for all types of objects
|
inline |
std::vector< std::shared_ptr< ObjectT > > MR::getAllObjectsInTree | ( | Object * | root, |
const ObjectSelectivityType & | type = ObjectSelectivityType::Selectable ) |
Traverses tree and collect objects of given type excluding root returns vector
|
inline |
std::shared_ptr< ObjectT > MR::getDepthFirstObject | ( | Object * | root, |
const ObjectSelectivityType & | type ) |
return first object of given type in depth-first traverse order excluding root
|
inline |
std::vector< std::shared_ptr< ObjectT > > MR::getTopmostVisibleObjects | ( | Object * | root, |
const ObjectSelectivityType & | type = ObjectSelectivityType::Selectable ) |
Returns all topmost visible objects of given type (if an object is returned, its children are not) excluding root.
MRMESH_API bool MR::isSupportedFileInSubfolders | ( | const std::filesystem::path & | folder | ) |
MRMESH_API Expected< LoadedObjects > MR::loadObjectFromFile | ( | const std::filesystem::path & | filename, |
const ProgressCallback & | callback = {} ) |
load all objects (or any type: mesh, lines, points, voxels or scene) from file
callback | - callback function to set progress (for progress bar) |
MRMESH_API Expected< LoadedObject > MR::loadSceneFromAnySupportedFormat | ( | const std::filesystem::path & | path, |
const ProgressCallback & | callback = {} ) |
MRMESH_API Expected< ObjectDistanceMap > MR::makeObjectDistanceMapFromFile | ( | const std::filesystem::path & | file, |
ProgressCallback | callback = {} ) |
loads distance map from given file in new object
MRMESH_API Expected< LoadedObject > MR::makeObjectFromMeshFile | ( | const std::filesystem::path & | file, |
const ProgressCallback & | cb = {}, | ||
bool | returnOnlyMesh = false ) |
loads data from given file and makes either ObjectMesh or ObjectPoints (if the file has points but not faces)
if true the function can return only ObjectMesh and never ObjectPoints
MRMESH_API Expected< ObjectGcode > MR::makeObjectGcodeFromFile | ( | const std::filesystem::path & | file, |
ProgressCallback | callback = {} ) |
loads gcode from given file in new object
MRMESH_API Expected< ObjectLines > MR::makeObjectLinesFromFile | ( | const std::filesystem::path & | file, |
ProgressCallback | callback = {} ) |
loads lines from given file in new object
MRMESH_API Expected< LoadedObjectMesh > MR::makeObjectMeshFromFile | ( | const std::filesystem::path & | file, |
const ProgressCallback & | cb = {} ) |
loads mesh from given file in new object
MRMESH_API Expected< ObjectPoints > MR::makeObjectPointsFromFile | ( | const std::filesystem::path & | file, |
ProgressCallback | callback = {} ) |
loads points from given file in new object