#include <SALOMEDSImpl_StudyManager.hxx>
Public Member Functions | |
SALOMEDSImpl_StudyManager () | |
standard constructor More... | |
virtual | ~SALOMEDSImpl_StudyManager () |
standard destructor More... | |
virtual SALOMEDSImpl_Study * | NewStudy (const std::string &study_name) |
method to Create a New Study of name study_name More... | |
virtual SALOMEDSImpl_Study * | Open (const std::string &aStudyUrl) |
method to Open a Study from it's persistent reference More... | |
virtual void | Close (SALOMEDSImpl_Study *aStudy) |
method to close a Study More... | |
virtual bool | Save (SALOMEDSImpl_Study *aStudy, SALOMEDSImpl_DriverFactory *aFactory, bool theMultiFile) |
method to save a Study More... | |
virtual bool | SaveASCII (SALOMEDSImpl_Study *aStudy, SALOMEDSImpl_DriverFactory *aFactory, bool theMultiFile) |
virtual bool | SaveAs (const std::string &aUrl, SALOMEDSImpl_Study *aStudy, SALOMEDSImpl_DriverFactory *aFactory, bool theMultiFile) |
method to save a Study to the persistent reference aUrl More... | |
virtual bool | SaveAsASCII (const std::string &aUrl, SALOMEDSImpl_Study *aStudy, SALOMEDSImpl_DriverFactory *aFactory, bool theMultiFile) |
virtual std::vector < SALOMEDSImpl_Study * > | GetOpenStudies () |
method to Get name list of open studies in the session More... | |
virtual SALOMEDSImpl_Study * | GetStudyByName (const std::string &aStudyName) |
method to get a Study from it's name More... | |
virtual SALOMEDSImpl_Study * | GetStudyByID (int aStudyID) |
method to get a Study from it's ID More... | |
DF_Document * | GetDocumentOfStudy (SALOMEDSImpl_Study *theStudy) |
Function : GetDocumentOfStudy Purpose : More... | |
DF_Document * | GetClipboard () |
bool | CopyLabel (SALOMEDSImpl_Study *theSourceStudy, SALOMEDSImpl_Driver *theEngine, const int theSourceStartDepth, const DF_Label &theSource, const DF_Label &theDestinationMain) |
Function : CopyLabel Purpose : More... | |
DF_Label | PasteLabel (SALOMEDSImpl_Study *theDestinationStudy, SALOMEDSImpl_Driver *theEngine, const DF_Label &theSource, const DF_Label &theDestinationStart, const int theCopiedStudyID, const bool isFirstElement) |
Function : PasteLabel Purpose : More... | |
virtual bool | CanCopy (const SALOMEDSImpl_SObject &theObject, SALOMEDSImpl_Driver *Engine) |
Function : CanCopy Purpose : More... | |
virtual bool | Copy (const SALOMEDSImpl_SObject &theObject, SALOMEDSImpl_Driver *Engine) |
Function : Copy Purpose : More... | |
virtual bool | CanPaste (const SALOMEDSImpl_SObject &theObject, SALOMEDSImpl_Driver *Engine) |
Function : CanPaste Purpose : More... | |
virtual SALOMEDSImpl_SObject | Paste (const SALOMEDSImpl_SObject &theObject, SALOMEDSImpl_Driver *Engine) |
Function : Paste Purpose : More... | |
virtual bool | Impl_SaveAs (const std::string &aUrl, SALOMEDSImpl_Study *aStudy, SALOMEDSImpl_DriverFactory *aFactory, bool theMultiFile, bool theASCII) |
Function : _SaveAs Purpose : save the study in HDF file. More... | |
virtual bool | Impl_SaveObject (const SALOMEDSImpl_SObject &SC, HDFgroup *hdf_group_datatype) |
Function : Impl_SaveObject Purpose : More... | |
virtual std::string | Impl_SubstituteSlash (const std::string &aUrl) |
Function : Impl_SubstituteSlash Purpose : More... | |
virtual bool | Impl_SaveProperties (SALOMEDSImpl_Study *aStudy, HDFgroup *hdf_group) |
Function : _SaveProperties Purpose : save the study properties in HDF file. More... | |
std::string | GetErrorCode () |
virtual bool | IsError () |
Private Attributes | |
DF_Application * | _appli |
int | _IDcounter |
DF_Document * | _clipboard |
std::string | _errorCode |
SALOMEDSImpl_StudyManager::SALOMEDSImpl_StudyManager | ( | ) |
standard constructor
Function : SALOMEDSImpl_StudyManager Purpose : SALOMEDSImpl_StudyManager constructor.
References _appli, _clipboard, _errorCode, _IDcounter, and DF_Application::NewDocument().
|
virtual |
standard destructor
Function : ~SALOMEDSImpl_StudyManager Purpose : SALOMEDSImpl_StudyManager destructor.
References _appli, _clipboard, and DF_Application::Close().
|
virtual |
Function : CanCopy Purpose :
References _errorCode, SALOMEDSImpl_Driver::CanCopy(), SALOMEDSImpl_SComponent::ComponentIOR(), SALOMEDSImpl_SObject::GetFatherComponent(), and SALOMEDSImpl_SObject::GetLabel().
Referenced by SALOMEDS_StudyManager::CanCopy(), and SALOMEDS_StudyManager_i::CanCopy().
|
virtual |
Function : CanPaste Purpose :
References _clipboard, _errorCode, SALOMEDSImpl_Driver::CanPaste(), SALOMEDSImpl_SComponent::ComponentIOR(), DF_Label::Father(), DF_Label::FindAttribute(), DF_Label::FindChild(), SALOMEDSImpl_SObject::GetFatherComponent(), SALOMEDSImpl_AttributeInteger::GetID(), SALOMEDSImpl_AttributeComment::GetID(), DF_Document::Main(), DF_Label::Root(), SALOMEDSImpl_AttributeInteger::Value(), and SALOMEDSImpl_AttributeComment::Value().
Referenced by SALOMEDS_StudyManager::CanPaste(), and SALOMEDS_StudyManager_i::CanPaste().
|
virtual |
method to close a Study
Function : Close Purpose : Close a study.
If the study hasn't been saved, ask the user to confirm the close action without saving
References _appli, _errorCode, DF_Application::Close(), SALOMEDSImpl_Study::Close(), and SALOMEDSImpl_Study::GetDocument().
|
virtual |
Function : Copy Purpose :
References _appli, _clipboard, _errorCode, DF_Application::Close(), SALOMEDSImpl_Driver::ComponentDataType(), CopyLabel(), DF_Label::Depth(), DF_Label::ForgetAllAttributes(), GetDocumentOfStudy(), SALOMEDSImpl_AttributeIOR::GetID(), SALOMEDSImpl_SObject::GetLabel(), SALOMEDSImpl_SObject::GetStudy(), DF_Label::IsAttribute(), DF_Document::Main(), DF_Application::NewDocument(), DF_Label::Root(), SALOMEDSImpl_AttributeInteger::Set(), SALOMEDSImpl_AttributeComment::Set(), and SALOMEDSImpl_Study::StudyId().
Referenced by SALOMEDS_StudyManager::Copy(), and SALOMEDS_StudyManager_i::Copy().
bool SALOMEDSImpl_StudyManager::CopyLabel | ( | SALOMEDSImpl_Study * | theSourceStudy, |
SALOMEDSImpl_Driver * | theEngine, | ||
const int | theSourceStartDepth, | ||
const DF_Label & | theSource, | ||
const DF_Label & | theDestinationMain | ||
) |
Function : CopyLabel Purpose :
References _errorCode, DF_Label::AddAttribute(), SALOMEDSImpl_Driver::CopyFrom(), DF_Label::Depth(), DF_Label::Entry(), DF_Label::Father(), DF_Label::FindAttribute(), DF_Label::FindChild(), SALOMEDSImpl_Study::FindObjectID(), SALOMEDSImpl_TMPFile::Get(), DF_Label::GetAttributes(), SALOMEDSImpl_AttributeName::GetID(), SALOMEDSImpl_GenericAttribute::Impl_GetType(), DF_Attribute::NewEmpty(), DF_Attribute::Paste(), SALOMEDSImpl_AttributeInteger::Set(), SALOMEDSImpl_AttributeName::Set(), SALOMEDSImpl_AttributeComment::Set(), DF_Label::Tag(), and SALOMEDSImpl_AttributeName::Value().
Referenced by Copy().
DF_Document* SALOMEDSImpl_StudyManager::GetClipboard | ( | ) |
DF_Document * SALOMEDSImpl_StudyManager::GetDocumentOfStudy | ( | SALOMEDSImpl_Study * | theStudy | ) |
Function : GetDocumentOfStudy Purpose :
References SALOMEDSImpl_Study::_doc, and _errorCode.
std::string SALOMEDSImpl_StudyManager::GetErrorCode | ( | ) |
Referenced by SALOMEDS_StudyManager_i::GetStudyByID(), and SALOMEDS_StudyManager_i::GetStudyByName().
|
virtual |
method to Get name list of open studies in the session
Function : GetOpenStudies Purpose : Get name list of open studies in the session.
References _appli, _clipboard, _errorCode, DF_Application::GetDocument(), DF_Application::GetDocumentIDs(), SALOMEDSImpl_Study::GetStudy(), DF_Document::Main(), and DF_Application::NbDocuments().
Referenced by SALOMEDS_StudyManager::GetOpenStudies(), SALOMEDS_StudyManager_i::GetOpenStudies(), and GetStudyByID().
|
virtual |
method to get a Study from it's ID
Function : GetStudyByID Purpose : Get a study from its ID.
References _appli, _errorCode, GetOpenStudies(), and DF_Application::NbDocuments().
Referenced by SALOMEDS_StudyManager_i::CanCopy(), SALOMEDS_StudyManager_i::CanPaste(), SALOMEDS_StudyManager_i::Copy(), SALOMEDS_StudyManager_i::GetStudyByID(), SALOMEDS_StudyManager_i::Save(), SALOMEDS_StudyManager_i::SaveAs(), SALOMEDS_StudyManager_i::SaveAsASCII(), and SALOMEDS_StudyManager_i::SaveASCII().
|
virtual |
method to get a Study from it's name
Function : GetStudyByName Purpose : Get a study from its name.
Referenced by SALOMEDS_StudyManager_i::GetStudyByName().
|
virtual |
Function : _SaveAs Purpose : save the study in HDF file.
References _errorCode, HDFfile::CloseOnDisk(), HDFgroup::CloseOnDisk(), HDFdataset::CloseOnDisk(), SALOMEDSImpl_SComponent::ComponentDataType(), SALOMEDSImpl_SComponent::ComponentIOR(), HDFascii::ConvertFromHDFToASCII(), HDFfile::CreateOnDisk(), HDFgroup::CreateOnDisk(), HDFdataset::CreateOnDisk(), SALOMEDSImpl_TMPFile::Data(), SALOMEDSImpl_Study::FindObjectID(), SALOMEDSImpl_SObject::GetComment(), SALOMEDSImpl_Tool::GetDirFromPath(), SALOMEDSImpl_DriverFactory::GetDriverByIOR(), SALOMEDSImpl_DriverFactory::GetDriverByType(), SALOMEDSImpl_StudyBuilder::GetErrorCode(), SALOMEDSImpl_SObject::GetID(), SALOMEDSImpl_Tool::GetNameFromPath(), SALOMEDSImpl_Study::GetProperties(), SALOMEDSImpl_Tool::GetTmpDir(), HDF_STRING, Impl_SaveObject(), Impl_SaveProperties(), SALOMEDSImpl_SComponentIterator::Init(), SALOMEDSImpl_Study::IsSaved(), SALOMEDSImpl_StudyBuilder::LoadWith(), SALOMEDSImpl_SComponentIterator::More(), SALOMEDSImpl_Study::myNoteBookVars, SALOMEDSImpl_Study::Name(), SALOMEDSImpl_Study::NewBuilder(), SALOMEDSImpl_Study::NewComponentIterator(), SALOMEDSImpl_SComponentIterator::Next(), SALOMEDSImpl_Driver::Save(), SALOMEDSImpl_Driver::SaveASCII(), SaveAttributes(), SALOMEDSImpl_AttributeStudyProperties::SetComponentVersion(), Translate_IOR_to_persistentID(), SALOMEDS::unlock(), SALOMEDSImpl_Study::URL(), USE_CASE_LABEL_ID, SALOMEDSImpl_SComponentIterator::Value(), SALOMEDSImpl_Driver::Version(), and HDFdataset::WriteOnDisk().
Referenced by Save(), SaveAs(), SaveAsASCII(), and SaveASCII().
|
virtual |
Function : Impl_SaveObject Purpose :
References _errorCode, HDFgroup::CloseOnDisk(), HDFgroup::CreateOnDisk(), DF_Label::GetAttributes(), SALOMEDSImpl_SObject::GetID(), SALOMEDSImpl_SObject::GetLabel(), DF_ChildIterator::Init(), SaveAttributes(), SALOME_ModuleCatalog::SO, SALOMEDSImpl_Study::SObject(), and DF_ChildIterator::Value().
Referenced by Impl_SaveAs().
|
virtual |
Function : _SaveProperties Purpose : save the study properties in HDF file.
References _errorCode, HDFdataset::CloseOnDisk(), HDFdataset::CreateOnDisk(), SALOMEDSImpl_AttributeStudyProperties::GetComment(), SALOMEDSImpl_AttributeStudyProperties::GetComponentsVersions(), SALOMEDSImpl_AttributeStudyProperties::GetCreationMode(), SALOMEDSImpl_AttributeStudyProperties::GetModifications(), SALOMEDSImpl_Study::GetProperties(), SALOMEDSImpl_Tool::GetSystemDate(), SALOMEDSImpl_AttributeStudyProperties::GetUnits(), SALOMEDSImpl_Tool::GetUserName(), HDF_STRING, SALOMEDSImpl_AttributeStudyProperties::IsLocked(), SALOMEDSImpl_AttributeStudyProperties::SetModification(), SALOMEDSImpl_AttributeStudyProperties::SetModified(), SALOMEDS::unlock(), and HDFdataset::WriteOnDisk().
Referenced by Impl_SaveAs().
|
virtual |
Function : Impl_SubstituteSlash Purpose :
References _errorCode.
|
virtual |
|
virtual |
method to Create a New Study of name study_name
Function : NewStudy Purpose : Create a New Study of name study_name.
References _appli, _errorCode, _IDcounter, SALOMEDSImpl_Study::GetProperties(), SALOMEDSImpl_Tool::GetSystemDate(), SALOMEDSImpl_Tool::GetUserName(), DF_Application::NewDocument(), SALOMEDSImpl_AttributeStudyProperties::SetCreationMode(), SALOMEDSImpl_AttributeStudyProperties::SetModification(), and SALOMEDSImpl_Study::StudyId().
Referenced by main(), and SALOMEDSImplTest::testAttributeParameter().
|
virtual |
method to Open a Study from it's persistent reference
Function : Open Purpose : Open a Study from it's persistent reference.
References _appli, _errorCode, _IDcounter, BuildTree(), HDFfile::CloseOnDisk(), HDFascii::ConvertFromASCIIToHDF(), HDFfile::ExistInternalObject(), SALOMEDSImpl_SObject::GetComment(), SALOMEDSImpl_AttributeStudyProperties::GetComponentVersions(), SALOMEDSImpl_IParameters::getDefaultVisualComponent(), SALOMEDSImpl_Tool::GetDirFromPath(), SALOMEDSImpl_Study::GetProperties(), HDF_RDONLY, HDFascii::isASCII(), DF_Document::Main(), SALOMEDSImpl_SComponentIterator::More(), SALOMEDSImpl_Study::NewComponentIterator(), DF_Application::NewDocument(), SALOMEDSImpl_SComponentIterator::Next(), HDFfile::OpenOnDisk(), ReadNoteBookVariables(), SALOMEDSImpl_Tool::RemoveTemporaryFiles(), SALOMEDSImpl_AttributePersistentRef::Set(), SALOMEDSImpl_AttributeStudyProperties::SetComponentVersion(), SALOMEDSImpl_Study::StudyId(), SALOMEDS::unlock(), SALOMEDSImpl_Study::URL(), and SALOMEDSImpl_SComponentIterator::Value().
|
virtual |
Function : Paste Purpose :
References _clipboard, _errorCode, DF_Label::FindAttribute(), GetDocumentOfStudy(), SALOMEDSImpl_SObject::GetFatherComponent(), SALOMEDSImpl_AttributeInteger::GetID(), SALOMEDSImpl_AttributeComment::GetID(), SALOMEDSImpl_SObject::GetID(), SALOMEDSImpl_Study::GetProperties(), SALOMEDSImpl_SObject::GetStudy(), SALOMEDSImpl_AttributeStudyProperties::IsLocked(), DF_Label::Label(), DF_Document::Main(), PasteLabel(), DF_Label::Root(), SALOMEDSImpl_Study::SObject(), and SALOMEDSImpl_AttributeInteger::Value().
DF_Label SALOMEDSImpl_StudyManager::PasteLabel | ( | SALOMEDSImpl_Study * | theDestinationStudy, |
SALOMEDSImpl_Driver * | theEngine, | ||
const DF_Label & | theSource, | ||
const DF_Label & | theDestinationStart, | ||
const int | theCopiedStudyID, | ||
const bool | isFirstElement | ||
) |
Function : PasteLabel Purpose :
References _errorCode, SALOMEDSImpl_AttributeTarget::Add(), DF_Label::AddAttribute(), SALOMEDSImpl_Study::addSO_Notification(), SALOMEDSImpl_Driver::CanPaste(), DF_Label::Depth(), DF_Label::Entry(), DF_Label::Father(), DF_Label::FindAttribute(), DF_Label::FindChild(), SALOMEDSImpl_Study::FindObjectID(), DF_Label::ForgetAttribute(), DF_Label::GetAttributes(), SALOMEDSImpl_SObject::GetFatherComponent(), SALOMEDSImpl_AttributeInteger::GetID(), SALOMEDSImpl_AttributeName::GetID(), SALOMEDSImpl_AttributeComment::GetID(), SALOMEDSImpl_Study::GetSObject(), DF_Attribute::ID(), DF_Label::Label(), DF_Attribute::NewEmpty(), DF_Attribute::Paste(), SALOMEDSImpl_Driver::PasteInto(), DF_Label::Root(), SALOMEDSImpl_AttributeTarget::Set(), SALOMEDSImpl_AttributeReference::Set(), SALOMEDSImpl_AttributeName::Set(), SALOMEDSImpl_Study::SObject(), SALOMEDSImpl_Study::StudyId(), DF_Label::Tag(), SALOMEDSImpl_AttributeInteger::Value(), SALOMEDSImpl_AttributeName::Value(), and SALOMEDSImpl_AttributeComment::Value().
Referenced by Paste().
|
virtual |
method to save a Study
Function : Save Purpose : Save a Study to it's persistent reference.
References _errorCode, Impl_SaveAs(), and SALOMEDSImpl_Study::URL().
Referenced by SALOMEDS_StudyManager_i::Save().
|
virtual |
method to save a Study to the persistent reference aUrl
Function : SaveAs Purpose : Save a study to the persistent reference aUrl.
References _errorCode, and Impl_SaveAs().
Referenced by SALOMEDS_StudyManager_i::SaveAs().
|
virtual |
References _errorCode, and Impl_SaveAs().
Referenced by SALOMEDS_StudyManager_i::SaveAsASCII().
|
virtual |
References _errorCode, Impl_SaveAs(), and SALOMEDSImpl_Study::URL().
Referenced by SALOMEDS_StudyManager_i::SaveASCII().
|
private |
Referenced by Close(), Copy(), GetOpenStudies(), GetStudyByID(), NewStudy(), Open(), SALOMEDSImpl_StudyManager(), and ~SALOMEDSImpl_StudyManager().
|
private |
Referenced by CanPaste(), Copy(), GetOpenStudies(), Paste(), SALOMEDSImpl_StudyManager(), and ~SALOMEDSImpl_StudyManager().
|
private |
Referenced by CanCopy(), CanPaste(), Close(), Copy(), CopyLabel(), GetDocumentOfStudy(), GetOpenStudies(), GetStudyByID(), Impl_SaveAs(), Impl_SaveObject(), Impl_SaveProperties(), Impl_SubstituteSlash(), NewStudy(), Open(), Paste(), PasteLabel(), SALOMEDSImpl_StudyManager(), Save(), SaveAs(), SaveAsASCII(), and SaveASCII().
|
private |
Referenced by NewStudy(), Open(), and SALOMEDSImpl_StudyManager().