Back to index

salome-kernel  6.5.0
SALOMEDS_Study.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  File   : SALOMEDS_Study.hxx
00024 //  Author : Sergey RUIN
00025 //  Module : SALOME
00026 //
00027 #ifndef __SALOMEDS_STUDY_H__
00028 #define __SALOMEDS_STUDY_H__
00029 
00030 #include <vector>
00031 #include <string>
00032 
00033 #include "SALOMEDSClient.hxx"
00034 #include "SALOMEDSImpl_Study.hxx"
00035 
00036 // IDL headers
00037 #include <SALOMEconfig.h>
00038 #include CORBA_SERVER_HEADER(SALOMEDS)
00039 
00040 class Standard_EXPORT SALOMEDS_Study: public SALOMEDSClient_Study
00041 {
00042 
00043 private:
00044   bool                       _isLocal;
00045   SALOMEDSImpl_Study*        _local_impl;
00046   SALOMEDS::Study_var        _corba_impl;
00047   CORBA::ORB_var             _orb;
00048 
00049 public:
00050 
00051   SALOMEDS_Study(SALOMEDSImpl_Study* theStudy);
00052   SALOMEDS_Study(SALOMEDS::Study_ptr theStudy);
00053   ~SALOMEDS_Study();
00054 
00055   virtual std::string GetPersistentReference();
00056   virtual std::string GetTransientReference();
00057   virtual bool IsEmpty();
00058   virtual _PTR(SComponent) FindComponent (const std::string& aComponentName);
00059   virtual _PTR(SComponent) FindComponentID(const std::string& aComponentID);
00060   virtual _PTR(SObject) FindObject(const std::string& anObjectName);
00061   virtual std::vector<_PTR(SObject)> FindObjectByName( const std::string& anObjectName, const std::string& aComponentName ) ;  
00062   virtual _PTR(SObject) FindObjectID(const std::string& anObjectID);
00063   virtual _PTR(SObject) CreateObjectID(const std::string& anObjectID);
00064   virtual _PTR(SObject) FindObjectIOR(const std::string& anObjectIOR);
00065   virtual _PTR(SObject) FindObjectByPath(const std::string& thePath);
00066   virtual std::string GetObjectPath(const _PTR(SObject)& theSO);
00067   virtual void SetContext(const std::string& thePath);
00068   virtual std::string GetContext();  
00069   virtual std::vector<std::string> GetObjectNames(const std::string& theContext);
00070   virtual std::vector<std::string> GetDirectoryNames(const std::string& theContext);
00071   virtual std::vector<std::string> GetFileNames(const std::string& theContext);
00072   virtual std::vector<std::string> GetComponentNames(const std::string& theContext);
00073   virtual _PTR(ChildIterator) NewChildIterator(const _PTR(SObject)& theSO);
00074   virtual _PTR(SComponentIterator) NewComponentIterator();
00075   virtual _PTR(StudyBuilder) NewBuilder();
00076   virtual std::string Name();
00077   virtual void  Name(const std::string& name);
00078   virtual bool IsSaved();
00079   virtual void  IsSaved(bool save);
00080   virtual bool IsModified();
00081   virtual void Modified();
00082   virtual std::string URL();
00083   virtual void  URL(const std::string& url);
00084   virtual int StudyId();
00085   virtual void  StudyId(int id);
00086   virtual std::vector<_PTR(SObject)> FindDependances(const _PTR(SObject)& theSO);
00087   virtual _PTR(AttributeStudyProperties) GetProperties();
00088   virtual std::string GetLastModificationDate();
00089   virtual std::vector<std::string> GetModificationsDate();
00090   virtual _PTR(UseCaseBuilder) GetUseCaseBuilder();
00091   virtual void Close();
00092   virtual void EnableUseCaseAutoFilling(bool isEnabled);
00093   virtual bool DumpStudy(const std::string& thePath,const std::string& theBaseName,bool isPublished,bool isMultiFile); 
00094   virtual _PTR(AttributeParameter) GetCommonParameters(const std::string& theID, int theSavePoint);
00095   virtual _PTR(AttributeParameter) GetModuleParameters(const std::string& theID, 
00096                                                        const std::string& theModuleName, int theSavePoint);
00097   virtual void SetStudyLock(const std::string& theLockerID);
00098   virtual bool IsStudyLocked();
00099   virtual void UnLockStudy(const std::string& theLockerID);
00100   virtual std::vector<std::string> GetLockerID();
00101 
00102   virtual void SetReal(const std::string& theVarName, const double theValue);
00103   virtual void SetInteger(const std::string& theVarName, const int theValue);
00104   virtual void SetBoolean(const std::string& theVarName, const bool theValue);  
00105   virtual void SetString(const std::string& theVarName, const std::string& theValue);
00106   virtual void SetStringAsDouble(const std::string& theVarName, const double theValue);
00107   
00108   virtual double GetReal(const std::string& theVarName);
00109   virtual int GetInteger(const std::string& theVarName);
00110   virtual bool GetBoolean(const std::string& theVarName);
00111   virtual std::string GetString(const std::string& theVarName);
00112   
00113   virtual bool IsReal(const std::string& theVarName);
00114   virtual bool IsInteger(const std::string& theVarName);
00115   virtual bool IsBoolean(const std::string& theVarName);
00116   virtual bool IsString(const std::string& theVarName);
00117 
00118   virtual bool IsVariable(const std::string& theVarName);
00119   virtual std::vector<std::string> GetVariableNames();
00120 
00121   virtual bool RemoveVariable(const std::string& theVarName);
00122   virtual bool RenameVariable(const std::string& theVarName, const std::string& theNewVarName);
00123   virtual bool IsVariableUsed(const std::string& theVarName);
00124   virtual std::vector< std::vector<std::string> > ParseVariables(const std::string& theVars);
00125   virtual void attach(SALOMEDS::Observer_ptr theObserver,bool modify);
00126 
00127   std::string ConvertObjectToIOR(CORBA::Object_ptr theObject);
00128   CORBA::Object_ptr ConvertIORToObject(const std::string& theIOR);     
00129 
00130   SALOMEDS::Study_ptr GetStudy();
00131 
00132 private:
00133   void init_orb();
00134 
00135 };
00136 #endif