Version: 8.3.0
SALOMEDS.idl
Go to the documentation of this file.
1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 
23 // File : SALOMEDS.idl
24 // Author : Yves FRICAUD
25 //
30 #ifndef _SALOMEDS_IDL_
31 #define _SALOMEDS_IDL_
32 
33 #include "SALOME_Exception.idl"
34 #include "SALOME_GenericObj.idl"
35 
40 module SALOMEDS
41 {
44  typedef string URL;
45 
48  typedef string ID;
49 
52  typedef string PersistentReference;
53 
56  typedef string SalomeReference;
57 
63  typedef sequence<string> ListOfOpenStudies;
65  typedef sequence<string> ListOfFileNames;
67  typedef sequence<string> ListOfDates ;
69  typedef sequence<string> ListOfStrings ;
71  typedef sequence<ListOfStrings> ListOfListOfStrings ;
73  typedef sequence<octet> TMPFile;
74 
75  // Reference to other objects is treated with function AddReference
76  // and ReferencedObject
77  // All other type of attributes defined in AttributeType enum are
78  // treated with AddAdttribute and GetAttribute
79  // The difference is made because Reference attribute don't contain
80  // strings but reference to ID of other objects
81 
82  interface GenericAttribute;
83  interface Study;
84  interface StudyManager;
85  interface StudyBuilder;
86  interface SObject;
87  interface SComponent;
88  interface SComponentIterator;
89  interface ChildIterator;
90  interface Driver;
91  interface AttributeStudyProperties;
92  interface AttributeParameter;
93  interface UseCaseIterator;
94  interface UseCaseBuilder;
95 
96  interface Observer
97  {
98  oneway void notifyObserverID(in string theID, in long event);
99  };
100 
101 
103  typedef sequence<GenericAttribute> ListOfAttributes;
104 
106  exception NotImplemented {};
107 
108 
109  //===========================================================================
125  interface Study
126  {
127 
129  exception StudyInvalidReference {};
131  exception StudyInvalidContext {};
133  exception StudyInvalidComponent {};
135  exception StudyInvalidDirectory {};
137  exception StudyNameAlreadyUsed {};
141  exception StudyNameError {};
143  exception StudyCommentError {};
144 
149  attribute string Name; // equivalent to setName() & getName()
154  attribute short StudyId;
156  typedef sequence<SObject> ListOfSObject;
158  PersistentReference GetPersistentReference() raises(StudyInvalidReference);
160  SalomeReference GetTransientReference() raises(StudyInvalidReference);
161 
166  boolean IsEmpty() raises(StudyInvalidReference);
175  SComponent FindComponent (in string aComponentName) raises(StudyInvalidReference);
176 
179  SComponent FindComponentID(in ID aComponentID) raises(StudyInvalidReference);
187  SObject FindObject (in string anObjectName) raises(StudyInvalidReference);
193  SObject FindObjectID (in ID aObjectID) raises(StudyInvalidReference);
199  SObject CreateObjectID (in ID aObjectID) raises(StudyInvalidReference);
205  SObject FindObjectIOR (in ID aObjectIOR) raises(StudyInvalidReference);
211  ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName) raises(StudyInvalidReference);
217  SObject FindObjectByPath(in string thePath) raises(StudyInvalidReference);
220  string GetObjectPath(in Object theObject) raises(StudyInvalidReference);
221 
228  void SetContext(in string thePath) raises (StudyInvalidReference, StudyInvalidContext);
233  string GetContext() raises (StudyInvalidReference, StudyInvalidContext);
238  ListOfStrings GetObjectNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
243  ListOfStrings GetDirectoryNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
248  ListOfStrings GetFileNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
253  ListOfStrings GetComponentNames(in string theContext) raises(StudyInvalidReference);
259  ChildIterator NewChildIterator(in SObject aSO) raises(StudyInvalidReference);
260 
265  SComponentIterator NewComponentIterator() raises(StudyInvalidReference);
266 
273  StudyBuilder NewBuilder() raises(StudyInvalidReference);
278  void UpdateIORLabelMap(in string anIOR, in string anEntry) raises(StudyInvalidReference);
279 
287  AttributeStudyProperties GetProperties() raises(StudyInvalidReference);
290  attribute boolean IsSaved;
295  boolean IsModified() raises(StudyInvalidReference);
296 
299  void Modified() raises(StudyInvalidReference);
300 
303  attribute string URL;
304 
309  ListOfSObject FindDependances(in SObject anObject) raises(StudyInvalidReference);
310 
315  string GetLastModificationDate() raises(StudyInvalidReference);
321  ListOfDates GetModificationsDate() raises(StudyInvalidReference);
327  string ConvertObjectToIOR(in Object theObject);
333  Object ConvertIORToObject(in string theIOR);
334 
337  UseCaseBuilder GetUseCaseBuilder() raises(StudyInvalidReference);
338 
341  void Close() raises(StudyInvalidReference);
342 
345  void EnableUseCaseAutoFilling(in boolean isEnabled) raises(StudyInvalidReference);
346 
350  void AddPostponed(in string theIOR) raises(StudyInvalidReference);
351 
352  void AddCreatedPostponed(in string theIOR) raises(StudyInvalidReference);
353 
354  void RemovePostponed(in long theUndoLimit) raises(StudyInvalidReference);
355 
356  void UndoPostponed(in long theWay) raises(StudyInvalidReference);
357 
358  boolean DumpStudy(in string thePath,
359  in string theBaseName,
360  in boolean isPublished,
361  in boolean isMultiFile) raises(StudyInvalidReference);
362 
368  AttributeParameter GetCommonParameters(in string theID, in long theSavePoint) raises(StudyInvalidReference);
369 
376  AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint) raises(StudyInvalidReference);
377 
378 
384  string GetDefaultScript(in string theModuleName, in string indent) raises(StudyInvalidReference);
385 
392  long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
393 
394 
400  void SetStudyLock(in string theLockerID) raises(StudyInvalidReference);
401 
406  boolean IsStudyLocked() raises(StudyInvalidReference);
407 
413  void UnLockStudy(in string theLockerID) raises(StudyInvalidReference);
414 
417  ListOfStrings GetLockerID() raises(StudyInvalidReference);
418 
425  void SetReal( in string theVarName, in double theValue ) raises(StudyInvalidReference);
426 
433  void SetInteger( in string theVarName, in long theValue ) raises(StudyInvalidReference);
440  void SetBoolean( in string theVarName, in boolean theValue ) raises(StudyInvalidReference);
441 
448  void SetString( in string theVarName, in string theValue ) raises(StudyInvalidReference);
449 
452  void SetStringAsDouble( in string theVarName, in double theValue ) raises(StudyInvalidReference);
453 
458  double GetReal( in string theVarName ) raises(StudyInvalidReference);
459 
464  long GetInteger( in string theVarName ) raises(StudyInvalidReference);
465 
470  boolean GetBoolean( in string theVarName ) raises(StudyInvalidReference);
471 
476  string GetString( in string theVarName ) raises(StudyInvalidReference);
477 
478 
484  boolean IsReal( in string theVarName ) raises(StudyInvalidReference);
485 
491  boolean IsInteger( in string theVarName ) raises(StudyInvalidReference);
492 
498  boolean IsBoolean( in string theVarName ) raises(StudyInvalidReference);
499 
505  boolean IsString( in string theVarName ) raises(StudyInvalidReference);
506 
513  boolean IsVariable( in string theVarName ) raises(StudyInvalidReference);
514 
517  ListOfStrings GetVariableNames() raises(StudyInvalidReference);
518 
526  boolean RemoveVariable( in string theVarName ) raises(StudyInvalidReference);
527 
536  boolean RenameVariable( in string theVarName, in string theNewVarName ) raises(StudyInvalidReference);
537 
545  boolean IsVariableUsed( in string theVarName ) raises(StudyInvalidReference);
546 
552  ListOfListOfStrings ParseVariables( in string theVars ) raises(StudyInvalidReference);
553 
561  void attach(in SALOMEDS::Observer theObserver, in boolean modify);
567  void detach(in SALOMEDS::Observer theObserver);
568  };
569 
570  //==========================================================================
581  //==========================================================================
582 
583  interface StudyBuilder
584  {
589  exception LockProtection {};
598  SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
603  void DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
604 
609  void RemoveComponent(in SComponent aComponent) raises(LockProtection);
610 
622  SObject NewObject (in SObject theFatherObject) raises(LockProtection);
623 
632  SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
639  void RemoveObject (in SObject anObject) raises(LockProtection);
646  void RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
647 
654  void LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
660  void Load (in SObject sco);
661 
671  GenericAttribute FindOrCreateAttribute(in SObject anObject,
672  in string aTypeOfAttribute) raises(LockProtection);
673 
683  boolean FindAttribute(in SObject anObject,
684  out GenericAttribute anAttribute,
685  in string aTypeOfAttribute);
694  void RemoveAttribute(in SObject anObject,
695  in string aTypeOfAttribute) raises(LockProtection);
702  void Addreference(in SObject anObject,
703  in SObject theReferencedObject) ;
704 
710  void RemoveReference(in SObject anObject) ;
711 
719  void AddDirectory(in string theName) raises(LockProtection);
720 
730  void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
737  boolean IsGUID(in SObject anObject, in string theGUID);
738 
746  void NewCommand(); // command management
756  void CommitCommand() raises(LockProtection); // command management
760  boolean HasOpenCommand();
767  void AbortCommand(); // command management
772  attribute long UndoLimit;
782  void Undo() raises (LockProtection);
792  void Redo() raises (LockProtection);
799  boolean GetAvailableUndos();
806  boolean GetAvailableRedos();
813  void SetName(in SObject theSO, in string theValue) raises (LockProtection);
814 
821  void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
822 
829  void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
830  };
831 
832  //==========================================================================
841  //==========================================================================
842 
843  interface StudyManager
844  {
848  void ping();
849 
850  void Shutdown();
851 
855  long getPID();
856 
860  oneway void ShutdownWithExit();
861 
871  Study NewStudy(in string study_name) raises (SALOME::SALOME_Exception);
872 
881  Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
882 
887  void Close(in Study aStudy);
897  boolean Save(in Study aStudy, in boolean theMultiFile);
903  boolean SaveASCII(in Study aStudy, in boolean theMultiFile);
913  boolean SaveAs(in URL aUrl, // if the file already exists
914  in Study aStudy,
915  in boolean theMultiFile); // overwrite (as option)
924  boolean SaveAsASCII(in URL aUrl, // if the file already exists
925  in Study aStudy,
926  in boolean theMultiFile); // overwrite (as option)
927 
928 
935  ListOfOpenStudies GetOpenStudies();
936 
943  Study GetStudyByName (in string aStudyName);
944 
951  Study GetStudyByID (in short aStudyID);
952 
953  // copy/paste methods
954 
958  boolean CanCopy(in SObject theObject);
963  boolean Copy(in SObject theObject);
968  boolean CanPaste(in SObject theObject);
975  SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
976 
982  string ConvertObjectToIOR(in Object theObject);
988  Object ConvertIORToObject(in string theIOR);
989 
996  long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
997 
998  };
999 
1000 
1001  //==========================================================================
1013  //==========================================================================
1014 
1016  {
1019  attribute string Name; // equivalent to setName() & getName()
1020 
1023  boolean IsNull();
1024 
1028  ID GetID();
1029 
1033  SComponent GetFatherComponent();
1034 
1038  SObject GetFather();
1039 
1043  short Tag();
1044 
1048  short GetLastChildTag();
1049 
1053  short Depth();
1054 
1059  boolean FindSubObject (in long atag, out SObject obj);
1060 
1067  boolean FindAttribute(out GenericAttribute anAttribute,
1068  in string aTypeOfAttribute);
1069 
1074  boolean ReferencedObject(out SObject obj); // A REVOIR
1075 
1082  ListOfAttributes GetAllAttributes();
1083 
1087  Study GetStudy();
1088 
1093  Object GetObject();
1094 
1099  string GetName();
1100 
1105  string GetComment();
1106 
1111  string GetIOR();
1112 
1118  void SetAttrString(in string name, in string value);
1119 
1126  long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1127  };
1128 
1129 
1130  //==========================================================================
1135  //==========================================================================
1137  {
1142  exception LockProtection {};
1149  void CheckLocked() raises (LockProtection);
1150 
1152  string Type();
1153 
1155  string GetClassType();
1156 
1158  SObject GetSObject();
1159 
1161 
1166  long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1167  };
1168 
1169 
1170 
1171  //==========================================================================
1178  //==========================================================================
1179  interface SComponent : SObject
1180  {
1185  string ComponentDataType();
1190  boolean ComponentIOR (out ID theID); //returns True if there is an instance
1191  //In this case ID identifies this one
1192  };
1193 
1194 
1195  //==========================================================================
1201  //==========================================================================
1203  {
1207  void Init();
1212  boolean More();
1216  void Next();
1223  SComponent Value();
1224  };
1225 
1226  //==========================================================================
1232  //==========================================================================
1234  {
1239  void Init();
1246  void InitEx(in boolean allLevels);
1251  boolean More();
1255  void Next();
1259  SObject Value();
1260  };
1261 
1262  //==========================================================================
1263  //==========================================================================
1269  {
1274  void Init(in boolean allLevels);
1279  boolean More();
1283  void Next();
1287  SObject Value();
1288  };
1289 
1290  //==========================================================================
1291  //==========================================================================
1298  {
1305  boolean Append(in SObject theObject);
1312  boolean Remove(in SObject theObject);
1316  boolean AppendTo(in SObject theFather, in SObject theObject);
1320  boolean InsertBefore(in SObject theFirst, in SObject theNext);
1324  boolean SetCurrentObject(in SObject theObject);
1328  boolean SetRootCurrent();
1332  boolean HasChildren(in SObject theObject);
1336  boolean SortChildren(in SObject theObject, in boolean theAscendingOrder);
1340  SObject GetFather(in SObject theObject);
1344  boolean SetName(in string theName);
1348  string GetName();
1352  boolean IsUseCase(in SObject theObject);
1356  boolean IsUseCaseNode(in SObject theObject);
1360  SObject GetCurrentObject();
1364  SObject AddUseCase(in string theName);
1368  UseCaseIterator GetUseCaseIterator(in SObject theObject);
1369  };
1370  //==========================================================================
1383  //==========================================================================
1384  interface Driver
1385  {
1386 
1400  TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1401 
1413  TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1414 
1424  boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1425 
1435  boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1436 
1443  void Close (in SComponent aSComponent);
1444  //void Close ( in string aIORSComponent);
1445 
1451  string ComponentDataType();
1452 
1453  // Driver Transient -> persistent called for each object in study
1468  string IORToLocalPersistentID (in SObject theSObject,
1469  in string IORString,
1470  in boolean isMultiFile,
1471  in boolean isASCII);
1487  string LocalPersistentIDToIOR (in SObject theSObject,
1488  in string aLocalPersistentID,
1489  in boolean isMultiFile,
1490  in boolean isASCII)
1491  raises (SALOME::SALOME_Exception);
1492 
1493  // Publishing in the study
1499  boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1512  SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
1513 
1514  // copy/paste methods
1515 
1521  boolean CanCopy(in SObject theObject);
1525  TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1529  boolean CanPaste(in string theComponentName, in long theObjectID);
1533  SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);
1534 
1535  };
1536 };
1537 
1538 #endif