FormIt C++ API  v23.0.0 (2023.0.0)
FormIt::SampleMaterials API

Description

Functions

FORMIT_CORE_EXPORT size_t FormIt::SampleMaterials::GetRootNode ()
 Get the id of the root. More...
 
FORMIT_CORE_EXPORT size_t FormIt::SampleMaterials::GetParentNode (size_t id)
 Get the parent of the given node. More...
 
FORMIT_CORE_EXPORT void FormIt::SampleMaterials::GetChildrenNodes (size_t parent)
 Gets all the children nodes for the given parent. More...
 
FORMIT_CORE_EXPORT::vector< size_t > FormIt::SampleMaterials::GetChildrenNodesDirect (size_t parent)
 Get the ids of the children nodes or materials. More...
 
FORMIT_CORE_EXPORT::string FormIt::SampleMaterials::GetNodeName (size_t id)
 Get the display name of the node. More...
 
FORMIT_CORE_EXPORT bool FormIt::SampleMaterials::GetMaterialPreview (size_t id, 1::vector< unsigned char > &preview)
 Get the thumbnail preview of a sample material and its resolution. More...
 
FORMIT_CORE_EXPORT bool FormIt::SampleMaterials::GetMaterialData (size_t id, FormIt::Materials::MaterialData &data)
 Get data of a sample material. More...
 
FORMIT_CORE_EXPORT bool FormIt::SampleMaterials::IsContainerNode (size_t id)
 Is the node a container or material. More...
 
FORMIT_CORE_EXPORT bool FormIt::SampleMaterials::IsMaterialServerNode (size_t id)
 Is the node from the material server. More...
 
FORMIT_CORE_EXPORT bool FormIt::SampleMaterials::IsAXMFileNode (size_t id)
 Is the node from an axm file. More...
 
FORMIT_CORE_EXPORT bool FormIt::SampleMaterials::IsValidNode (size_t id)
 Is the node id valid. More...
 
FORMIT_CORE_EXPORT void FormIt::SampleMaterials::Reload (size_t nodeId)
 Reload all the children of the given node. More...
 
FORMIT_CORE_EXPORT void FormIt::SampleMaterials::SetSampleMaterialsDirectories (const 1::vector< 1::string > &dirs)
 Save the sample materials directories to the app settings. More...
 
FORMIT_CORE_EXPORT::vector< 1::string > FormIt::SampleMaterials::GetSampleMaterialsDirectories ()
 Get the sample materials directories from the app settings. More...
 
FORMIT_CORE_EXPORT size_t FormIt::SampleMaterials::GetNodeFromPath (1::string path)
 Get the node id from the given path. More...
 
FORMIT_CORE_EXPORT::string FormIt::SampleMaterials::GetPathFromNode (size_t nodeId)
 Get the path from the given node id. More...
 
FORMIT_CORE_EXPORT void FormIt::SampleMaterials::CreateServerDB (const 1::string &outputPath="")
 Create a database with json files from the cache. More...
 
FORMIT_CORE_EXPORT void FormIt::SampleMaterials::CreateCacheFromAXMFiles (const 1::string &inputDir)
 Creates the Sample Materials cache from axm files in the given directory The resulting folder will in the same location as the cache and will be named "SampleMaterialsCacheEdited" to not override the existing cache. More...
 
FORMIT_CORE_EXPORT void FormIt::SampleMaterials::ClearMaterialsCacheDirectory ()
 Deletes the whole cache directory. More...
 
FORMIT_CORE_EXPORT::string FormIt::SampleMaterials::GetPathFromMaterial (size_t materialId)
 Get the path to the file that generates this material. More...
 

Function Documentation

FORMIT_CORE_EXPORT void FormIt::SampleMaterials::ClearMaterialsCacheDirectory ( )

Deletes the whole cache directory.

FORMIT_CORE_EXPORT void FormIt::SampleMaterials::CreateCacheFromAXMFiles ( const 1::string &  inputDir)

Creates the Sample Materials cache from axm files in the given directory The resulting folder will in the same location as the cache and will be named "SampleMaterialsCacheEdited" to not override the existing cache.

Parameters
[in]inputDir
FORMIT_CORE_EXPORT void FormIt::SampleMaterials::CreateServerDB ( const 1::string &  outputPath = "")

Create a database with json files from the cache.

These files are used to populate the mongoDB material server

Parameters
[in]outputPath
FORMIT_CORE_EXPORT void FormIt::SampleMaterials::GetChildrenNodes ( size_t  parent)

Gets all the children nodes for the given parent.

If not loaded yet they will be loaded first. The FormIt::kSampleMaterialsNodeLoaded message will be broadcast to send the ids of the parent node.

Parameters
[in]parent
FORMIT_CORE_EXPORT ::vector<size_t> FormIt::SampleMaterials::GetChildrenNodesDirect ( size_t  parent)

Get the ids of the children nodes or materials.

Note, this does not load the chilren but simply returns what's there.

Parameters
[in]parent
FORMIT_CORE_EXPORT bool FormIt::SampleMaterials::GetMaterialData ( size_t  id,
FormIt::Materials::MaterialData data 
)

Get data of a sample material.

The id passed in must be one of a material mode not a container node. Returns false if the id is invalid.

Parameters
[in]id
[out]data
FORMIT_CORE_EXPORT bool FormIt::SampleMaterials::GetMaterialPreview ( size_t  id,
1::vector< unsigned char > &  preview 
)

Get the thumbnail preview of a sample material and its resolution.

The id passed in must be one of a material node not a container node. Returns false if the id is invalid.

Parameters
[in]id
[out]preview
FORMIT_CORE_EXPORT size_t FormIt::SampleMaterials::GetNodeFromPath ( 1::string  path)

Get the node id from the given path.

Returns WSM::INVALID_ID, if the path does not exist

Parameters
[in]path
FORMIT_CORE_EXPORT ::string FormIt::SampleMaterials::GetNodeName ( size_t  id)

Get the display name of the node.

Parameters
[in]id
FORMIT_CORE_EXPORT size_t FormIt::SampleMaterials::GetParentNode ( size_t  id)

Get the parent of the given node.

If the given node is the root, WSM::INVALID_ID is returned.

Parameters
[in]id
FORMIT_CORE_EXPORT ::string FormIt::SampleMaterials::GetPathFromMaterial ( size_t  materialId)

Get the path to the file that generates this material.

The id passed in needs to be a material (leaf), not a node id. Returns "" if not a material id, or the material is from the sample materials server

Parameters
[in]materialId
FORMIT_CORE_EXPORT ::string FormIt::SampleMaterials::GetPathFromNode ( size_t  nodeId)

Get the path from the given node id.

Returns "", if the node id is invalid

Parameters
[in]nodeId
FORMIT_CORE_EXPORT size_t FormIt::SampleMaterials::GetRootNode ( )

Get the id of the root.

The children of the root are displayed in the UI as a pop up menu. Typically a user selected folder or the advanced materials server (But could be other sources as well)

FORMIT_CORE_EXPORT ::vector<1::string> FormIt::SampleMaterials::GetSampleMaterialsDirectories ( )

Get the sample materials directories from the app settings.

FORMIT_CORE_EXPORT bool FormIt::SampleMaterials::IsAXMFileNode ( size_t  id)

Is the node from an axm file.

Parameters
[in]id
FORMIT_CORE_EXPORT bool FormIt::SampleMaterials::IsContainerNode ( size_t  id)

Is the node a container or material.

Parameters
[in]id
FORMIT_CORE_EXPORT bool FormIt::SampleMaterials::IsMaterialServerNode ( size_t  id)

Is the node from the material server.

Parameters
[in]id
FORMIT_CORE_EXPORT bool FormIt::SampleMaterials::IsValidNode ( size_t  id)

Is the node id valid.

Parameters
[in]id
FORMIT_CORE_EXPORT void FormIt::SampleMaterials::Reload ( size_t  nodeId)

Reload all the children of the given node.

Parameters
[in]nodeId
FORMIT_CORE_EXPORT void FormIt::SampleMaterials::SetSampleMaterialsDirectories ( const 1::vector< 1::string > &  dirs)

Save the sample materials directories to the app settings.

Parameters
[in]dirs