Version: 9.12.0
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 available 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

◆ MaterialType

Enumerator
Global 

Global materials.

User 

User materials.

All 

All materials.

Constructor & Destructor Documentation

◆ Material_ResourceMgr()

Material_ResourceMgr::Material_ResourceMgr ( )

◆ ~Material_ResourceMgr()

Material_ResourceMgr::~Material_ResourceMgr ( )

References watchUserFile().

Member Function Documentation

◆ changed

void Material_ResourceMgr::changed ( )
signal

◆ materials()

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 available materials names

References All, Global, myMutex, and User.

◆ resourceMgr()

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

◆ saved()

void Material_ResourceMgr::saved ( )
private

◆ update

void Material_ResourceMgr::update ( )
privateslot

References changed().

◆ watchUserFile()

void Material_ResourceMgr::watchUserFile ( bool  on)
private

References myWatcher, and update().

Friends And Related Function Documentation

◆ Material_Model

friend class Material_Model
friend

Member Data Documentation

◆ myMutex

QMutex Material_ResourceMgr::myMutex
private

◆ myWatcher

QFileSystemWatcher* Material_ResourceMgr::myWatcher
private

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