3DCoat Core API
The 3DCoat API documentation.
Loading...
Searching...
No Matches
coat::resource Class Reference

this class represents different resources accessible in UI - alphas, strips, materials, models, etc More...

#include <CoreAPI.h>

Public Member Functions

 resource (const char *id)
 create the reference to some resource type to access it and operate with it
 
std::vector< std::string > listFolders ()
 list folders of the resource type referred by this object
 
std::string currentFolder ()
 get the current folder short name
 
std::string currentFolderFullPath ()
 full path (relative to the 3DCoat's documents) to the current folder files
 
std::string rootPath ()
 the root path (relative to the 3DCoat's documents) to the resource type referred by this object
 
std::vector< std::string > supportedExtensions ()
 get the list of supported extensions for the resource type referred by this object
 
void setCurrentFolder (const char *folder)
 set the current folder (short name without the full path)
 
void createFolder (const char *folderName)
 create the folder and switch there
 
void removeFolder (const char *folderName)
 remove the folder and switch to the root folder if this is the current folder
 
std::vector< std::string > listCurrentFolderItems ()
 get the list of all items in the current folder
 
void addItem (const char *itemPath)
 add the item to the current folder
 
void removeItem (const char *itemName)
 remove the item from the current folder
 
void selectItem (const char *itemName)
 select/activate the item in the current folder
 
void moveItemToFolder (const char *itemName, const char *destFolderName)
 move the item to another folder
 
std::string getCurrentItem ()
 returns the current item name (if possible)
 

Static Public Member Functions

static std::vector< std::string > listAllResourcesTypes ()
 list all available resources types
 

Detailed Description

this class represents different resources accessible in UI - alphas, strips, materials, models, etc

Constructor & Destructor Documentation

◆ resource()

coat::resource::resource ( const char * id)

create the reference to some resource type to access it and operate with it

Parameters
idthe resource identifier (string), possible cases:
"Alphas", "Strips", "SmartMaterials", "Stencils", "Models/SculptModels", "Models/SplineProfiles", "Models/RetopoModels", "Models/Joints", "Presets", "Panoramas", "Shaders/PbrShaders", "Stencils"

Member Function Documentation

◆ addItem()

void coat::resource::addItem ( const char * itemPath)

add the item to the current folder

Parameters
itemPaththe path to the item (full or relative to the 3DCoat's documents)

◆ createFolder()

void coat::resource::createFolder ( const char * folderName)

create the folder and switch there

Parameters
folderNamethe folder name

◆ currentFolder()

std::string coat::resource::currentFolder ( )

get the current folder short name

Returns
the name of current folder of the resource type referred by this object

◆ currentFolderFullPath()

std::string coat::resource::currentFolderFullPath ( )

full path (relative to the 3DCoat's documents) to the current folder files

Returns
the path

◆ getCurrentItem()

std::string coat::resource::getCurrentItem ( )

returns the current item name (if possible)

Returns
the string, current item name

◆ listAllResourcesTypes()

static std::vector< std::string > coat::resource::listAllResourcesTypes ( )
static

list all available resources types

Returns
the list of resource types (any type may be passed to the resource constructor)

◆ listCurrentFolderItems()

std::vector< std::string > coat::resource::listCurrentFolderItems ( )

get the list of all items in the current folder

Returns
the list of items (usually long names with the relative path)

◆ listFolders()

std::vector< std::string > coat::resource::listFolders ( )

list folders of the resource type referred by this object

Returns
the list of folders (short names without the full path)

◆ moveItemToFolder()

void coat::resource::moveItemToFolder ( const char * itemName,
const char * destFolderName )

move the item to another folder

Parameters
itemNamethe item name as it is returned by listCurrentFolderItems()
destFolderNamethe short name of the destination folder

◆ removeFolder()

void coat::resource::removeFolder ( const char * folderName)

remove the folder and switch to the root folder if this is the current folder

Parameters
folderNamethe folder name

◆ removeItem()

void coat::resource::removeItem ( const char * itemName)

remove the item from the current folder

Parameters
itemNamethe item name as it is returned by listCurrentFolderItems()

◆ rootPath()

std::string coat::resource::rootPath ( )

the root path (relative to the 3DCoat's documents) to the resource type referred by this object

Returns
the path

◆ selectItem()

void coat::resource::selectItem ( const char * itemName)

select/activate the item in the current folder

Parameters
itemNamethe item name as it is returned by listCurrentFolderItems()

◆ setCurrentFolder()

void coat::resource::setCurrentFolder ( const char * folder)

set the current folder (short name without the full path)

Parameters
folderthe folder name

◆ supportedExtensions()

std::vector< std::string > coat::resource::supportedExtensions ( )

get the list of supported extensions for the resource type referred by this object

Returns
the list of strings with extensions

The documentation for this class was generated from the following file: