Version: 9.12.0
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)
 
- Signals inherited from SUIT_Study
void studyModified (SUIT_Study *)
 

Public Member Functions

 SalomeApp_Study (SUIT_Application *)
 
virtual ~SalomeApp_Study ()
 
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)
 
virtual void RemoveTemporaryFiles (const char *, bool, bool=false)
 
- 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 ()
 
virtual int id () const
 
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 Slots inherited from CAM_Study
virtual void updateModelRoot (const CAM_DataModel *)
 Update data model root object. More...
 

Protected Member Functions

virtual void saveModuleData (QString theModuleName, int type, QStringList theListOfFiles)
 
virtual void openModuleData (QString theModuleName, int type, QStringList &theListOfFiles)
 
virtual bool saveStudyData (const QString &theFileName, int type)
 
virtual bool openStudyData (const QString &theFileName, int type)
 
virtual std::vector< std::string > GetListOfFiles (const char *theModuleName, int type) const
 
virtual void SetListOfFiles (const char *theModuleName, int type, const std::vector< std::string > theListOfFiles)
 
virtual void dataModelInserted (const CAM_DataModel *)
 
virtual bool openDataModel (const QString &, CAM_DataModel *)
 
virtual CAM_ModuleObjectcreateModuleObject (LightApp_DataModel *theDataModel, SUIT_DataObject *theParent) const
 
- Protected Member Functions inherited from CAM_Study
virtual bool saveDataModel (const QString &, CAM_DataModel *)
 Called when data model is saved. More...
 
- Protected Member Functions inherited from SUIT_Study
virtual void setIsSaved (const bool)
 
virtual void setIsModified (const bool)
 
virtual void setRoot (SUIT_DataObject *)
 
virtual void setStudyName (const QString &)
 
virtual void operationStarted (SUIT_Operation *)
 Perform some actions when operation starting. More...
 
virtual void operationAborted (SUIT_Operation *)
 Perform some actions when operation aborted. More...
 
virtual void operationStopped (SUIT_Operation *)
 Perform some actions when operation stopped. More...
 
virtual void operationCommited (SUIT_Operation *)
 Perform some actions when operation commited. More...
 
virtual bool openTransaction ()
 Opens transaction for data modifications. More...
 
virtual bool abortTransaction ()
 Aborts transaction and all performed data modifications. More...
 
virtual bool hasTransaction () const
 Returns true if transaction is opened. More...
 
virtual bool commitTransaction (const QString &=QString())
 Commits transaction and all performed data modifications. More...
 

Private Member Functions

 _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::SalomeApp_Study ( SUIT_Application app)

Constructor.

◆ ~SalomeApp_Study()

SalomeApp_Study::~SalomeApp_Study ( )
virtual

Destructor.

References myObserver.

Member Function Documentation

◆ _PTR() [1/2]

SalomeApp_Study::_PTR ( Study  )
private

◆ _PTR() [2/2]

SalomeApp_Study::_PTR ( Study  ) const

◆ addComponent()

void SalomeApp_Study::addComponent ( const CAM_DataModel dm)
virtual

◆ centry()

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

◆ children()

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

Reimplemented from LightApp_Study.

References _PTR().

◆ closeDocument()

void SalomeApp_Study::closeDocument ( bool  permanently = true)
virtual

◆ componentDataType()

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

Reimplemented from LightApp_Study.

References _PTR(), and LightApp_Study::componentDataType().

◆ components()

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

Fills list with components names

Parameters
comp- list to be filled

Reimplemented from LightApp_Study.

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

◆ createDocument()

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

Create document.

Reimplemented from LightApp_Study.

◆ createModuleObject()

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 _PTR(), addComponent(), children(), SUIT_DataObject::children(), SalomeApp_DataObject::componentDataType(), CAM_DataModel::module(), CAM_Module::name(), and SUIT_Study::root().

◆ dataModelInserted()

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

◆ deleteReferencesTo()

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

Deletes all references to object

Parameters
obj- object

References _PTR().

◆ dump()

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 _PTR(), SUIT_Study::application(), CAM_Study::dataModels(), removeSavePoint(), saveModuleData(), saveStudyData(), and SalomeApp_VisualState::storeState().

◆ findObjectByEntry()

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.

◆ GetListOfFiles()

std::vector< std::string > SalomeApp_Study::GetListOfFiles ( const char *  theModuleName,
int  type 
) 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().

◆ getNameOfSavePoint()

QString SalomeApp_Study::getNameOfSavePoint ( int  savePoint)
Returns
a name of save point

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

◆ getSavePoints()

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

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

◆ GetTmpDir()

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

Reimplemented from LightApp_Study.

◆ isComponent()

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

Reimplemented from LightApp_Study.

References _PTR().

◆ isModified()

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

◆ isSaved()

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

Reimplemented from LightApp_Study.

References LightApp_Study::isSaved().

◆ loadDocument()

◆ Modified()

void SalomeApp_Study::Modified ( )
virtual

Set study modified to on.

Reimplemented from SUIT_Study.

References SUIT_Study::Modified().

◆ notebookVarUpdated

void SalomeApp_Study::notebookVarUpdated ( QString  theVarName)
signal

◆ onNoteBookVarUpdate

void SalomeApp_Study::onNoteBookVarUpdate ( QString  theVarName)
protectedslot

References notebookVarUpdated().

◆ openDataModel()

◆ openDocument()

◆ openModuleData()

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

Loads data of module

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

< TODO: conversion from size_t to int

Reimplemented from LightApp_Study.

References GetListOfFiles().

◆ openStudyData()

bool SalomeApp_Study::openStudyData ( const QString &  theFileName,
int  type 
)
protectedvirtual

Loads data for study

Reimplemented from LightApp_Study.

◆ referencedToEntry()

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 _PTR(), and LightApp_Study::referencedToEntry().

◆ removeSavePoint()

void SalomeApp_Study::removeSavePoint ( int  savePoint)

Removes a given save point

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

◆ RemoveTemporaryFiles()

void SalomeApp_Study::RemoveTemporaryFiles ( const char *  theModuleName,
bool  isMultiFile,
bool  force = false 
)
virtual

Removes temporary files

< TODO: conversion from size_t to int

Reimplemented from LightApp_Study.

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

◆ restoreState()

void SalomeApp_Study::restoreState ( int  savePoint)
virtual

Restores the study state.

Reimplemented from SUIT_Study.

References SUIT_Study::application(), and SalomeApp_VisualState::restoreState().

◆ saveDocument()

◆ saveDocumentAs()

bool SalomeApp_Study::saveDocumentAs ( const QString &  theFileName)
virtual

◆ saveModuleData()

void SalomeApp_Study::saveModuleData ( QString  theModuleName,
int  type,
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().

◆ saveStudyData()

bool SalomeApp_Study::saveStudyData ( const QString &  theFileName,
int  type 
)
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().

◆ SetListOfFiles()

void SalomeApp_Study::SetListOfFiles ( const char *  theModuleName,
int  type,
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().

◆ setNameOfSavePoint()

void SalomeApp_Study::setNameOfSavePoint ( int  savePoint,
const QString &  nameOfSavePoint 
)

Sets a name of save point

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

◆ studyName()

QString SalomeApp_Study::studyName ( ) const
virtual

Get study name.

Reimplemented from SUIT_Study.

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

◆ updateFromNotebook()

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

Mark the study as saved in the file

Parameters
theFileName- the name of file

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

◆ updateModelRoot

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

◆ myObserver

Observer_i* SalomeApp_Study::myObserver
private

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