Salome HOME
projects
/
modules
/
gui.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated copyright comment
[modules/gui.git]
/
src
/
LightApp
/
LightApp_Study.cxx
diff --git
a/src/LightApp/LightApp_Study.cxx
b/src/LightApp/LightApp_Study.cxx
index 1229f127fa39856ccbc7aa2310b23fb168671c8f..9aa9403316083dccaba1b99ec4add421919f854f 100644
(file)
--- a/
src/LightApp/LightApp_Study.cxx
+++ b/
src/LightApp/LightApp_Study.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-20
15 CEA/DEN, EDF R&D
, OPEN CASCADE
+// Copyright (C) 2007-20
24 CEA, EDF
, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-60,8
+60,6
@@
LightApp_Study::~LightApp_Study()
*/
bool LightApp_Study::createDocument( const QString& theStr )
{
*/
bool LightApp_Study::createDocument( const QString& theStr )
{
- setStudyName( QString( "Study%1" ).arg( LightApp_Application::studyId() ) );
-
// create myRoot
setRoot( new LightApp_RootObject( this ) );
// create myRoot
setRoot( new LightApp_RootObject( this ) );
@@
-79,7
+77,7
@@
bool LightApp_Study::openDocument( const QString& theFileName )
{
myDriver->ClearDriverContents();
// create files for models from theFileName
{
myDriver->ClearDriverContents();
// create files for models from theFileName
- if( !openStudyData(theFileName
))
+ if( !openStudyData(theFileName
, 0)) // 0 means persistence file
return false;
setRoot( new LightApp_RootObject( this ) ); // create myRoot
return false;
setRoot( new LightApp_RootObject( this ) ); // create myRoot
@@
-107,7
+105,7
@@
bool LightApp_Study::openDocument( const QString& theFileName )
bool LightApp_Study::loadDocument( const QString& theStudyName )
{
myDriver->ClearDriverContents();
bool LightApp_Study::loadDocument( const QString& theStudyName )
{
myDriver->ClearDriverContents();
- if( !openStudyData(theStudyName
))
+ if( !openStudyData(theStudyName
, 0)) // 0 means persistence file
return false;
setRoot( new LightApp_RootObject( this ) ); // create myRoot
return false;
setRoot( new LightApp_RootObject( this ) ); // create myRoot
@@
-157,7
+155,8
@@
bool LightApp_Study::saveDocumentAs( const QString& theFileName )
listOfFiles.clear();
aModel->saveAs( theFileName, this, listOfFiles );
if ( !listOfFiles.isEmpty() )
listOfFiles.clear();
aModel->saveAs( theFileName, this, listOfFiles );
if ( !listOfFiles.isEmpty() )
- saveModuleData(aModel->module()->name(), listOfFiles);
+ saveModuleData(aModel->module()->name(), 0, // 0 means persistence file
+ listOfFiles);
// Remove files if necessary. File is removed if it was in the list of files before
// saving and it is not contained in the list after saving. This provides correct
// Remove files if necessary. File is removed if it was in the list of files before
// saving and it is not contained in the list after saving. This provides correct
@@
-168,7
+167,7
@@
bool LightApp_Study::saveDocumentAs( const QString& theFileName )
std::set<std::string> aNewNames;
std::set<std::string> toRemove;
std::set<std::string> aNewNames;
std::set<std::string> toRemove;
-
in
t i, n;
+
size_
t i, n;
for( i = 0, n = aNewList.size(); i < n; i++ )
aNewNames.insert( aNewList[ i ] );
for( i = 0, n = anOldList.size(); i < n; i++ )
for( i = 0, n = aNewList.size(); i < n; i++ )
aNewNames.insert( aNewList[ i ] );
for( i = 0, n = anOldList.size(); i < n; i++ )
@@
-188,7
+187,7
@@
bool LightApp_Study::saveDocumentAs( const QString& theFileName )
myDriver->RemoveFiles( toRemoveList, isMultiFile );
}
myDriver->RemoveFiles( toRemoveList, isMultiFile );
}
- bool res = saveStudyData(theFileName
);
+ bool res = saveStudyData(theFileName
, 0); // 0 means persistence file
res = res && CAM_Study::saveDocumentAs( theFileName );
//SRN: BugID IPAL9377, removed usage of uninitialized variable <res>
if ( res )
res = res && CAM_Study::saveDocumentAs( theFileName );
//SRN: BugID IPAL9377, removed usage of uninitialized variable <res>
if ( res )
@@
-213,10
+212,11
@@
bool LightApp_Study::saveDocument()
listOfFiles.clear();
aModel->save( listOfFiles );
listOfFiles.clear();
aModel->save( listOfFiles );
- saveModuleData(aModel->module()->name(), listOfFiles);
+ saveModuleData(aModel->module()->name(), 0, // 0 means persistence file
+ listOfFiles);
}
}
- bool res = saveStudyData(studyName()
);
+ bool res = saveStudyData(studyName()
, 0); // 0 means persistence file
res = res && CAM_Study::saveDocument();
if (res)
emit saved( this );
res = res && CAM_Study::saveDocument();
if (res)
emit saved( this );
@@
-319,14
+319,14
@@
bool LightApp_Study::isSaved() const
/*!
Creates SComponent for module, necessary for SalomeApp study
*/
/*!
Creates SComponent for module, necessary for SalomeApp study
*/
-void LightApp_Study::addComponent(const CAM_DataModel*
dm
)
+void LightApp_Study::addComponent(const CAM_DataModel*
/*dm*/
)
{
}
/*!
Saves list file for module 'theModuleName'
*/
{
}
/*!
Saves list file for module 'theModuleName'
*/
-void LightApp_Study::saveModuleData(QString theModuleName, QStringList theListOfFiles)
+void LightApp_Study::saveModuleData(QString theModuleName,
int type,
QStringList theListOfFiles)
{
int aNb = theListOfFiles.count();
if ( aNb == 0 )
{
int aNb = theListOfFiles.count();
if ( aNb == 0 )
@@
-337,19
+337,19
@@
void LightApp_Study::saveModuleData(QString theModuleName, QStringList theListOf
for ( QStringList::Iterator it = theListOfFiles.begin(); it != theListOfFiles.end(); ++it ) {
if ( (*it).isEmpty() )
continue;
for ( QStringList::Iterator it = theListOfFiles.begin(); it != theListOfFiles.end(); ++it ) {
if ( (*it).isEmpty() )
continue;
- aListOfFiles[anIndex] = (*it).to
Latin1
().constData();
+ aListOfFiles[anIndex] = (*it).to
Utf8
().constData();
anIndex++;
}
anIndex++;
}
-
myDriver->SetListOfFiles(theModuleName.toLatin1().constData()
, aListOfFiles);
+
SetListOfFiles(theModuleName.toLatin1().constData(), type
, aListOfFiles);
}
/*!
Gets list of file for module 'theModuleNam'
*/
}
/*!
Gets list of file for module 'theModuleNam'
*/
-void LightApp_Study::openModuleData(QString theModuleName, QStringList& theListOfFiles)
+void LightApp_Study::openModuleData(QString theModuleName,
int /*type*/,
QStringList& theListOfFiles)
{
std::vector<std::string> aListOfFiles = myDriver->GetListOfFiles(theModuleName.toLatin1().constData());
{
std::vector<std::string> aListOfFiles = myDriver->GetListOfFiles(theModuleName.toLatin1().constData());
- int i, aLength =
aListOfFiles.size() - 1;
+ int i, aLength =
(int)aListOfFiles.size() - 1; //!< TODO: conversion size_t to int
if (aLength < 0)
return;
if (aLength < 0)
return;
@@
-362,7
+362,7
@@
void LightApp_Study::openModuleData(QString theModuleName, QStringList& theListO
/*!
Saves data from study
*/
/*!
Saves data from study
*/
-bool LightApp_Study::saveStudyData( const QString& theFileName )
+bool LightApp_Study::saveStudyData( const QString& theFileName
, int /*type*/
)
{
ModelList list; dataModels( list );
SUIT_ResourceMgr* resMgr = application()->resourceMgr();
{
ModelList list; dataModels( list );
SUIT_ResourceMgr* resMgr = application()->resourceMgr();
@@
-370,21
+370,21
@@
bool LightApp_Study::saveStudyData( const QString& theFileName )
return false;
bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
return false;
bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
- bool aRes = myDriver->SaveDatasInFile(theFileName.to
Latin1
(), isMultiFile);
+ bool aRes = myDriver->SaveDatasInFile(theFileName.to
Utf8
(), isMultiFile);
return aRes;
}
/*!
Opens data for study
*/
return aRes;
}
/*!
Opens data for study
*/
-bool LightApp_Study::openStudyData( const QString& theFileName )
+bool LightApp_Study::openStudyData( const QString& theFileName
, int /*type*/
)
{
SUIT_ResourceMgr* resMgr = application()->resourceMgr();
if( !resMgr )
return false;
bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
{
SUIT_ResourceMgr* resMgr = application()->resourceMgr();
if( !resMgr )
return false;
bool isMultiFile = resMgr->booleanValue( "Study", "multi_file", false );
- bool aRes = myDriver->ReadDatasFromFile(theFileName.to
Latin1
(), isMultiFile);
+ bool aRes = myDriver->ReadDatasFromFile(theFileName.to
Utf8
(), isMultiFile);
return aRes;
}
return aRes;
}
@@
-397,7
+397,8
@@
bool LightApp_Study::openDataModel( const QString& studyName, CAM_DataModel* dm
return false;
QStringList listOfFiles;
return false;
QStringList listOfFiles;
- openModuleData(dm->module()->name(), listOfFiles);
+ openModuleData(dm->module()->name(), 0, // 0 means persistence file
+ listOfFiles);
if (dm && dm->open(studyName, this, listOfFiles)) {
// Something has been read -> create data model tree
LightApp_DataModel* aDM = dynamic_cast<LightApp_DataModel*>( dm );
if (dm && dm->open(studyName, this, listOfFiles)) {
// Something has been read -> create data model tree
LightApp_DataModel* aDM = dynamic_cast<LightApp_DataModel*>( dm );
@@
-421,11
+422,9
@@
std::string LightApp_Study::GetTmpDir (const char* theURL,
\return list of files necessary for module
\param theModuleName - name of module
*/
\return list of files necessary for module
\param theModuleName - name of module
*/
-std::vector<std::string> LightApp_Study::GetListOfFiles(const char* theModuleName) const
+std::vector<std::string> LightApp_Study::GetListOfFiles(const char* theModuleName
, int /*type*/
) const
{
{
- std::vector<std::string> aListOfFiles;
- aListOfFiles = myDriver->GetListOfFiles(theModuleName);
- return aListOfFiles;
+ return myDriver->GetListOfFiles(theModuleName);
}
/*!
}
/*!
@@
-433,7
+432,7
@@
std::vector<std::string> LightApp_Study::GetListOfFiles(const char* theModuleNam
\param theModuleName - name of module
\param theListOfFiles - list of files
*/
\param theModuleName - name of module
\param theListOfFiles - list of files
*/
-void LightApp_Study::SetListOfFiles (const char* theModuleName, const std::vector<std::string> theListOfFiles)
+void LightApp_Study::SetListOfFiles (const char* theModuleName,
int /*type*/,
const std::vector<std::string> theListOfFiles)
{
myDriver->SetListOfFiles(theModuleName, theListOfFiles);
}
{
myDriver->SetListOfFiles(theModuleName, theListOfFiles);
}
@@
-441,7
+440,7
@@
void LightApp_Study::SetListOfFiles (const char* theModuleName, const std::vecto
/*!
Removes temporary files
*/
/*!
Removes temporary files
*/
-void LightApp_Study::RemoveTemporaryFiles (const char* theModuleName,
const bool isMultiFile) const
+void LightApp_Study::RemoveTemporaryFiles (const char* theModuleName,
bool isMultiFile, bool /*force*/)
{
if (isMultiFile)
return;
{
if (isMultiFile)
return;