1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SALOMEDS_Study.hxx
23 // Author : Sergey RUIN
26 #ifndef __SALOMEDS_STUDY_H__
27 #define __SALOMEDS_STUDY_H__
32 #include "SALOMEDSClient.hxx"
33 #include "SALOMEDSImpl_Study.hxx"
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(SALOMEDS)
39 class Standard_EXPORT SALOMEDS_Study: public SALOMEDSClient_Study
44 SALOMEDSImpl_Study* _local_impl;
45 SALOMEDS::Study_var _corba_impl;
50 SALOMEDS_Study(SALOMEDSImpl_Study* theStudy);
51 SALOMEDS_Study(SALOMEDS::Study_ptr theStudy);
54 virtual std::string GetPersistentReference();
55 virtual std::string GetTransientReference();
56 virtual bool IsEmpty();
57 virtual _PTR(SComponent) FindComponent (const std::string& aComponentName);
58 virtual _PTR(SComponent) FindComponentID(const std::string& aComponentID);
59 virtual _PTR(SObject) FindObject(const std::string& anObjectName);
60 virtual std::vector<_PTR(SObject)> FindObjectByName( const std::string& anObjectName, const std::string& aComponentName ) ;
61 virtual _PTR(SObject) FindObjectID(const std::string& anObjectID);
62 virtual _PTR(SObject) CreateObjectID(const std::string& anObjectID);
63 virtual _PTR(SObject) FindObjectIOR(const std::string& anObjectIOR);
64 virtual _PTR(SObject) FindObjectByPath(const std::string& thePath);
65 virtual std::string GetObjectPath(const _PTR(SObject)& theSO);
66 virtual void SetContext(const std::string& thePath);
67 virtual std::string GetContext();
68 virtual std::vector<std::string> GetObjectNames(const std::string& theContext);
69 virtual std::vector<std::string> GetDirectoryNames(const std::string& theContext);
70 virtual std::vector<std::string> GetFileNames(const std::string& theContext);
71 virtual std::vector<std::string> GetComponentNames(const std::string& theContext);
72 virtual _PTR(ChildIterator) NewChildIterator(const _PTR(SObject)& theSO);
73 virtual _PTR(SComponentIterator) NewComponentIterator();
74 virtual _PTR(StudyBuilder) NewBuilder();
75 virtual std::string Name();
76 virtual void Name(const std::string& name);
77 virtual bool IsSaved();
78 virtual void IsSaved(bool save);
79 virtual bool IsModified();
80 virtual void Modified();
81 virtual std::string URL();
82 virtual void URL(const std::string& url);
83 virtual int StudyId();
84 virtual void StudyId(int id);
85 virtual std::vector<_PTR(SObject)> FindDependances(const _PTR(SObject)& theSO);
86 virtual _PTR(AttributeStudyProperties) GetProperties();
87 virtual std::string GetLastModificationDate();
88 virtual std::vector<std::string> GetModificationsDate();
89 virtual _PTR(UseCaseBuilder) GetUseCaseBuilder();
91 virtual void EnableUseCaseAutoFilling(bool isEnabled);
92 virtual bool DumpStudy(const std::string& thePath,const std::string& theBaseName,bool isPublished);
93 virtual _PTR(AttributeParameter) GetCommonParameters(const std::string& theID, int theSavePoint);
94 virtual _PTR(AttributeParameter) GetModuleParameters(const std::string& theID,
95 const std::string& theModuleName, int theSavePoint);
96 virtual void SetStudyLock(const std::string& theLockerID);
97 virtual bool IsStudyLocked();
98 virtual void UnLockStudy(const std::string& theLockerID);
99 virtual std::vector<std::string> GetLockerID();
101 virtual void SetReal(const std::string& theVarName, const double theValue);
102 virtual void SetInteger(const std::string& theVarName, const int theValue);
103 virtual void SetBoolean(const std::string& theVarName, const bool theValue);
105 virtual double GetReal(const std::string& theVarName);
106 virtual int GetInteger(const std::string& theVarName);
107 virtual bool GetBoolean(const std::string& theVarName);
109 virtual bool IsReal(const std::string& theVarName);
110 virtual bool IsInteger(const std::string& theVarName);
111 virtual bool IsBoolean(const std::string& theVarName);
113 virtual bool IsVariable(const std::string& theVarName);
114 virtual std::vector<std::string> GetVariableNames();
116 virtual bool RemoveVariable(const std::string& theVarName);
117 virtual bool RenameVariable(const std::string& theVarName, const std::string& theNewVarName);
118 virtual bool IsVariableUsed(const std::string& theVarName);
119 virtual std::vector< std::vector<std::string> > ParseVariables(const std::string& theVars);
121 std::string ConvertObjectToIOR(CORBA::Object_ptr theObject);
122 CORBA::Object_ptr ConvertIORToObject(const std::string& theIOR);
124 SALOMEDS::Study_ptr GetStudy();