Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Material_ResourceMgr Class Reference

Material properties resources manager. More...

#include <Material_ResourceMgr.h>

Inheritance diagram for Material_ResourceMgr:
Inheritance graph

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_ResourceMgrresourceMgr ()
 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
 

Detailed Description

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).

Member Enumeration Documentation

Enumerator
Global 

Global materials.

User 

User materials.

All 

All materials.

Constructor & Destructor Documentation

Material_ResourceMgr::Material_ResourceMgr ( )
Material_ResourceMgr::~Material_ResourceMgr ( )

References watchUserFile().

Member Function Documentation

void Material_ResourceMgr::changed ( )
signal
QStringList Material_ResourceMgr::materials ( MaterialType  theType = All,
bool  theSort = true 
)
Parameters
theTypematerial type
theSortif true (default), returns a list of materials sorted by name
Returns
list of avaiable materials names

References All, Global, it(), myMutex, and User.

Material_ResourceMgr * Material_ResourceMgr::resourceMgr ( )
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().

void Material_ResourceMgr::saved ( )
private
void Material_ResourceMgr::update ( )
privateslot

References changed().

void Material_ResourceMgr::watchUserFile ( bool  on)
private

References myWatcher, and update().

Friends And Related Function Documentation

friend class Material_Model
friend

Member Data Documentation

QMutex Material_ResourceMgr::myMutex
private
QFileSystemWatcher* Material_ResourceMgr::myWatcher
private

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