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.2.4 2006/10/16 13:22:12 mpv 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 long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
00404 
00405 
00410     void SetStudyLock(in string theLockerID);
00411 
00415     boolean IsStudyLocked();
00416 
00421     void UnLockStudy(in string theLockerID);
00422 
00426     ListOfStrings GetLockerID();
00427 
00428 
00429   };
00430 
00431   //==========================================================================
00442   //==========================================================================
00443 
00444   interface StudyBuilder
00445   {
00450     exception LockProtection {};
00459     SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
00464     void       DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
00465         
00470     void       RemoveComponent(in SComponent aComponent) raises(LockProtection);
00471 
00483     SObject NewObject      (in SObject theFatherObject) raises(LockProtection);
00484 
00493     SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
00500     void    RemoveObject   (in SObject anObject) raises(LockProtection);
00507     void    RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
00508 
00515     void  LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
00521     void  Load (in SObject sco);
00522 
00532     GenericAttribute FindOrCreateAttribute(in  SObject        anObject,
00533                                       in  string         aTypeOfAttribute) raises(LockProtection);
00534 
00544     boolean FindAttribute(in  SObject        anObject,
00545                      out GenericAttribute anAttribute,
00546                      in  string         aTypeOfAttribute);
00555     void RemoveAttribute(in  SObject        anObject,
00556                 in  string         aTypeOfAttribute) raises(LockProtection);
00563     void Addreference(in SObject anObject,
00564                 in SObject theReferencedObject) ;
00565 
00571     void RemoveReference(in SObject anObject) ;
00572 
00580     void AddDirectory(in string theName) raises(LockProtection);
00581 
00591      void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
00598      boolean IsGUID(in SObject anObject, in string theGUID);
00599 
00607     void NewCommand(); // command management
00617     void CommitCommand() raises(LockProtection); // command management
00621     boolean HasOpenCommand();
00628     void AbortCommand(); // command management
00633     attribute long  UndoLimit;
00643     void Undo() raises (LockProtection);
00653     void Redo() raises (LockProtection);
00660     boolean GetAvailableUndos();
00667     boolean GetAvailableRedos();
00674     void SetName(in SObject theSO, in string theValue) raises (LockProtection);
00675 
00682     void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
00683 
00690     void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
00691   };
00692 
00693   //==========================================================================
00702   //==========================================================================
00703 
00704   interface StudyManager
00705   {
00709     void ping();
00710 
00720     Study NewStudy(in string study_name);
00721 
00730     Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
00731 
00736     void  Close(in Study aStudy);
00746     boolean  Save(in  Study aStudy, in boolean theMultiFile);
00752     boolean  SaveASCII(in  Study aStudy, in boolean theMultiFile);
00762     boolean  SaveAs(in URL   aUrl, // if the file already exists
00763           in Study aStudy,
00764           in boolean theMultiFile); // overwrite (as option)
00773     boolean  SaveAsASCII(in URL   aUrl, // if the file already exists
00774                 in Study aStudy,
00775                 in boolean theMultiFile); // overwrite (as option)
00776 
00777 
00784     ListOfOpenStudies GetOpenStudies();
00785 
00792     Study GetStudyByName  (in string aStudyName);
00793 
00800     Study GetStudyByID  (in short aStudyID);
00801 
00802     // copy/paste methods
00803 
00807     boolean CanCopy(in SObject theObject);
00812     boolean Copy(in SObject theObject);
00817     boolean CanPaste(in SObject theObject);
00824     SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
00825 
00831     string ConvertObjectToIOR(in Object theObject);
00837     Object ConvertIORToObject(in string theIOR); 
00838 
00845     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal); 
00846 
00847 
00848   };
00849 
00850 
00851   //==========================================================================
00863   //==========================================================================
00864 
00865   interface SObject : SALOME::GenericObj
00866   {
00869     attribute string Name; // equivalent to setName() & getName()
00874     ID GetID();
00879     SComponent GetFatherComponent();
00884     SObject    GetFather();
00889     short      Tag();
00894     short      Depth();
00901     boolean FindSubObject (in long atag, out SObject obj);
00909     boolean FindAttribute(out GenericAttribute anAttribute,
00910                       in  string         aTypeOfAttribute);
00916     boolean ReferencedObject(out SObject obj); // A REVOIR
00924     ListOfAttributes     GetAllAttributes();
00929     Study GetStudy();
00930 
00936     Object GetObject();
00937 
00942     string GetName();
00943 
00948     string GetComment();
00949 
00954     string GetIOR();
00955 
00962     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
00963   };
00964 
00965 
00966   //==========================================================================
00971   //==========================================================================
00972   interface GenericAttribute : SALOME::GenericObj
00973   {
00978     exception LockProtection {};
00985     void CheckLocked() raises (LockProtection);
00986 
00987     string Type();
00988 
00989     string GetClassType();    
00990      
00991     SObject GetSObject();
00992 
00999     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
01000   };
01001 
01002 
01003 
01004   //==========================================================================
01011   //==========================================================================
01012   interface SComponent : SObject
01013   {
01018     string  ComponentDataType();
01023     boolean ComponentIOR (out ID theID); //returns True if there is an instance
01024                                          //In this case ID identifies this one
01025   };
01026 
01027 
01028   //==========================================================================
01034   //==========================================================================
01035   interface SComponentIterator : SALOME::GenericObj
01036   {
01040     void Init();
01045     boolean More();
01049     void Next();
01056     SComponent Value();
01057   };
01058 
01059   //==========================================================================
01065   //==========================================================================
01066   interface ChildIterator : SALOME::GenericObj
01067   {
01072     void Init();
01079     void InitEx(in boolean allLevels);
01084     boolean More();
01088     void Next();
01092     SObject Value();
01093   };
01094 
01095   //==========================================================================
01096   //==========================================================================
01101   interface UseCaseIterator : SALOME::GenericObj
01102   {
01107     void Init(in boolean allLevels);
01112     boolean More();
01116     void Next();
01120     SObject Value();
01121   };
01122 
01123   //==========================================================================
01124   //==========================================================================
01130   interface UseCaseBuilder : SALOME::GenericObj
01131   {
01138     boolean Append(in SObject theObject);
01145     boolean Remove(in SObject theObject);
01149     boolean AppendTo(in SObject theFather, in SObject theObject);
01153     boolean InsertBefore(in SObject theFirst, in SObject theNext);
01157     boolean SetCurrentObject(in SObject theObject);
01161     boolean SetRootCurrent();
01165     boolean HasChildren(in SObject theObject);
01169     boolean SetName(in string theName);
01173     string GetName();
01177     boolean IsUseCase(in SObject theObject);
01181     SObject GetCurrentObject();
01185     SObject AddUseCase(in string theName);
01189     UseCaseIterator GetUseCaseIterator(in SObject theObject);
01190   };
01191   //==========================================================================
01204   //==========================================================================
01205   interface Driver
01206   {
01207 
01221     TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
01222 
01234     TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
01235 
01245     boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
01246 
01256     boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
01257 
01264     void Close (in SComponent aSComponent);
01265     //void Close ( in string  aIORSComponent);
01266 
01272      string ComponentDataType();
01273 
01274     // Driver Transient -> persistent called for each object in study
01289     string IORToLocalPersistentID (in SObject theSObject,
01290                        in string IORString,
01291                        in boolean isMultiFile,
01292                        in boolean isASCII);
01308     string LocalPersistentIDToIOR (in SObject theSObject,
01309                        in string aLocalPersistentID,
01310                        in boolean isMultiFile,
01311                        in boolean isASCII)
01312       raises (SALOME::SALOME_Exception);
01313 
01314     // Publishing in the study
01320     boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
01333     SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
01334 
01335     // copy/paste methods
01336 
01342     boolean CanCopy(in SObject theObject);
01346     TMPFile CopyFrom(in SObject theObject, out long theObjectID);
01350     boolean CanPaste(in string theComponentName, in long theObjectID);
01354     SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);
01355 
01356   };
01357 };
01358 
01359 #endif