SHAPER  9.12.0
SHAPERGUI_DataModel Class Reference

A Data Model class provides a connection of SALOME data structure and OpenParts application data model. More...

Inheritance diagram for SHAPERGUI_DataModel:
Inheritance graph

Public Member Functions

 SHAPERGUI_DataModel (SHAPERGUI *theModule)
 Constructor. More...
 
virtual bool open (const QString &thePath, CAM_Study *theStudy, QStringList theFiles)
 Open a data file. More...
 
virtual bool save (QStringList &theFiles)
 Save module data to file. More...
 
virtual bool saveAs (const QString &thePath, CAM_Study *theStudy, QStringList &theFiles)
 Save module data to a file. More...
 
virtual bool close ()
 Close data structure. More...
 
virtual bool create (CAM_Study *theStudy)
 Create data structure. More...
 
virtual bool isModified () const
 Returns True if the data structure has been modified. More...
 
virtual bool isSaved () const
 Returns True if the data structure is already saved. More...
 
virtual void initRootObject () override
 Creates a module root object if it has not been created yet and append it to the active study. More...
 
virtual void update (LightApp_DataObject *theObj=0, LightApp_Study *theStudy=0)
 Update data object. More...
 
virtual bool dumpPython (const QString &, CAM_Study *, bool, QStringList &)
 Redefinition of virtual method: include the module dump in the common SALOME dump. More...
 

Static Protected Member Functions

static void removeDirectory (const QString &theDirectoryName)
 Removes the directory with content if it exists. More...
 

Detailed Description

A Data Model class provides a connection of SALOME data structure and OpenParts application data model.

Constructor & Destructor Documentation

◆ SHAPERGUI_DataModel()

SHAPERGUI_DataModel::SHAPERGUI_DataModel ( SHAPERGUI theModule)

Constructor.

Parameters
theModulea module instance

Member Function Documentation

◆ open()

bool SHAPERGUI_DataModel::open ( const QString &  thePath,
CAM_Study *  theStudy,
QStringList  theFiles 
)
virtual

Open a data file.

Parameters
thePatha path to the directory
theStudya current study
theFilesa list of files to open

◆ save()

bool SHAPERGUI_DataModel::save ( QStringList &  theFiles)
virtual

Save module data to file.

Parameters
theFileslist of created files

◆ saveAs()

bool SHAPERGUI_DataModel::saveAs ( const QString &  thePath,
CAM_Study *  theStudy,
QStringList &  theFiles 
)
virtual

Save module data to a file.

Parameters
thePatha path to the directory
theStudya current study
theFilesa list of files to open

◆ close()

bool SHAPERGUI_DataModel::close ( )
virtual

Close data structure.

◆ create()

bool SHAPERGUI_DataModel::create ( CAM_Study *  theStudy)
virtual

Create data structure.

Parameters
theStudya current study

◆ isModified()

bool SHAPERGUI_DataModel::isModified ( ) const
virtual

Returns True if the data structure has been modified.

◆ isSaved()

bool SHAPERGUI_DataModel::isSaved ( ) const
virtual

Returns True if the data structure is already saved.

◆ initRootObject()

void SHAPERGUI_DataModel::initRootObject ( )
overridevirtual

Creates a module root object if it has not been created yet and append it to the active study.

It is necessary for correct persistent of the model.

◆ update()

void SHAPERGUI_DataModel::update ( LightApp_DataObject *  theObj = 0,
LightApp_Study *  theStudy = 0 
)
virtual

Update data object.

Parameters
theObjan data object
theStudya current study

◆ dumpPython()

bool SHAPERGUI_DataModel::dumpPython ( const QString &  thePath,
CAM_Study *  theStudy,
bool  isMultiFile,
QStringList &  theListOfFiles 
)
virtual

Redefinition of virtual method: include the module dump in the common SALOME dump.

◆ removeDirectory()

void SHAPERGUI_DataModel::removeDirectory ( const QString &  theDirectoryName)
staticprotected

Removes the directory with content if it exists.

Parameters
theDirectoryNamea directory name