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

#include <SalomeApp_Study.h>

Inheritance diagram for SalomeApp_Study:
Inheritance graph

Classes

class  Observer_i
 

Signals

void notebookVarUpdated (QString theVarName)
 
- Signals inherited from LightApp_Study
void saved (SUIT_Study *)
 
void opened (SUIT_Study *)
 
void closed (SUIT_Study *)
 
void created (SUIT_Study *)
 
void objVisibilityChanged (QString, Qtx::VisibilityState)
 

Public Member Functions

 SalomeApp_Study (SUIT_Application *)
 
virtual ~SalomeApp_Study ()
 
virtual int id () const
 
virtual QString studyName () const
 
virtual bool createDocument (const QString &)
 
virtual bool openDocument (const QString &)
 
virtual bool loadDocument (const QString &)
 
virtual bool saveDocument ()
 
virtual bool saveDocumentAs (const QString &)
 
virtual void closeDocument (bool permanently=true)
 
virtual bool dump (const QString &, bool, bool, bool)
 
virtual bool isSaved () const
 
virtual bool isModified () const
 
virtual void Modified ()
 
virtual void addComponent (const CAM_DataModel *dm)
 
 _PTR (Study) studyDS() const
 
virtual std::string GetTmpDir (const char *theURL, const bool isMultiFile)
 
void deleteReferencesTo (_PTR(SObject))
 
virtual QString componentDataType (const QString &) const
 
virtual QString referencedToEntry (const QString &) const
 
virtual bool isComponent (const QString &) const
 
virtual void children (const QString &, QStringList &) const
 
virtual void components (QStringList &) const
 
virtual QString centry (const QString &) const
 
std::vector< int > getSavePoints ()
 
void removeSavePoint (int savePoint)
 
QString getNameOfSavePoint (int savePoint)
 
void setNameOfSavePoint (int savePoint, const QString &nameOfSavePoint)
 
virtual void restoreState (int savePoint)
 Restores the study state. More...
 
void updateFromNotebook (const QString &, bool)
 
virtual LightApp_DataObjectfindObjectByEntry (const QString &theEntry)
 
- Public Member Functions inherited from LightApp_Study
 LightApp_Study (SUIT_Application *)
 
virtual ~LightApp_Study ()
 
virtual QString getVisualComponentName () const
 
virtual void setObjectProperty (int, const QString &, const QString &, const QVariant &)
 
virtual void setObjectProperty (const QString &, const QString &, const QVariant &)
 
virtual void setObjectProperty (int, const QString &, const QVariant &)
 
virtual void setObjectProperties (int, const QString &, const PropMap &)
 
virtual QVariant getObjectProperty (int, const QString &, const QString &, const QVariant &) const
 
virtual const PropMapgetObjectProperties (int, const QString &)
 
virtual const ObjMapgetObjectProperties (int)
 
virtual const ViewMgrMapgetObjectProperties () const
 
virtual void removeObjectProperties (int)
 
virtual void removeObjectProperties (const QString &)
 
virtual void setVisibilityState (const QString &theEntry, Qtx::VisibilityState theState)
 
virtual Qtx::VisibilityState visibilityState (const QString &theEntry) const
 
virtual void setVisibilityStateForAll (Qtx::VisibilityState theState)
 
- Public Member Functions inherited from CAM_Study
 CAM_Study (SUIT_Application *)
 Constructor. More...
 
virtual ~CAM_Study ()
 Destructor. More...
 
bool appendDataModel (const CAM_DataModel *)
 Append data model to the study. More...
 
virtual bool insertDataModel (const CAM_DataModel *, const int=-1)
 Insert data model dm with index idx. More...
 
bool insertDataModel (const CAM_DataModel *, const CAM_DataModel *)
 Insert data model dm after data model other. More...
 
virtual bool removeDataModel (const CAM_DataModel *)
 Remove data model from the study. More...
 
bool containsDataModel (const CAM_DataModel *) const
 Check if data model is contained in the list. More...
 
void dataModels (ModelList &) const
 Get all data models. More...
 
- Public Member Functions inherited from SUIT_Study
 SUIT_Study (SUIT_Application *)
 
virtual ~SUIT_Study ()
 
SUIT_DataObjectroot () const
 
SUIT_Applicationapplication () const
 
bool saveDocument ()
 
virtual void update ()
 
virtual void sendChangesNotification ()
 
SUIT_OperationactiveOperation () const
 
virtual void abortAllOperations ()
 
const QList< SUIT_Operation * > & operations () const
 Get all started operations. More...
 
virtual SUIT_OperationblockingOperation (SUIT_Operation *) const
 Verifies whether operation can be activated above already started ones. More...
 
bool start (SUIT_Operation *, const bool check=true)
 Starts operation. More...
 
bool abort (SUIT_Operation *)
 Aborts operation. More...
 
bool commit (SUIT_Operation *)
 Commits operation. More...
 
bool suspend (SUIT_Operation *)
 Commits operation. More...
 
bool resume (SUIT_Operation *)
 Resumes operation. More...
 

Protected Slots

virtual void updateModelRoot (const CAM_DataModel *)
 
void onNoteBookVarUpdate (QString theVarName)
 

Protected Member Functions

virtual void saveModuleData (QString theModuleName, QStringList theListOfFiles)
 
virtual void openModuleData (QString theModuleName, QStringList &theListOfFiles)
 
virtual bool saveStudyData (const QString &theFileName)
 
virtual bool openStudyData (const QString &theFileName)
 
virtual std::vector< std::string > GetListOfFiles (const char *theModuleName) const
 
virtual void SetListOfFiles (const char *theModuleName, const std::vector< std::string > theListOfFiles)
 
virtual void RemoveTemporaryFiles (const char *theModuleName, const bool isMultiFile) const
 
virtual void dataModelInserted (const CAM_DataModel *)
 
virtual bool openDataModel (const QString &, CAM_DataModel *)
 
void setStudyDS (const _PTR(Study)&s)
 
virtual CAM_ModuleObjectcreateModuleObject (LightApp_DataModel *theDataModel, SUIT_DataObject *theParent) const
 

Private Member Functions

QString newStudyName () const
 
 _PTR (Study) myStudyDS
 

Private Attributes

Observer_imyObserver
 

Additional Inherited Members

- Public Types inherited from CAM_Study
typedef QList< CAM_DataModel * > ModelList
 

Constructor & Destructor Documentation

SalomeApp_Study::SalomeApp_Study ( SUIT_Application app)

Constructor.

SalomeApp_Study::~SalomeApp_Study ( )
virtual

Destructor.

References myObserver.

Member Function Documentation

SalomeApp_Study::_PTR ( Study  ) const
SalomeApp_Study::_PTR ( Study  )
private
void SalomeApp_Study::addComponent ( const CAM_DataModel dm)
virtual
QString SalomeApp_Study::centry ( const QString &  comp) const
virtual

Get the entry for the given module

Parameters
comp- list to be filled
Returns
module root's entry

Reimplemented from LightApp_Study.

References SalomeApp_Study::Observer_i::_PTR().

void SalomeApp_Study::children ( const QString &  entry,
QStringList &  child_entries 
) const
virtual
Returns
entries of object children

Reimplemented from LightApp_Study.

References SalomeApp_Study::Observer_i::_PTR().

QString SalomeApp_Study::componentDataType ( const QString &  entry) const
virtual
Returns
component data type for entry

Reimplemented from LightApp_Study.

References SalomeApp_Study::Observer_i::_PTR(), LightApp_Study::componentDataType(), and obj.

void SalomeApp_Study::components ( QStringList &  comps) const
virtual

Fills list with components names

Parameters
comp- list to be filled

Reimplemented from LightApp_Study.

References SalomeApp_Study::Observer_i::_PTR(), and LightApp_Study::getVisualComponentName().

virtual bool SalomeApp_Study::createDocument ( const QString &  theStr)
virtual

Create document.

Reimplemented from LightApp_Study.

CAM_ModuleObject * SalomeApp_Study::createModuleObject ( LightApp_DataModel theDataModel,
SUIT_DataObject theParent 
) const
protectedvirtual

Virtual method re-implemented from LightApp_Study in order to create the module object connected to SALOMEDS - SalomeApp_ModuleObject.

Parameters
theDataModel- data model instance to create a module object for
theParent- the module object's parent (normally it's the study root)
Returns
the module object instance
See Also
LightApp_Study class, LightApp_DataModel class

Reimplemented from LightApp_Study.

References SalomeApp_Study::Observer_i::_PTR(), addComponent(), children(), SUIT_DataObject::children(), SalomeApp_DataObject::componentDataType(), CAM_DataModel::module(), CAM_Module::name(), obj, and SUIT_Study::root().

void SalomeApp_Study::dataModelInserted ( const CAM_DataModel dm)
protectedvirtual

Insert data model.

Reimplemented from CAM_Study.

References CAM_Study::dataModelInserted(), CAM_DataModel::module(), and CAM_Module::name().

void SalomeApp_Study::deleteReferencesTo ( _PTR(SObject)  obj)

Deletes all references to object

Parameters
obj- object

References SalomeApp_Study::Observer_i::_PTR().

bool SalomeApp_Study::dump ( const QString &  theFileName,
bool  toPublish,
bool  isMultiFile,
bool  toSaveGUI 
)
virtual

Dump study operation. Writes a Python dump file using SALOMEDS services. Additionally, gives a chance to light modules to participate in dump study operation.

Parameters
theFileName- full path to the output Python file
toPublish- if true, all objects are published in a study by the output script, including those not orignally present in the current study.
isMultiFile- if true, each module's dump is written into a separate Python file, otherwise a single output file is written
toSaveGUI- if true, the GUI state is written
Returns
- true if the operation succeeds, and false otherwise.

References SalomeApp_Study::Observer_i::_PTR(), SUIT_Study::application(), CAM_Study::dataModels(), removeSavePoint(), saveModuleData(), saveStudyData(), and SalomeApp_VisualState::storeState().

LightApp_DataObject * SalomeApp_Study::findObjectByEntry ( const QString &  theEntry)
virtual

Find a data object by the specified entry.

Parameters
theEntry- Entry of the object.
Returns
data object.

Reimplemented from LightApp_Study.

References SalomeApp_Study::Observer_i::findObject(), LightApp_Study::findObjectByEntry(), and myObserver.

std::vector< std::string > SalomeApp_Study::GetListOfFiles ( const char *  theModuleName) const
protectedvirtual

Note that this method does not create or activate SalomeApp_Engine_i instance, therefore it can be called safely for any kind of module, but for full modules it returns an empty list.

Returns
list of files used by module: to be used by CORBAless modules
Parameters
theModuleName- name of module

Reimplemented from LightApp_Study.

References SalomeApp_Engine_i::GetInstance(), and SalomeApp_Engine_i::GetListOfFiles().

QString SalomeApp_Study::getNameOfSavePoint ( int  savePoint)
std::vector< int > SalomeApp_Study::getSavePoints ( )
Returns
a list of saved points' IDs

References SalomeApp_Study::Observer_i::_PTR(), and LightApp_Study::getVisualComponentName().

std::string SalomeApp_Study::GetTmpDir ( const char *  theURL,
const bool  isMultiFile 
)
virtual
Returns
temporary directory for saving files of modules

Reimplemented from LightApp_Study.

int SalomeApp_Study::id ( ) const
virtual

Gets study id.

Reimplemented from SUIT_Study.

bool SalomeApp_Study::isComponent ( const QString &  entry) const
virtual
Returns
true if entry corresponds to component

Reimplemented from LightApp_Study.

References SalomeApp_Study::Observer_i::_PTR(), and obj.

bool SalomeApp_Study::isModified ( ) const
virtual
Returns
true, if study is modified in comparison with last open/save

Reimplemented from LightApp_Study.

References LightApp_Study::isModified().

bool SalomeApp_Study::isSaved ( ) const
virtual
Returns
if data model is saved

Reimplemented from LightApp_Study.

References LightApp_Study::isSaved().

void SalomeApp_Study::Modified ( )
virtual

Set study modified to on.

Reimplemented from SUIT_Study.

References SalomeApp_Study::Observer_i::_PTR(), and SUIT_Study::Modified().

QString SalomeApp_Study::newStudyName ( ) const
private

Create new study name.

References SalomeApp_Application::studyMgr().

void SalomeApp_Study::notebookVarUpdated ( QString  theVarName)
signal
void SalomeApp_Study::onNoteBookVarUpdate ( QString  theVarName)
protectedslot

References notebookVarUpdated().

void SalomeApp_Study::openModuleData ( QString  theModuleName,
QStringList &  theListOfFiles 
)
protectedvirtual

Loads data of module

Parameters
theModuleName- name of module
theListOfFiles- list of files to be loaded

Reimplemented from LightApp_Study.

References GetListOfFiles().

bool SalomeApp_Study::openStudyData ( const QString &  theFileName)
protectedvirtual

Loads data for study

Reimplemented from LightApp_Study.

QString SalomeApp_Study::referencedToEntry ( const QString &  entry) const
virtual
Returns
real entry by entry of reference
Parameters
entry- entry of reference object

Reimplemented from LightApp_Study.

References SalomeApp_Study::Observer_i::_PTR(), obj, and LightApp_Study::referencedToEntry().

void SalomeApp_Study::removeSavePoint ( int  savePoint)
void SalomeApp_Study::RemoveTemporaryFiles ( const char *  theModuleName,
const bool  isMultiFile 
) const
protectedvirtual

Removes temporary files

Reimplemented from LightApp_Study.

References GetListOfFiles().

void SalomeApp_Study::restoreState ( int  savePoint)
virtual
void SalomeApp_Study::saveModuleData ( QString  theModuleName,
QStringList  theListOfFiles 
)
protectedvirtual

Saves data of module

Parameters
theModuleName- name of module
theListOfFiles- list of files to be saved

Reimplemented from LightApp_Study.

References SetListOfFiles().

bool SalomeApp_Study::saveStudyData ( const QString &  theFileName)
protectedvirtual

Re-implemented from LightApp_Study, actually does not save anything but simply cleans up light modules' data

Reimplemented from LightApp_Study.

References CAM_Study::dataModels(), CAM_DataModel::module(), CAM_Module::name(), and SetListOfFiles().

void SalomeApp_Study::SetListOfFiles ( const char *  theModuleName,
const std::vector< std::string >  theListOfFiles 
)
protectedvirtual

Sets list of files used by module: to be used by CORBAless modules. Note that this method does not create or activate SalomeApp_Engine_i instance, therefore it can be called safely for any kind of module, but for full modules it simply does nothing.

Parameters
theModuleName- name of module
theListOfFiles- list of files

Reimplemented from LightApp_Study.

References SalomeApp_Engine_i::GetInstance(), and SalomeApp_Engine_i::SetListOfFiles().

void SalomeApp_Study::setNameOfSavePoint ( int  savePoint,
const QString &  nameOfSavePoint 
)
void SalomeApp_Study::setStudyDS ( const _PTR(Study)&  s)
protected

Set studyDS.

References s.

QString SalomeApp_Study::studyName ( ) const
virtual

Get study name.

Reimplemented from SUIT_Study.

References SUIT_Study::application(), SUIT_Study::setStudyName(), and SUIT_Study::studyName().

void SalomeApp_Study::updateFromNotebook ( const QString &  theFileName,
bool  isSaved 
)

Mark the study as saved in the file

Parameters
theFileName- the name of file

References SUIT_Study::setIsSaved(), and SUIT_Study::setStudyName().

void SalomeApp_Study::updateModelRoot ( const CAM_DataModel dm)
protectedvirtualslot

Slot: called on change of a root of a data model. Redefined from CAM_Study

References SUIT_Study::application(), and CAM_Study::updateModelRoot().

Member Data Documentation

Observer_i* SalomeApp_Study::myObserver
private

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