General KERNEL Documentation     End User KERNEL Services  


idl/SALOMEDS.idl

Go to the documentation of this file.
00001 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00002 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
00003 // 
00004 //  This library is free software; you can redistribute it and/or 
00005 //  modify it under the terms of the GNU Lesser General Public
00006 //  License as published by the Free Software Foundation; either
00007 //  version 2.1 of the License.
00008 //
00009 //  This library is distributed in the hope that it will be useful,
00010 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 //  Lesser General Public License for more details.
00013 //
00014 //  You should have received a copy of the GNU Lesser General Public
00015 //  License along with this library; if not, write to the Free Software
00016 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00017 //
00018 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00019 //
00020 //
00021 //
00022 //  File   : SALOMEDS.idl
00023 //  Author : Yves FRICAUD
00024 //  $Header: /home/server/cvs/KERNEL/KERNEL_SRC/idl/SALOMEDS.idl,v 1.11 2006/06/01 11:15:15 jfa Exp $
00025 
00035 #ifndef _SALOMEDS_IDL_
00036 #define _SALOMEDS_IDL_
00037 
00038 #include "SALOME_Exception.idl"
00039 #include "SALOME_GenericObj.idl"
00040 
00045 module SALOMEDS
00046 {
00051   typedef string URL;
00052 
00055   typedef string ID;
00056 
00059   typedef string PersistentReference;
00060 
00063   typedef string SalomeReference;
00064 
00069   typedef sequence<string> ListOfOpenStudies;
00072   typedef sequence<string> ListOfFileNames;
00075   typedef sequence<string> ListOfDates ;
00078   typedef sequence<string> ListOfStrings ;
00081   typedef sequence<octet> TMPFile;
00082 
00083   // Reference to other objects is treated with function AddReference
00084   // and ReferencedObject
00085   // All other type of attributes defined in AttributeType enum are
00086   // treated with AddAdttribute and GetAttribute
00087   // The difference is made because Reference attribute don't contain
00088   // strings but reference to ID of other objects
00089 
00090   interface GenericAttribute;
00091   interface Study;
00092   interface StudyManager;
00093   interface StudyBuilder;
00094   interface SObject;
00095   interface SComponent;
00096   interface SComponentIterator;
00097   interface ChildIterator;
00098   interface Driver;
00099   interface AttributeStudyProperties;
00100   interface AttributeParameter;
00101   interface UseCaseIterator;
00102   interface UseCaseBuilder;
00103 
00106   typedef sequence<GenericAttribute> ListOfAttributes;
00107 
00110   exception NotImplemented {};
00111 
00112 
00113   //===========================================================================
00129   interface Study
00130   {
00131 
00132     exception StudyInvalidContext {};
00133     exception StudyInvalidComponent {};
00136     exception StudyInvalidDirectory {};
00139     exception StudyNameAlreadyUsed {};
00140     exception StudyObjectAlreadyExists {};
00143     exception StudyNameError {};
00144     exception StudyCommentError {};
00149     attribute string     Name; // equivalent to setName() & getName()
00154     attribute short      StudyId;
00157     typedef sequence<SObject> ListOfSObject;
00161     PersistentReference  GetPersistentReference();
00165     SalomeReference      GetTransientReference();
00166 
00170     boolean IsEmpty();
00178     SComponent FindComponent  (in string aComponentName);
00182     SComponent FindComponentID(in ID aComponentID);
00192     SObject       FindObject      (in string anObjectName);
00199     SObject       FindObjectID    (in ID aObjectID);
00206     SObject       CreateObjectID    (in ID aObjectID);
00213     SObject       FindObjectIOR   (in ID aObjectIOR);
00219     ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName);
00227     SObject FindObjectByPath(in string thePath);
00231     string  GetObjectPath(in Object theObject);
00232 
00240     void SetContext(in string thePath);
00247     string GetContext();
00252     ListOfStrings GetObjectNames(in string theContext);
00257     ListOfStrings GetDirectoryNames(in string theContext);
00262     ListOfStrings GetFileNames(in string theContext);
00267     ListOfStrings GetComponentNames(in string theContext);
00273     ChildIterator      NewChildIterator(in SObject aSO);
00280     SComponentIterator NewComponentIterator();
00289     StudyBuilder NewBuilder() ;
00294     void UpdateIORLabelMap(in string anIOR, in string anEntry);
00295 
00303     AttributeStudyProperties GetProperties();
00307     attribute boolean IsSaved;
00311     boolean IsModified();
00315     attribute string  URL;
00316 
00321     ListOfSObject FindDependances(in SObject anObject);
00322 
00327     string GetLastModificationDate();
00333     ListOfDates GetModificationsDate();
00339     string ConvertObjectToIOR(in Object theObject);
00345     Object ConvertIORToObject(in string theIOR);
00349     UseCaseBuilder  GetUseCaseBuilder();
00350 
00354     void Close();
00355 
00359     void EnableUseCaseAutoFilling(in boolean isEnabled);
00360 
00364     void AddPostponed(in string theIOR);
00365 
00366     void AddCreatedPostponed(in string theIOR);
00367 
00368     void RemovePostponed(in long theUndoLimit);
00369 
00370     void UndoPostponed(in long theWay);
00371 
00372     boolean DumpStudy(in string thePath, in string theBaseName, in boolean isPublished);
00373 
00379     AttributeParameter GetCommonParameters(in string theID, in long theSavePoint);
00380 
00387     AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint);
00388 
00389 
00395     string GetDefaultScript(in string theID, in string theModuleName);
00396 
00403     long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
00404 
00405   };
00406 
00407   //==========================================================================
00418   //==========================================================================
00419 
00420   interface StudyBuilder
00421   {
00426     exception LockProtection {};
00435     SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
00440     void       DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
00441         
00446     void       RemoveComponent(in SComponent aComponent) raises(LockProtection);
00447 
00459     SObject NewObject      (in SObject theFatherObject) raises(LockProtection);
00460 
00469     SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
00476     void    RemoveObject   (in SObject anObject) raises(LockProtection);
00483     void    RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
00484 
00491     void  LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
00497     void  Load (in SObject sco);
00498 
00508     GenericAttribute FindOrCreateAttribute(in  SObject        anObject,
00509                                       in  string         aTypeOfAttribute) raises(LockProtection);
00510 
00520     boolean FindAttribute(in  SObject        anObject,
00521                      out GenericAttribute anAttribute,
00522                      in  string         aTypeOfAttribute);
00531     void RemoveAttribute(in  SObject        anObject,
00532                 in  string         aTypeOfAttribute) raises(LockProtection);
00539     void Addreference(in SObject anObject,
00540                 in SObject theReferencedObject) ;
00541 
00547     void RemoveReference(in SObject anObject) ;
00548 
00556     void AddDirectory(in string theName) raises(LockProtection);
00557 
00567      void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
00574      boolean IsGUID(in SObject anObject, in string theGUID);
00575 
00583     void NewCommand(); // command management
00593     void CommitCommand() raises(LockProtection); // command management
00597     boolean HasOpenCommand();
00604     void AbortCommand(); // command management
00609     attribute long  UndoLimit;
00619     void Undo() raises (LockProtection);
00629     void Redo() raises (LockProtection);
00636     boolean GetAvailableUndos();
00643     boolean GetAvailableRedos();
00650     void SetName(in SObject theSO, in string theValue) raises (LockProtection);
00651 
00658     void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
00659 
00666     void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
00667   };
00668 
00669   //==========================================================================
00678   //==========================================================================
00679 
00680   interface StudyManager
00681   {
00685     void ping();
00686 
00696     Study NewStudy(in string study_name);
00697 
00706     Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
00707 
00712     void  Close(in Study aStudy);
00722     boolean  Save(in  Study aStudy, in boolean theMultiFile);
00728     boolean  SaveASCII(in  Study aStudy, in boolean theMultiFile);
00738     boolean  SaveAs(in URL   aUrl, // if the file already exists
00739           in Study aStudy,
00740           in boolean theMultiFile); // overwrite (as option)
00749     boolean  SaveAsASCII(in URL   aUrl, // if the file already exists
00750                 in Study aStudy,
00751                 in boolean theMultiFile); // overwrite (as option)
00752 
00753 
00760     ListOfOpenStudies GetOpenStudies();
00761 
00768     Study GetStudyByName  (in string aStudyName);
00769 
00776     Study GetStudyByID  (in short aStudyID);
00777 
00778     // copy/paste methods
00779 
00783     boolean CanCopy(in SObject theObject);
00788     boolean Copy(in SObject theObject);
00793     boolean CanPaste(in SObject theObject);
00800     SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
00801 
00807     string ConvertObjectToIOR(in Object theObject);
00813     Object ConvertIORToObject(in string theIOR); 
00814 
00821     long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal); 
00822 
00823 
00824   };
00825 
00826 
00827   //==========================================================================
00839   //==========================================================================
00840 
00841   interface SObject : SALOME::GenericObj
00842   {
00845     attribute string Name; // equivalent to setName() & getName()
00850     ID GetID();
00855     SComponent GetFatherComponent();
00860     SObject    GetFather();
00865     short      Tag();
00870     short      Depth();
00877     boolean FindSubObject (in long atag, out SObject obj);
00885     boolean FindAttribute(out GenericAttribute anAttribute,
00886                       in  string         aTypeOfAttribute);
00892     boolean ReferencedObject(out SObject obj); // A REVOIR
00900     ListOfAttributes     GetAllAttributes();
00905     Study GetStudy();
00906 
00912     Object GetObject();
00913 
00918     string GetName();
00919 
00924     string GetComment();
00925 
00930     string GetIOR();
00931 
00938     long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
00939   };
00940 
00941 
00942   //==========================================================================
00947   //==========================================================================
00948   interface GenericAttribute : SALOME::GenericObj
00949   {
00954     exception LockProtection {};
00961     void CheckLocked() raises (LockProtection);
00962 
00963     string Type();
00964 
00965     string GetClassType();    
00966      
00967     SObject GetSObject();
00968 
00975     long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
00976   };
00977 
00978 
00979 
00980   //==========================================================================
00987   //==========================================================================
00988   interface SComponent : SObject
00989   {
00994     string  ComponentDataType();
00999     boolean ComponentIOR (out ID theID); //returns True if there is an instance
01000                                          //In this case ID identifies this one
01001   };
01002 
01003 
01004   //==========================================================================
01010   //==========================================================================
01011   interface SComponentIterator : SALOME::GenericObj
01012   {
01016     void Init();
01021     boolean More();
01025     void Next();
01032     SComponent Value();
01033   };
01034 
01035   //==========================================================================
01041   //==========================================================================
01042   interface ChildIterator : SALOME::GenericObj
01043   {
01048     void Init();
01055     void InitEx(in boolean allLevels);
01060     boolean More();
01064     void Next();
01068     SObject Value();
01069   };
01070 
01071   //==========================================================================
01072   //==========================================================================
01077   interface UseCaseIterator : SALOME::GenericObj
01078   {
01083     void Init(in boolean allLevels);
01088     boolean More();
01092     void Next();
01096     SObject Value();
01097   };
01098 
01099   //==========================================================================
01100   //==========================================================================
01106   interface UseCaseBuilder : SALOME::GenericObj
01107   {
01114     boolean Append(in SObject theObject);
01121     boolean Remove(in SObject theObject);
01125     boolean AppendTo(in SObject theFather, in SObject theObject);
01129     boolean InsertBefore(in SObject theFirst, in SObject theNext);
01133     boolean SetCurrentObject(in SObject theObject);
01137     boolean SetRootCurrent();
01141     boolean HasChildren(in SObject theObject);
01145     boolean SetName(in string theName);
01149     string GetName();
01153     boolean IsUseCase(in SObject theObject);
01157     SObject GetCurrentObject();
01161     SObject AddUseCase(in string theName);
01165     UseCaseIterator GetUseCaseIterator(in SObject theObject);
01166   };
01167   //==========================================================================
01180   //==========================================================================
01181   interface Driver
01182   {
01183 
01197     TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
01198 
01210     TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
01211 
01221     boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
01222 
01232     boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
01233 
01240     void Close (in SComponent aSComponent);
01241     //void Close ( in string  aIORSComponent);
01242 
01248      string ComponentDataType();
01249 
01250     // Driver Transient -> persistent called for each object in study
01265     string IORToLocalPersistentID (in SObject theSObject,
01266                        in string IORString,
01267                        in boolean isMultiFile,
01268                        in boolean isASCII);
01284     string LocalPersistentIDToIOR (in SObject theSObject,
01285                        in string aLocalPersistentID,
01286                        in boolean isMultiFile,
01287                        in boolean isASCII)
01288       raises (SALOME::SALOME_Exception);
01289 
01290     // Publishing in the study
01296     boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
01309     SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
01310 
01311     // copy/paste methods
01312 
01318     boolean CanCopy(in SObject theObject);
01322     TMPFile CopyFrom(in SObject theObject, out long theObjectID);
01326     boolean CanPaste(in string theComponentName, in long theObjectID);
01330     SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);
01331 
01332   };
01333 };
01334 
01335 #endif