Version: 6.3.1

idl/SALOMEDS.idl

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  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);
00334     UseCaseBuilder  GetUseCaseBuilder();
00335 
00338     void Close();
00339 
00342     void EnableUseCaseAutoFilling(in boolean isEnabled);
00343 
00347     void AddPostponed(in string theIOR);
00348 
00349     void AddCreatedPostponed(in string theIOR);
00350 
00351     void RemovePostponed(in long theUndoLimit);
00352 
00353     void UndoPostponed(in long theWay);
00354 
00355     boolean DumpStudy(in string thePath,
00356                       in string theBaseName,
00357                       in boolean isPublished,
00358                       in boolean isMultiFile);
00359 
00365     AttributeParameter GetCommonParameters(in string theID, in long theSavePoint);
00366 
00373     AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint);
00374 
00375 
00381     string GetDefaultScript(in string theID, in string theModuleName);
00382 
00389     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
00390 
00391 
00397     void SetStudyLock(in string theLockerID);
00398 
00403     boolean IsStudyLocked();
00404 
00410     void UnLockStudy(in string theLockerID);
00411 
00414     ListOfStrings GetLockerID();
00415 
00422     void SetReal( in string theVarName, in double theValue );
00423 
00430     void SetInteger( in string theVarName, in long theValue );
00437     void SetBoolean( in string theVarName, in boolean theValue );
00438 
00445     void SetString( in string theVarName, in string theValue );
00446 
00449     void SetStringAsDouble( in string theVarName, in double theValue );
00450 
00455     double GetReal( in string theVarName );
00456 
00461     long GetInteger( in string theVarName );
00462 
00467     boolean GetBoolean( in string theVarName );
00468 
00473     string GetString( in string theVarName );
00474     
00475 
00481     boolean IsReal( in string theVarName );
00482 
00488     boolean IsInteger( in string theVarName );
00489 
00495     boolean IsBoolean( in string theVarName );
00496 
00502     boolean IsString( in string theVarName );
00503 
00510     boolean IsVariable( in string theVarName );
00511 
00514     ListOfStrings GetVariableNames();
00515 
00523     boolean RemoveVariable( in string theVarName );
00524 
00533     boolean RenameVariable( in string theVarName, in string theNewVarName );
00534 
00542     boolean IsVariableUsed( in string theVarName );
00543 
00549     ListOfListOfStrings ParseVariables( in string theVars );
00550 
00556      void attach(in SALOMEDS::Observer theObserver, in boolean modify);   
00557   };
00558 
00559   //==========================================================================
00570   //==========================================================================
00571 
00572   interface StudyBuilder
00573   {
00578     exception LockProtection {};
00587     SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
00592     void       DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
00593         
00598     void       RemoveComponent(in SComponent aComponent) raises(LockProtection);
00599 
00611     SObject NewObject      (in SObject theFatherObject) raises(LockProtection);
00612 
00621     SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
00628     void    RemoveObject   (in SObject anObject) raises(LockProtection);
00635     void    RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
00636 
00643     void  LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
00649     void  Load (in SObject sco);
00650 
00660     GenericAttribute FindOrCreateAttribute(in  SObject        anObject,
00661                                       in  string         aTypeOfAttribute) raises(LockProtection);
00662 
00672     boolean FindAttribute(in  SObject        anObject,
00673                      out GenericAttribute anAttribute,
00674                      in  string         aTypeOfAttribute);
00683     void RemoveAttribute(in  SObject        anObject,
00684                 in  string         aTypeOfAttribute) raises(LockProtection);
00691     void Addreference(in SObject anObject,
00692                 in SObject theReferencedObject) ;
00693 
00699     void RemoveReference(in SObject anObject) ;
00700 
00708     void AddDirectory(in string theName) raises(LockProtection);
00709 
00719      void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
00726      boolean IsGUID(in SObject anObject, in string theGUID);
00727 
00735     void NewCommand(); // command management
00745     void CommitCommand() raises(LockProtection); // command management
00749     boolean HasOpenCommand();
00756     void AbortCommand(); // command management
00761     attribute long  UndoLimit;
00771     void Undo() raises (LockProtection);
00781     void Redo() raises (LockProtection);
00788     boolean GetAvailableUndos();
00795     boolean GetAvailableRedos();
00802     void SetName(in SObject theSO, in string theValue) raises (LockProtection);
00803 
00810     void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
00811 
00818     void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
00819   };
00820 
00821   //==========================================================================
00830   //==========================================================================
00831 
00832   interface StudyManager
00833   {
00837     void ping();
00838 
00839     void Shutdown();
00840 
00844     long getPID();
00845 
00849     oneway void ShutdownWithExit();
00850 
00860     Study NewStudy(in string study_name);
00861 
00870     Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
00871 
00876     void  Close(in Study aStudy);
00886     boolean  Save(in  Study aStudy, in boolean theMultiFile);
00892     boolean  SaveASCII(in  Study aStudy, in boolean theMultiFile);
00902     boolean  SaveAs(in URL   aUrl, // if the file already exists
00903           in Study aStudy,
00904           in boolean theMultiFile); // overwrite (as option)
00913     boolean  SaveAsASCII(in URL   aUrl, // if the file already exists
00914                 in Study aStudy,
00915                 in boolean theMultiFile); // overwrite (as option)
00916 
00917 
00924     ListOfOpenStudies GetOpenStudies();
00925 
00932     Study GetStudyByName  (in string aStudyName);
00933 
00940     Study GetStudyByID  (in short aStudyID);
00941 
00942     // copy/paste methods
00943 
00947     boolean CanCopy(in SObject theObject);
00952     boolean Copy(in SObject theObject);
00957     boolean CanPaste(in SObject theObject);
00964     SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
00965 
00971     string ConvertObjectToIOR(in Object theObject);
00977     Object ConvertIORToObject(in string theIOR); 
00978 
00985     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal); 
00986 
00987 
00988   };
00989 
00990 
00991   //==========================================================================
01003   //==========================================================================
01004 
01005   interface SObject : SALOME::GenericObj
01006   {
01009     attribute string Name; // equivalent to setName() & getName()
01010 
01013     boolean IsNull();
01014 
01019     ID GetID();
01024     SComponent GetFatherComponent();
01029     SObject    GetFather();
01034     short      Tag();
01039     short      Depth();
01046     boolean FindSubObject (in long atag, out SObject obj);
01054     boolean FindAttribute(out GenericAttribute anAttribute,
01055                       in  string         aTypeOfAttribute);
01061     boolean ReferencedObject(out SObject obj); // A REVOIR
01069     ListOfAttributes     GetAllAttributes();
01074     Study GetStudy();
01075 
01081     Object GetObject();
01082 
01087     string GetName();
01088 
01093     string GetComment();
01094 
01099     string GetIOR();
01100 
01106     void SetAttrString(in string name, in string value);
01107 
01114     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
01115   };
01116 
01117 
01118   //==========================================================================
01123   //==========================================================================
01124   interface GenericAttribute : SALOME::GenericObj
01125   {
01130     exception LockProtection {};
01137     void CheckLocked() raises (LockProtection);
01138 
01140     string Type();
01141 
01143     string GetClassType();    
01144      
01146     SObject GetSObject();
01147 
01149 
01154     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
01155   };
01156 
01157 
01158 
01159   //==========================================================================
01166   //==========================================================================
01167   interface SComponent : SObject
01168   {
01173     string  ComponentDataType();
01178     boolean ComponentIOR (out ID theID); //returns True if there is an instance
01179                                          //In this case ID identifies this one
01180   };
01181 
01182 
01183   //==========================================================================
01189   //==========================================================================
01190   interface SComponentIterator : SALOME::GenericObj
01191   {
01195     void Init();
01200     boolean More();
01204     void Next();
01211     SComponent Value();
01212   };
01213 
01214   //==========================================================================
01220   //==========================================================================
01221   interface ChildIterator : SALOME::GenericObj
01222   {
01227     void Init();
01234     void InitEx(in boolean allLevels);
01239     boolean More();
01243     void Next();
01247     SObject Value();
01248   };
01249 
01250   //==========================================================================
01251   //==========================================================================
01256   interface UseCaseIterator : SALOME::GenericObj
01257   {
01262     void Init(in boolean allLevels);
01267     boolean More();
01271     void Next();
01275     SObject Value();
01276   };
01277 
01278   //==========================================================================
01279   //==========================================================================
01285   interface UseCaseBuilder : SALOME::GenericObj
01286   {
01293     boolean Append(in SObject theObject);
01300     boolean Remove(in SObject theObject);
01304     boolean AppendTo(in SObject theFather, in SObject theObject);
01308     boolean InsertBefore(in SObject theFirst, in SObject theNext);
01312     boolean SetCurrentObject(in SObject theObject);
01316     boolean SetRootCurrent();
01320     boolean HasChildren(in SObject theObject);
01324     boolean SetName(in string theName);
01328     string GetName();
01332     boolean IsUseCase(in SObject theObject);
01336     SObject GetCurrentObject();
01340     SObject AddUseCase(in string theName);
01344     UseCaseIterator GetUseCaseIterator(in SObject theObject);
01345   };
01346   //==========================================================================
01359   //==========================================================================
01360   interface Driver
01361   {
01362 
01376     TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
01377 
01389     TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
01390 
01400     boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
01401 
01411     boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
01412 
01419     void Close (in SComponent aSComponent);
01420     //void Close ( in string  aIORSComponent);
01421 
01427      string ComponentDataType();
01428 
01429     // Driver Transient -> persistent called for each object in study
01444     string IORToLocalPersistentID (in SObject theSObject,
01445                        in string IORString,
01446                        in boolean isMultiFile,
01447                        in boolean isASCII);
01463     string LocalPersistentIDToIOR (in SObject theSObject,
01464                        in string aLocalPersistentID,
01465                        in boolean isMultiFile,
01466                        in boolean isASCII)
01467       raises (SALOME::SALOME_Exception);
01468 
01469     // Publishing in the study
01475     boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
01488     SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
01489 
01490     // copy/paste methods
01491 
01497     boolean CanCopy(in SObject theObject);
01501     TMPFile CopyFrom(in SObject theObject, out long theObjectID);
01505     boolean CanPaste(in string theComponentName, in long theObjectID);
01509     SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);
01510 
01511   };
01512 };
01513 
01514 #endif
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS