Back to index

salome-kernel  6.5.0
SALOMEDS.idl
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.idl
00024 //  Author : Yves FRICAUD
00025 //
00030 #ifndef _SALOMEDS_IDL_
00031 #define _SALOMEDS_IDL_
00032 
00033 #include "SALOME_Exception.idl"
00034 #include "SALOME_GenericObj.idl"
00035 
00040 module SALOMEDS
00041 {
00044   typedef string URL;
00045 
00048   typedef string ID;
00049 
00052   typedef string PersistentReference;
00053 
00056   typedef string SalomeReference;
00057 
00063   typedef sequence<string> ListOfOpenStudies;
00065   typedef sequence<string> ListOfFileNames;
00067   typedef sequence<string> ListOfDates ;
00069   typedef sequence<string> ListOfStrings ;
00071   typedef sequence<ListOfStrings> ListOfListOfStrings ;
00073   typedef sequence<octet> TMPFile;
00074 
00075   // Reference to other objects is treated with function AddReference
00076   // and ReferencedObject
00077   // All other type of attributes defined in AttributeType enum are
00078   // treated with AddAdttribute and GetAttribute
00079   // The difference is made because Reference attribute don't contain
00080   // strings but reference to ID of other objects
00081 
00082   interface GenericAttribute;
00083   interface Study;
00084   interface StudyManager;
00085   interface StudyBuilder;
00086   interface SObject;
00087   interface SComponent;
00088   interface SComponentIterator;
00089   interface ChildIterator;
00090   interface Driver;
00091   interface AttributeStudyProperties;
00092   interface AttributeParameter;
00093   interface UseCaseIterator;
00094   interface UseCaseBuilder;
00095 
00096   interface Observer
00097   {
00098     oneway void notifyObserverID(in string theID, in long event);
00099   };
00100 
00101 
00103   typedef sequence<GenericAttribute> ListOfAttributes;
00104 
00106   exception NotImplemented {};
00107 
00108 
00109   //===========================================================================
00125   interface Study
00126   {
00127 
00129     exception StudyInvalidContext {};
00131     exception StudyInvalidComponent {};
00133     exception StudyInvalidDirectory {};
00135     exception StudyNameAlreadyUsed {};
00137     exception StudyObjectAlreadyExists {};
00139     exception StudyNameError {};
00141     exception StudyCommentError {};
00142 
00147     attribute string     Name; // equivalent to setName() & getName()
00152     attribute short      StudyId;
00154     typedef sequence<SObject> ListOfSObject;
00156     PersistentReference  GetPersistentReference();
00158     SalomeReference      GetTransientReference();
00159 
00164     boolean IsEmpty();
00173     SComponent FindComponent  (in string aComponentName);
00174 
00177     SComponent FindComponentID(in ID aComponentID);
00185     SObject       FindObject      (in string anObjectName);
00191     SObject       FindObjectID    (in ID aObjectID);
00197     SObject       CreateObjectID    (in ID aObjectID);
00203     SObject       FindObjectIOR   (in ID aObjectIOR);
00209     ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName);
00215     SObject FindObjectByPath(in string thePath);
00218     string  GetObjectPath(in Object theObject);
00219 
00226     void SetContext(in string thePath);
00231     string GetContext();
00236     ListOfStrings GetObjectNames(in string theContext);
00241     ListOfStrings GetDirectoryNames(in string theContext);
00246     ListOfStrings GetFileNames(in string theContext);
00251     ListOfStrings GetComponentNames(in string theContext);
00257     ChildIterator      NewChildIterator(in SObject aSO);
00258 
00263     SComponentIterator NewComponentIterator();
00264 
00271     StudyBuilder NewBuilder() ;
00276     void UpdateIORLabelMap(in string anIOR, in string anEntry);
00277 
00285     AttributeStudyProperties GetProperties();
00288     attribute boolean IsSaved;
00293     boolean IsModified();
00294 
00297     void Modified();
00298 
00301     attribute string  URL;
00302 
00307     ListOfSObject FindDependances(in SObject anObject);
00308 
00313     string GetLastModificationDate();
00319     ListOfDates GetModificationsDate();
00325     string ConvertObjectToIOR(in Object theObject);
00331     Object ConvertIORToObject(in string theIOR);
00332 
00335     UseCaseBuilder  GetUseCaseBuilder();
00336 
00339     void Close();
00340 
00343     void EnableUseCaseAutoFilling(in boolean isEnabled);
00344 
00348     void AddPostponed(in string theIOR);
00349 
00350     void AddCreatedPostponed(in string theIOR);
00351 
00352     void RemovePostponed(in long theUndoLimit);
00353 
00354     void UndoPostponed(in long theWay);
00355 
00356     boolean DumpStudy(in string thePath,
00357                       in string theBaseName,
00358                       in boolean isPublished,
00359                       in boolean isMultiFile);
00360 
00366     AttributeParameter GetCommonParameters(in string theID, in long theSavePoint);
00367 
00374     AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint);
00375 
00376 
00382     string GetDefaultScript(in string theID, in string theModuleName);
00383 
00390     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
00391 
00392 
00398     void SetStudyLock(in string theLockerID);
00399 
00404     boolean IsStudyLocked();
00405 
00411     void UnLockStudy(in string theLockerID);
00412 
00415     ListOfStrings GetLockerID();
00416 
00423     void SetReal( in string theVarName, in double theValue );
00424 
00431     void SetInteger( in string theVarName, in long theValue );
00438     void SetBoolean( in string theVarName, in boolean theValue );
00439 
00446     void SetString( in string theVarName, in string theValue );
00447 
00450     void SetStringAsDouble( in string theVarName, in double theValue );
00451 
00456     double GetReal( in string theVarName );
00457 
00462     long GetInteger( in string theVarName );
00463 
00468     boolean GetBoolean( in string theVarName );
00469 
00474     string GetString( in string theVarName );
00475     
00476 
00482     boolean IsReal( in string theVarName );
00483 
00489     boolean IsInteger( in string theVarName );
00490 
00496     boolean IsBoolean( in string theVarName );
00497 
00503     boolean IsString( in string theVarName );
00504 
00511     boolean IsVariable( in string theVarName );
00512 
00515     ListOfStrings GetVariableNames();
00516 
00524     boolean RemoveVariable( in string theVarName );
00525 
00534     boolean RenameVariable( in string theVarName, in string theNewVarName );
00535 
00543     boolean IsVariableUsed( in string theVarName );
00544 
00550     ListOfListOfStrings ParseVariables( in string theVars );
00551 
00557      void attach(in SALOMEDS::Observer theObserver, in boolean modify);   
00558   };
00559 
00560   //==========================================================================
00571   //==========================================================================
00572 
00573   interface StudyBuilder
00574   {
00579     exception LockProtection {};
00588     SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
00593     void       DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
00594         
00599     void       RemoveComponent(in SComponent aComponent) raises(LockProtection);
00600 
00612     SObject NewObject      (in SObject theFatherObject) raises(LockProtection);
00613 
00622     SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
00629     void    RemoveObject   (in SObject anObject) raises(LockProtection);
00636     void    RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
00637 
00644     void  LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
00650     void  Load (in SObject sco);
00651 
00661     GenericAttribute FindOrCreateAttribute(in  SObject        anObject,
00662                                         in  string         aTypeOfAttribute) raises(LockProtection);
00663 
00673     boolean FindAttribute(in  SObject        anObject,
00674                              out GenericAttribute anAttribute,
00675                              in  string         aTypeOfAttribute);
00684     void RemoveAttribute(in  SObject        anObject,
00685                       in  string         aTypeOfAttribute) raises(LockProtection);
00692     void Addreference(in SObject anObject,
00693                     in SObject theReferencedObject) ;
00694 
00700     void RemoveReference(in SObject anObject) ;
00701 
00709     void AddDirectory(in string theName) raises(LockProtection);
00710 
00720      void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
00727      boolean IsGUID(in SObject anObject, in string theGUID);
00728 
00736     void NewCommand(); // command management
00746     void CommitCommand() raises(LockProtection); // command management
00750     boolean HasOpenCommand();
00757     void AbortCommand(); // command management
00762     attribute long  UndoLimit;
00772     void Undo() raises (LockProtection);
00782     void Redo() raises (LockProtection);
00789     boolean GetAvailableUndos();
00796     boolean GetAvailableRedos();
00803     void SetName(in SObject theSO, in string theValue) raises (LockProtection);
00804 
00811     void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
00812 
00819     void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
00820   };
00821 
00822   //==========================================================================
00831   //==========================================================================
00832 
00833   interface StudyManager
00834   {
00838     void ping();
00839 
00840     void Shutdown();
00841 
00845     long getPID();
00846 
00850     oneway void ShutdownWithExit();
00851 
00861     Study NewStudy(in string study_name);
00862 
00871     Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
00872 
00877     void  Close(in Study aStudy);
00887     boolean  Save(in  Study aStudy, in boolean theMultiFile);
00893     boolean  SaveASCII(in  Study aStudy, in boolean theMultiFile);
00903     boolean  SaveAs(in URL   aUrl, // if the file already exists
00904               in Study aStudy,
00905               in boolean theMultiFile); // overwrite (as option)
00914     boolean  SaveAsASCII(in URL   aUrl, // if the file already exists
00915                     in Study aStudy,
00916                     in boolean theMultiFile); // overwrite (as option)
00917 
00918 
00925     ListOfOpenStudies GetOpenStudies();
00926 
00933     Study GetStudyByName  (in string aStudyName);
00934 
00941     Study GetStudyByID  (in short aStudyID);
00942 
00943     // copy/paste methods
00944 
00948     boolean CanCopy(in SObject theObject);
00953     boolean Copy(in SObject theObject);
00958     boolean CanPaste(in SObject theObject);
00965     SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
00966 
00972     string ConvertObjectToIOR(in Object theObject);
00978     Object ConvertIORToObject(in string theIOR); 
00979 
00986     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal); 
00987 
00988 
00989   };
00990 
00991 
00992   //==========================================================================
01004   //==========================================================================
01005 
01006   interface SObject : SALOME::GenericObj
01007   {
01010     attribute string Name; // equivalent to setName() & getName()
01011 
01014     boolean IsNull();
01015 
01020     ID GetID();
01025     SComponent GetFatherComponent();
01030     SObject    GetFather();
01035     short      Tag();
01040     short      Depth();
01047     boolean FindSubObject (in long atag, out SObject obj);
01055     boolean FindAttribute(out GenericAttribute anAttribute,
01056                               in  string         aTypeOfAttribute);
01062     boolean ReferencedObject(out SObject obj); // A REVOIR
01070     ListOfAttributes     GetAllAttributes();
01075     Study GetStudy();
01076 
01082     Object GetObject();
01083 
01088     string GetName();
01089 
01094     string GetComment();
01095 
01100     string GetIOR();
01101 
01107     void SetAttrString(in string name, in string value);
01108 
01115     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
01116   };
01117 
01118 
01119   //==========================================================================
01124   //==========================================================================
01125   interface GenericAttribute : SALOME::GenericObj
01126   {
01131     exception LockProtection {};
01138     void CheckLocked() raises (LockProtection);
01139 
01141     string Type();
01142 
01144     string GetClassType();  
01145        
01147     SObject GetSObject();
01148 
01150 
01155     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
01156   };
01157 
01158 
01159 
01160   //==========================================================================
01167   //==========================================================================
01168   interface SComponent : SObject
01169   {
01174     string  ComponentDataType();
01179     boolean ComponentIOR (out ID theID); //returns True if there is an instance
01180                                          //In this case ID identifies this one
01181   };
01182 
01183 
01184   //==========================================================================
01190   //==========================================================================
01191   interface SComponentIterator : SALOME::GenericObj
01192   {
01196     void Init();
01201     boolean More();
01205     void Next();
01212     SComponent Value();
01213   };
01214 
01215   //==========================================================================
01221   //==========================================================================
01222   interface ChildIterator : SALOME::GenericObj
01223   {
01228     void Init();
01235     void InitEx(in boolean allLevels);
01240     boolean More();
01244     void Next();
01248     SObject Value();
01249   };
01250 
01251   //==========================================================================
01252   //==========================================================================
01257   interface UseCaseIterator : SALOME::GenericObj
01258   {
01263     void Init(in boolean allLevels);
01268     boolean More();
01272     void Next();
01276     SObject Value();
01277   };
01278 
01279   //==========================================================================
01280   //==========================================================================
01286   interface UseCaseBuilder : SALOME::GenericObj
01287   {
01294     boolean Append(in SObject theObject);
01301     boolean Remove(in SObject theObject);
01305     boolean AppendTo(in SObject theFather, in SObject theObject);
01309     boolean InsertBefore(in SObject theFirst, in SObject theNext);
01313     boolean SetCurrentObject(in SObject theObject);
01317     boolean SetRootCurrent();
01321     boolean HasChildren(in SObject theObject);
01325     SObject GetFather(in SObject theObject);
01329     boolean SetName(in string theName);
01333     string GetName();
01337     boolean IsUseCase(in SObject theObject);
01341     boolean IsUseCaseNode(in SObject theObject);
01345     SObject GetCurrentObject();
01349     SObject AddUseCase(in string theName);
01353     UseCaseIterator GetUseCaseIterator(in SObject theObject);
01354   };
01355   //==========================================================================
01368   //==========================================================================
01369   interface Driver
01370   {
01371 
01385     TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
01386 
01398     TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
01399 
01409     boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
01410 
01420     boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
01421 
01428     void Close (in SComponent aSComponent);
01429     //void Close ( in string  aIORSComponent);
01430 
01436      string ComponentDataType();
01437 
01438     // Driver Transient -> persistent called for each object in study
01453     string IORToLocalPersistentID (in SObject theSObject,
01454                                in string IORString,
01455                                in boolean isMultiFile,
01456                                in boolean isASCII);
01472     string LocalPersistentIDToIOR (in SObject theSObject,
01473                                in string aLocalPersistentID,
01474                                in boolean isMultiFile,
01475                                in boolean isASCII)
01476       raises (SALOME::SALOME_Exception);
01477 
01478     // Publishing in the study
01484     boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
01497     SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
01498 
01499     // copy/paste methods
01500 
01506     boolean CanCopy(in SObject theObject);
01510     TMPFile CopyFrom(in SObject theObject, out long theObjectID);
01514     boolean CanPaste(in string theComponentName, in long theObjectID);
01518     SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);
01519 
01520   };
01521 };
01522 
01523 #endif