Material properties resources manager. More...
#include <Material_ResourceMgr.h>
Classes | |
class | Updater |
Updates the contents of the resource manager as soon as user materials database file is changed. More... | |
Public Types | |
enum | MaterialType { Global, User, All } |
Material type. More... | |
Signals | |
void | changed () |
Public Member Functions | |
Material_ResourceMgr () | |
Constructor. More... | |
~Material_ResourceMgr () | |
Destructor. More... | |
QStringList | materials (MaterialType=All, bool=true) |
Get list of avaiable materials. More... | |
Static Public Member Functions | |
static Material_ResourceMgr * | resourceMgr () |
Get shared instance of resources manager. More... | |
Private Slots | |
void | update () |
Update user database slot. More... | |
Private Member Functions | |
void | watchUserFile (bool) |
Start/stop this resource manager watching the user materials database file. More... | |
void | saved () |
This function is called after user configuration file is saved. More... | |
Private Attributes | |
QFileSystemWatcher * | myWatcher |
QMutex | myMutex |
Friends | |
class | Material_Model |
This class is used to manage the material properties throughout the application in the similar way as QtxResourceMgr does it with application preferences.
Standard material types are stored in the global application settings files (named as SalomeMaterial.xml). User-defined materials are stored in user's home directory - in the file .SalomeMaterialrc.
The Material_ResourceMgr class is used by material properties dialog box (GEOMToolsGUI_MaterialPropertiesDlg class).
Material_ResourceMgr::Material_ResourceMgr | ( | ) |
Material_ResourceMgr::~Material_ResourceMgr | ( | ) |
References watchUserFile().
|
signal |
QStringList Material_ResourceMgr::materials | ( | MaterialType | theType = All , |
bool | theSort = true |
||
) |
|
static |
This instance of resource manager is global for the application; it watches for changes in the user materials database file to maintain the fresh version of the materials data.
References Material_ResourceMgr(), and watchUserFile().
|
private |
References myWatcher, resourceMgr(), saved(), and update().
|
privateslot |
References changed().
|
friend |
|
private |
|
private |