]> SALOME platform Git repositories - modules/kernel.git/blob - idl/SALOMEDS.idl
Salome HOME
Add exportInputFiles to SALOME_Launcher
[modules/kernel.git] / idl / SALOMEDS.idl
1 // Copyright (C) 2007-2019  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 //
26 /*!  \file SALOMEDS.idl  \brief This file contains a set of interfaces used for creation, management
27   and modification of the %Study
28 */
29
30 #ifndef _SALOMEDS_IDL_
31 #define _SALOMEDS_IDL_
32
33 #include "SALOME_Exception.idl"
34 #include "SALOME_GenericObj.idl"
35
36 /*! \brief
37      This package contains the interfaces used for creation, management
38      and modification of the %Study
39 */
40 module SALOMEDS
41 {
42 /*! \brief Name of the file in which the %Study is saved.
43 */
44   typedef wstring URLPath;
45
46 /*! \brief Main identifier of an object in %SALOME application
47 */
48   typedef string ID;
49
50 /*! \brief While saving the data, IOR is transformed into persistent reference
51 */
52   typedef string PersistentReference;
53
54 /*! \brief IOR of the study in %SALOME application
55 */
56   typedef string SalomeReference;
57
58 //! List of file names
59   typedef sequence<string> ListOfFileNames;
60 //! List of modification dates of a study
61   typedef sequence<string> ListOfDates ;
62 //! An unbounded sequence of strings
63   typedef sequence<string> ListOfStrings ;
64 //! An unbounded sequence of sequence of strings
65   typedef sequence<ListOfStrings> ListOfListOfStrings ;
66 //! A byte stream which is used for binary data transfer between different components
67   typedef sequence<octet> TMPFile;
68
69   // Reference to other objects is treated with function AddReference
70   // and ReferencedObject
71   // All other type of attributes defined in AttributeType enum are
72   // treated with AddAdttribute and GetAttribute
73   // The difference is made because Reference attribute don't contain
74   // strings but reference to ID of other objects
75
76   interface GenericAttribute;
77   interface Study;
78   interface StudyBuilder;
79   interface SObject;
80   interface SComponent;
81   interface SComponentIterator;
82   interface ChildIterator;
83   interface Driver;
84   interface AttributeStudyProperties;
85   interface AttributeParameter;
86   interface UseCaseIterator;
87   interface UseCaseBuilder;
88
89   interface Observer
90   {
91     oneway void notifyObserverID(in string theID, in long event);
92   };
93
94
95 //! List of attributes of %SObjects
96   typedef sequence<GenericAttribute> ListOfAttributes;
97
98 //! Exception indicating that this feature hasn't been implemented in %SALOME application.
99   exception NotImplemented {};
100
101   //==========================================================================
102 /*! \brief %Study Builder Interface
103
104   The purpose of the Builder is to add and/or remove objects and attributes.
105   A %StudyBuilder is linked to a %Study. A
106   command management is provided for the undo/redo functionalities.
107   \note
108   <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
109   item's position in the tree-type structure of the browser. In general it has the following
110   form: <TT>0:2:1:1</TT>
111 */
112   //==========================================================================
113
114   interface StudyBuilder
115   {
116 /*! \brief %LockProtection Exception
117
118     This exception is raised while attempting to modify a locked %study.
119 */
120     exception LockProtection {};
121 /*! \brief Creation of a new %SComponent.
122
123    Creates a new %SComponent
124    \param ComponentDataType    Data type of the %SComponent which will be created.
125
126 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
127
128 */
129     SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
130
131 /*! \brief Definition of the instance to the %SComponent
132
133     Defines the instance to the %SComponent.
134 */
135     void       DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
136
137 /*! \brief Deletion of a %SComponent
138
139   Removes a %SComponent.
140 */
141     void       RemoveComponent(in SComponent aComponent) raises(LockProtection);
142
143 /*! \brief Creation of a new %SObject
144
145    Creates a new %SObject under a definite father %SObject.
146
147    \param theFatherObject The father %SObject under which this one should be created.
148    \return New %SObject
149
150 <em>See \ref example18 for an example of this method usage in batchmode of %SALOME application.</em>
151
152 */
153
154     SObject NewObject      (in SObject theFatherObject) raises(LockProtection);
155
156 /*! \brief Creation of a new %SObject with a definite %tag
157
158    Creates a new %SObject with a definite %tag.
159
160    \param atag Long value corresponding to the tag of the new %SObject.
161    \return New %SObject
162
163 */
164     SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
165 /*! \brief Deletion of the %SObject
166
167   Removes a %SObject from the %StudyBuilder.
168
169   \param anObject The %SObject to be deleted.
170 */
171     void    RemoveObject   (in SObject anObject) raises(LockProtection);
172 /*! \brief Deletion of the %SObject with all his child objects.
173
174   Removes the %SObject with all his child objects.
175
176   \param anObject The %SObject to be deleted with all child objects.
177 */
178     void    RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
179
180 /*!
181    Loads a %SComponent.
182
183 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
184
185 */
186     void  LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
187 /*!
188    Loads a %SObject.
189
190    \param sco %SObject to be loaded.
191 */
192     void  Load (in SObject sco);
193
194 /*! \brief Looking for or creating an attribute assigned to the %SObject
195
196     Allows to find or create an attribute of a specific type which is assigned to the object.
197     \param anObject        The %SObject corresponding to the attribute which is looked for.
198     \param aTypeOfAttribute     Type of the attribute.
199
200 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
201 */
202
203     GenericAttribute FindOrCreateAttribute(in  SObject        anObject,
204                                          in  string         aTypeOfAttribute) raises(LockProtection);
205
206 /*! \brief Looking for an attribute assigned to a %SObject
207
208     Allows to find an attribute of a specific type which is assigned to the object.
209     \param anObject        The %SObject corresponding to the attribute which is looked for.
210     \param aTypeOfAttribute     Type of the attribute.
211     \param anAttribute       Where the attribute is placed if it's found.
212     \return True if it finds an attribute.
213  */
214
215     boolean FindAttribute(in  SObject        anObject,
216                                  out GenericAttribute anAttribute,
217                                  in  string         aTypeOfAttribute);
218 /*! \brief Deleting the attribute assigned to the %SObject
219
220     Removes the attribute of a specific type which is assigned to the object.
221     \param anObject        The %SObject corresponding to the attribute.
222     \param aTypeOfAttribute     Type of the attribute.
223
224 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
225 */
226     void RemoveAttribute(in  SObject        anObject,
227                          in  string         aTypeOfAttribute) raises(LockProtection);
228 /*!
229     Adds a reference between %anObject and %theReferencedObject.
230     \param anObject The %SObject which will get a reference
231     \param theReferencedObject The %SObject having a reference
232 */
233
234     void Addreference(in SObject anObject,
235                       in SObject theReferencedObject) ;
236
237 /*!
238     Removes a reference from %anObject to another object.
239     \param anObject The %SObject which contains a reference
240 */
241
242     void RemoveReference(in SObject anObject) ;
243
244 /*! \brief Identification of the %SObject's substructure.
245
246       Identification of the %SObject's substructure by GUID.
247
248
249       \param anObject The %SObject which will be identified
250       \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
251 */
252     void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
253 /*!
254 Searches for a definite %SObject with a definite GUID and returns True if it finds it.
255
256 \param anObject A definite %SObject which will be identified
257 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
258 */
259      boolean IsGUID(in SObject anObject, in string theGUID);
260
261 /*! \brief Creation of a new command
262
263    Creates a new command which can contain several different actions.
264
265 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
266
267 */
268     void NewCommand(); // command management
269 /*! \brief Execution of the command
270
271    Commits all actions declared within this command.
272
273    \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
274
275 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
276
277 */
278     void CommitCommand() raises(LockProtection); // command management
279 /*!
280     Returns True if at this moment there is a command under execution.
281 */
282     boolean HasOpenCommand();
283 /*! \brief Cancellation of the command
284
285     Cancels all actions declared within the command.
286
287 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
288 */
289     void AbortCommand(); // command management
290 /*! \brief Undolimit
291
292     The number of actions which can be undone
293 */
294     attribute long  UndoLimit;
295 /*! \brief Undo method
296
297     Cancels all actions of the last command.
298
299     \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
300
301 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
302
303 */
304     void Undo() raises (LockProtection);
305 /*! \brief Redo method
306
307     Redoes all actions of the last command.
308
309 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
310
311 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
312
313 */
314     void Redo() raises (LockProtection);
315 /*!
316     Returns True if at this moment there are any actions which can be canceled.
317
318 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
319
320 */
321     boolean GetAvailableUndos();
322 /*!
323     Returns True if at this moment there are any actions which can be redone.
324
325 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
326
327 */
328     boolean GetAvailableRedos();
329 /*!
330     Puts name attribute with the given string value to the given %SObject
331
332     \param theSO Existing SObject to set name attribute.
333     \param theValue The value to be set to the name attribute.
334 */
335     void SetName(in SObject theSO, in string theValue) raises (LockProtection);
336
337 /*!
338     Puts comment attribute with the given string value to the given %SObject
339
340     \param theSO Existing SObject to set comment attribute.
341     \param theValue The value to be set to the comment attribute.
342 */
343     void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
344
345 /*!
346     Puts IOR attribute with the given string value to the given %SObject
347
348     \param theSO Existing SObject to set IOR attribute.
349     \param theValue The value to be set to the IOR attribute.
350 */
351     void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
352   };
353
354   //===========================================================================
355  /*! \brief %Study Interface
356
357     The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
358    Most of the %Study operations are handled by the StudyBuilder.
359    What is left in the %Study interface are elementary inquiries.
360    (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
361       and set methods.) A %Study is explored by a set of tools, mainly iterators
362     , which are described further. Nevertheless, the %Study
363      interface allows the search of an object by name or by ID.
364      \note
365      <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
366     In general it's a string of names of directories divided by a slash '/'.
367      <BR><VAR>The Context</VAR> is the current directory of an object.</P>
368 */
369
370   interface Study
371   {
372
373 //! Invalid study reference
374     exception StudyInvalidReference {};
375 //! Invalid study component
376     exception StudyInvalidComponent {};
377 //! Invalid directory of the %study exception
378     exception StudyInvalidDirectory {};
379 //! Exception pointing that this name of the study has already been used.
380     exception StudyNameAlreadyUsed {};
381 //! study object already exists
382     exception StudyObjectAlreadyExists {};
383 //! Invalid name of the %study exception
384     exception StudyNameError {};
385 //! Invalid study comment
386     exception StudyCommentError {};
387
388 /*!
389     Determines whether the server has already been loaded or not.
390 */
391     void ping();
392     void Shutdown();
393 /*!
394     Returns the PID of the server
395 */
396     long getPID();
397
398 /*!
399     Shutdown the Study process.
400 */
401     oneway void ShutdownWithExit();
402
403 /*! \brief The name of the %Study
404
405    This is equivalent to the methods setName() & getName()
406 */
407     attribute wstring Name; // equivalent to getName()
408
409 /*! \brief  Indicate the file where the %study has been saved
410 */
411
412 //! Sequence containing %SObjects
413     typedef sequence<SObject> ListOfSObject;
414 //!  Get the persistent reference to the %Study.
415     PersistentReference  GetPersistentReference() raises(StudyInvalidReference);
416
417 /*! \brief indicate whether the %Study is empty
418
419     \return True if the %Study is empty
420 */
421     boolean IsEmpty() raises(StudyInvalidReference);
422 /*! \brief  Find a %SComponent by its name.
423
424    \param aComponentName    It's a string value in the Comment Attribute of the Component,
425     which is looked for, defining the data type of this Component.
426
427 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
428
429 */
430     SComponent FindComponent  (in string aComponentName) raises(StudyInvalidReference);
431
432 /*! \brief  Find a %SComponent by ID of the according %SObject
433 */
434     SComponent FindComponentID(in ID aComponentID) raises(StudyInvalidReference);
435 /*! \brief  Find a %SObject by the Name Attribute of this %SObject
436
437     \param anObjectName String parameter defining the name of the object
438     \return The obtained %SObject
439
440 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
441 */
442     SObject       FindObject      (in string anObjectName) raises(StudyInvalidReference);
443 /*! \brief  Find a %SObject by its ID
444
445     \param aObjectID This parameter defines the ID of the required object
446     \return The obtained %SObject
447 */
448     SObject       FindObjectID    (in ID aObjectID) raises(StudyInvalidReference);
449 /*! \brief Create a %SObject by its ID
450
451     \param aObjectID This parameter defines the ID of the required object
452     \return The created %SObject
453 */
454     SObject       CreateObjectID    (in ID aObjectID) raises(StudyInvalidReference);
455 /*!  \brief Find a %SObject by IOR of the object belonging to this %SObject.
456
457     \param anObjectName This parameter defines the IOR of the object
458     \return The obtained %SObject
459 */
460     SObject       FindObjectIOR   (in ID aObjectIOR) raises(StudyInvalidReference);
461 /*! \brief  Find in the study all %SObjects produced by a given %Component.
462
463     \param anObjectName The Name Attribute of the searched %SObjects should correspond to <VAR>anObjectName</VAR>.
464     \param aComponentName The name of the component, which objects are searched for.
465 */
466     ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName) raises(StudyInvalidReference);
467 /*! \brief  Find a %SObject by the path to it.
468
469     \param thePath The path to the required %SObject.
470     \return The obtained %SObject.
471 */
472     SObject FindObjectByPath(in string thePath) raises(StudyInvalidReference);
473 /*! \brief Get the path to the %SObject.
474 */
475     string GetObjectPath(in Object theObject) raises(StudyInvalidReference);
476
477 /*!  \brief Create a new iterator of child levels of the given %SObject.
478
479     \param aSO The given %SObject
480     \return A new iterator of child levels of the given %SObject.
481 */
482     ChildIterator NewChildIterator(in SObject aSO) raises(StudyInvalidReference);
483
484 /*!  \brief Create a new iterator of the %SComponents.
485
486     \return A new iterator of the %SComponents.
487 */
488     SComponentIterator NewComponentIterator() raises(StudyInvalidReference);
489
490 /*! \brief  Create a new %StudyBuilder to add or modify an object in the study.
491
492    \return A new %StudyBuilder.
493
494 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
495 */
496     StudyBuilder NewBuilder() raises(StudyInvalidReference);
497 /*! \brief Labels dependency
498
499     Updates the map with IOR attribute. It's an inner method used for optimization.
500 */
501     void UpdateIORLabelMap(in string anIOR, in string anEntry) raises(StudyInvalidReference);
502
503 /*! \brief Getting properties of the study
504
505    Returns the attribute, which contains the properties of this study.
506
507 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
508
509 */
510     AttributeStudyProperties GetProperties() raises(StudyInvalidReference);
511 /*! \brief  Indicate whether the %study has been saved
512 */
513     attribute boolean IsSaved;
514 /*! \brief  Indicate whether the %study has been modified and not saved.
515
516   Returns True if the %study has been modified and not saved.
517 */
518     boolean IsModified() raises(StudyInvalidReference);
519
520 /*! \brief  Mark the %study as being modified and not saved.
521 */
522     void Modified() raises(StudyInvalidReference);
523
524 /*! \brief  Indicate the file where the %study has been saved
525 */
526     attribute wstring URL;
527
528 /*! \brief List of %SObjects
529
530     Returns the list of %SObjects which refers to %anObject.
531 */
532     ListOfSObject FindDependances(in SObject anObject) raises(StudyInvalidReference);
533
534 /*! \brief The date of the last saving of the study
535
536     Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
537 */
538     string GetLastModificationDate() raises(StudyInvalidReference);
539 /*! \brief The list of modification dates of the study
540
541     Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
542       Note : the first modification begins the list.
543 */
544     ListOfDates GetModificationsDate() raises(StudyInvalidReference);
545 /*! \brief Object conversion.
546
547     Converts an object into IOR.
548     \return    IOR
549 */
550     string ConvertObjectToIOR(in Object theObject);
551 /*! \brief Object conversion.
552
553     Converts IOR into an object.
554     \return    An object
555 */
556     Object ConvertIORToObject(in string theIOR);
557
558 /*! \brief Get a new %UseCaseBuilder.
559 */
560     UseCaseBuilder  GetUseCaseBuilder() raises(StudyInvalidReference);
561
562 /*! \brief Clear a study object
563 */
564     void Clear() raises(StudyInvalidReference);
565
566 /*! \brief Initialization a study object
567 */
568     void Init() raises(StudyInvalidReference);
569
570 /*! \brief Open a study by url
571
572     Reads and activates the structure of the study %Objects.
573     \param aStudyUrl The path to the study
574 */
575     boolean Open (in URLPath aStudyUrl) raises (SALOME::SALOME_Exception);
576
577 /*! \brief Check if study can be opened
578
579     Tries to open and read given url.
580     \param aStudyUrl The path to the study
581 */
582     boolean CanOpen (in URLPath aStudyUrl);
583
584 /*! \brief Saving the study in a file (or files).
585
586     Saves a study.
587     \param theMultiFile If this parameter is True the study will be saved in several files.
588     \param theASCII If this parameter is True the study will be saved in ASCII format, otherwise in HDF format.
589 */
590     boolean Save(in boolean theMultiFile, in boolean theASCII) raises(StudyInvalidReference);
591
592 /*! \brief Saving the study in a specified file (or files).
593
594     Saves the study in a specified file (or files).
595     \param aUrl The path to the definite file in which the study will be saved
596     \param theMultiFile If this parameter is True the study will be saved in several files.
597     \param theASCII If this parameter is True the study will be saved in ASCII format, otherwise in HDF format.
598
599 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
600 */
601     boolean  SaveAs(in URLPath aUrl, // if the file already exists
602                     in boolean theMultiFile, // overwrite (as option)
603                     in boolean theASCII)
604                     raises(StudyInvalidReference);
605 /*!
606     Returns True, if the given %SObject can be copied to the clipboard.
607 */
608     boolean CanCopy(in SObject theObject) raises(StudyInvalidReference);
609 /*!
610     Returns True, if the given %SObject is copied to the clipboard.
611     \param theObject The %SObject which will be copied
612 */
613     boolean Copy(in SObject theObject) raises(StudyInvalidReference);
614 /*!
615     Returns True, if the object from the clipboard can be pasted to the given %SObject.
616     \param theObject The %SObject stored in the clipboard.
617 */
618     boolean CanPaste(in SObject theObject) raises(StudyInvalidReference);
619 /*!
620     Returns the %SObject in which the object from the clipboard was pasted to.
621     \param theObject The %SObject which will be pasted
622     \exception SALOMEDS::StudyBuilder::LockProtection This exception is raised, when trying to paste
623     an object into a study, which is protected for modifications.
624 */
625     SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
626
627 /*! \brief  Enable (if isEnabled = True)/disable automatic addition of new %SObjects to the use case.
628 */
629     void EnableUseCaseAutoFilling(in boolean isEnabled) raises(StudyInvalidReference);
630
631 /*!
632     Functions for internal usage only
633 */
634     void AddPostponed(in string theIOR) raises(StudyInvalidReference);
635
636     void AddCreatedPostponed(in string theIOR) raises(StudyInvalidReference);
637
638     void RemovePostponed(in long theUndoLimit) raises(StudyInvalidReference);
639
640     void UndoPostponed(in long theWay) raises(StudyInvalidReference);
641
642     boolean DumpStudy(in string thePath,
643                       in string theBaseName,
644                       in boolean isPublished,
645                       in boolean isMultiFile) raises(StudyInvalidReference);
646
647 /*! \brief  Get an AttributeParameter used to store common parameters for given %theSavePoint.
648
649     \param theID identifies a common parameters set (Example: "Interface Applicative")
650     \param theSavePoint is number of a set of parameters as there can be several sets
651 */
652     AttributeParameter GetCommonParameters(in string theID, in long theSavePoint) raises(StudyInvalidReference);
653
654 /*! \brief  Get an AttributeParameter used to store parameters for given %theModuleName.
655
656     \param theID identifies a common parameters set (Example: "Interface Applicative")
657     \param theModuleName is a name of the module (Example: "Geometry")
658     \param theSavePoint is number of a set of parameters as there can be several sets
659 */
660     AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint) raises(StudyInvalidReference);
661
662
663 /*! \brief Get a default Python script to restore visual parameters for given %theModuleName.
664
665     \param theModuleName is a name of the module (Example: "Geometry")
666     \param indent is a string to use for script indentation
667 */
668     string GetDefaultScript(in string theModuleName, in string indent) raises(StudyInvalidReference);
669
670 /*!
671     Private method, returns an implementation of this Study.
672    \param theHostname is a hostname of the caller
673    \param thePID is a process ID of the caller
674    \param isLocal is set True if the Study is launched locally with the caller
675 */
676     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
677
678
679 /*! \brief  Mark this Study as being locked by the given locker.
680
681     The lock status can be checked by method IsStudyLocked
682     \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
683 */
684     void SetStudyLock(in string theLockerID) raises(StudyInvalidReference);
685
686 /*! \brief Indicate if the Study is locked
687
688    Returns True if the Study was marked locked.
689 */
690     boolean IsStudyLocked() raises(StudyInvalidReference);
691
692 /*! \brief  Mark this Study as being unlocked by the given locker.
693
694      The lock status can be checked by method IsStudyLocked
695     \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
696 */
697     void UnLockStudy(in string theLockerID) raises(StudyInvalidReference);
698
699 /*! \brief  Get the list of IDs of the Study's lockers.
700 */
701     ListOfStrings GetLockerID() raises(StudyInvalidReference);
702
703 /*! \brief  Create real variable with Name theVarName and value theValue
704
705     (or set if variable value into theValue already exists)
706     \param theVarName is a name of the variable
707     \param theVarName is a value of the variable.
708 */
709     void SetReal( in string theVarName, in double theValue ) raises(StudyInvalidReference);
710
711 /*! \brief  Create integer variable with Name theVarName and value theValue
712
713     (or set if variable value into theValue already exists)
714     \param theVarName is a name of the variable
715     \param theVarName is a value of the variable.
716 */
717     void SetInteger( in string theVarName, in long theValue ) raises(StudyInvalidReference);
718 /*! \brief  Create boolean variable with Name theVarName and value theValue
719
720     (or set if variable value into theValue already exists)
721     \param theVarName is a name of the variable
722     \param theVarName is a value of the variable.
723 */
724     void SetBoolean( in string theVarName, in boolean theValue ) raises(StudyInvalidReference);
725
726 /*! \brief  Create string variable with Name theVarName and value theValue
727
728     (or set if variable value into theValue already exists)
729     \param theVarName is a name of the variable
730     \param theVarName is a value of the variable.
731 */
732     void SetString( in string theVarName, in string theValue ) raises(StudyInvalidReference);
733
734 /*! \brief  Set current value as double for string variable
735 */
736     void SetStringAsDouble( in string theVarName, in double theValue ) raises(StudyInvalidReference);
737
738 /*! \brief Get value of a real variable
739
740     \param theVarName is a name of the variable.
741 */
742     double GetReal( in string theVarName ) raises(StudyInvalidReference);
743
744 /*! \brief Get value of an integer variable
745
746     \param theVarName is a name of the variable.
747 */
748     long GetInteger( in string theVarName ) raises(StudyInvalidReference);
749
750 /*! \brief Get value of a boolean variable
751
752     \param theVarName is a name of the variable.
753 */
754     boolean GetBoolean( in string theVarName ) raises(StudyInvalidReference);
755
756 /*! \brief Get value of a string variable
757
758     \param theVarName is a name of the variable.
759 */
760     string GetString( in string theVarName ) raises(StudyInvalidReference);
761
762
763 /*! \brief Indicate if a variable is real
764
765     Return true if variable is real otherwise return false.
766     \param theVarName is a name of the variable.
767 */
768     boolean IsReal( in string theVarName ) raises(StudyInvalidReference);
769
770 /*! \brief Indicate if a variable is integer
771
772     Return true if variable is integer otherwise return false.
773     \param theVarName is a name of the variable.
774 */
775     boolean IsInteger( in string theVarName ) raises(StudyInvalidReference);
776
777 /*! \brief Indicate if a variable is boolean
778
779     Return true if variable is boolean otherwise return false.
780     \param theVarName is a name of the variable.
781 */
782     boolean IsBoolean( in string theVarName ) raises(StudyInvalidReference);
783
784 /*! \brief Indicate if a variable is string
785
786     Return true if variable is string otherwise return false.
787     \param theVarName is a name of the variable.
788 */
789     boolean IsString( in string theVarName ) raises(StudyInvalidReference);
790
791 /*! \brief Indicate if a variable exists in the study
792
793     Return true if variable exists in the study,
794     otherwise return false.
795     \param theVarName is a name of the variable.
796 */
797     boolean IsVariable( in string theVarName ) raises(StudyInvalidReference);
798
799 /*! \brief Get names of all variables from the study.
800 */
801     ListOfStrings GetVariableNames() raises(StudyInvalidReference);
802
803 /*! \brief Remove a variable
804
805    Remove variable with the specified name from the study with substitution of its value.
806
807    \param theVarName Name of the variable.
808    \return Status of operation.
809 */
810     boolean RemoveVariable( in string theVarName ) raises(StudyInvalidReference);
811
812 /*! \brief Rename a variable
813
814    Rename variable with the specified name within the study.
815
816    \param theVarName Name of the variable.
817    \param theNewVarName New name for the variable.
818    \return Status of operation.
819 */
820     boolean RenameVariable( in string theVarName, in string theNewVarName ) raises(StudyInvalidReference);
821
822 /*! \brief Indicate whether variable is used
823
824    Check that variable is used in the study.
825
826    \param theVarName Name of the variable.
827    \return Variable usage.
828 */
829     boolean IsVariableUsed( in string theVarName ) raises(StudyInvalidReference);
830
831 /*! \brief Parse variables used for object creation
832
833    \param string with variables, separated by special symbol.
834    \return Variables list.
835 */
836     ListOfListOfStrings ParseVariables( in string theVars ) raises(StudyInvalidReference);
837
838 /*!
839      Attach an observer to the Study
840
841     \param theObserver observer being attached
842     \param modify when \c true, observer receives any object's modification events;
843            otherwise observer receives object's creation events only
844 */
845      void attach(in SALOMEDS::Observer theObserver, in boolean modify);
846 /*!
847      Detach an observer from the Study
848
849     \param theObserver observer to be detached
850 */
851      void detach(in SALOMEDS::Observer theObserver);
852   };
853
854   //==========================================================================
855 /*! \brief %SObject interface
856
857    The objects in the %study are built by the %StudyBuilder. The %SObject interface
858    provides methods for elementary inquiries, like getting an object %ID or its attribuites.
859  \note
860
861    <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
862    in the tree-type data structure.
863    <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
864    ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
865 */
866   //==========================================================================
867
868   interface SObject : SALOME::GenericObj
869   {
870 /*! Name of the %SObject
871 */
872     attribute string Name; // equivalent to setName() & getName()
873
874 /*! Returns true if the %SObject does not belong to any %Study
875 */
876     boolean IsNull();
877
878 /*! Gets an object %ID
879    \return ID of the %SObject.
880 */
881     ID GetID();
882
883 /*!  Acquisition of the father %Component of the %SObject
884   \return The father %Component of the %SObject.
885 */
886     SComponent GetFatherComponent();
887
888 /*! Acquisition of the father %SObject of the %SObject
889    \return the father %SObject of the given %SObject.
890 */
891     SObject    GetFather();
892
893 /*! Gets the %tag of a %SObject
894     \return the %tag of a %SObject.
895 */
896     short      Tag();
897
898 /*! Returns a tag of the last child %SObject (if any) of this %SObject.
899     Returns zero if this %SObject has no children.
900 */
901     short      GetLastChildTag();
902
903 /*! Gets the depth of a %SObject
904     \return the depth of a %SObject.
905 */
906     short      Depth();
907
908 /*! Looks for subobjects of a given %SObject.
909     \param atag Tag of the given %SObject
910     \return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
911 */
912     boolean FindSubObject (in long atag, out SObject obj);
913
914 /*! Looks for attributes of a given %SObject
915    \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
916    \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
917
918 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
919 */
920     boolean FindAttribute(out GenericAttribute anAttribute,
921                                   in  string         aTypeOfAttribute);
922
923 /*! Looks for a %SObject which the given %SObject refers to.
924     \return The object which the given %SObject refers to as well as True if it finds
925     this object.
926 */
927     boolean ReferencedObject(out SObject obj); // A REVOIR
928
929 /*! Gets all attributes of a given %SObject
930     \return The list of all attributes of the given %SObject.
931
932 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
933
934 */
935     ListOfAttributes     GetAllAttributes();
936
937 /*! Gets the CORBA object by its own IOR attribute.
938     Returns nil, if can't.
939     \return The CORBA object of the %SObject.
940 */
941     Object GetObject();
942
943 /*!
944     Returns the name attribute value of this SObject.
945     Returns empty string if there is no name attribute.
946 */
947     string GetName();
948
949 /*!
950     Returns the comment attribute value of this SObject.
951     Returns empty string if there is no comment attribute.
952 */
953     string GetComment();
954
955 /*!
956     Returns the IOR attribute value of this SObject.
957     Returns empty string if there is no IOR attribute.
958 */
959     string GetIOR();
960
961 /*!
962     Set an attribute value (of type string)
963    \param name the name of the attribute
964    \param value the value of the attribute
965 */
966     void SetAttrString(in string name, in string value);
967
968 /*!
969     Private method, returns an implementation of this SObject.
970    \param theHostname is a hostname of the caller
971    \param thePID is a process ID of the caller
972    \param isLocal is set True if the SObject is launched locally with the caller
973 */
974     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
975   };
976
977
978   //==========================================================================
979 /*! \brief %Generic attribute interface
980
981    %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
982 */
983   //==========================================================================
984   interface GenericAttribute : SALOME::GenericObj
985   {
986 /*! \brief Exception locking all changes
987
988     This exception locks all modifications in attributes.
989 */
990     exception LockProtection {};
991 /*! \brief Method CheckLocked
992
993    Checks whether the %Study is protected for modifications.
994
995    \note <BR>This exception is raised only outside a transaction.
996 */
997     void CheckLocked() raises (LockProtection);
998
999     //! Get Type
1000     string Type();
1001
1002     //! Get the class type
1003     string GetClassType();
1004
1005     //! Get SObject
1006     SObject GetSObject();
1007
1008   //!  Private method, returns an implementation of this GenericAttribute.
1009 /*!
1010    \param theHostname is a hostname of the caller
1011    \param thePID is a process ID of the caller
1012    \param isLocal is set True if the GenericAttribute is launched locally with the caller
1013 */
1014     long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1015   };
1016
1017
1018
1019   //==========================================================================
1020 /*! \brief %SComponent interface
1021
1022    The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
1023    The %SComponent interface is a specialization of the %SObject interface.
1024    It inherits the most of its methods from the %SObject interface.
1025 */
1026   //==========================================================================
1027   interface SComponent : SObject
1028   {
1029 /*! \brief Gets the data type of the given %SComponent
1030
1031     \return The data type of this %SComponent.
1032 */
1033     string  ComponentDataType();
1034 /*! \brief Gets the IOR of the given component
1035
1036   \return True (if there is an instance of the given component) and its IOR.
1037 */
1038     boolean ComponentIOR (out ID theID); //returns True if there is an instance
1039                                          //In this case ID identifies this one
1040   };
1041
1042
1043   //==========================================================================
1044 /*! \brief %SComponentIterator interface
1045
1046   This interface contains the methods allowing to iterate over all components in the list.
1047   The search is started from the first %SComponent in the list.
1048 */
1049   //==========================================================================
1050   interface SComponentIterator : SALOME::GenericObj
1051   {
1052 /*!
1053 \brief Activates the %SComponentIterator.
1054 */
1055     void Init();
1056 /*!  \brief Method More
1057
1058    \return True if there is one more %SComponent in the list.
1059 */
1060     boolean More();
1061 /*!
1062 \brief Moves the iterator to the next %SComponent in the list.
1063 */
1064     void Next();
1065 /*!
1066     \brief Returns the %SComponent corresponding to the current %SComponent found by the iterator.
1067
1068 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1069
1070 */
1071     SComponent Value();
1072   };
1073
1074   //==========================================================================
1075 /*! \brief %ChildIterator interface
1076
1077     This interface contains methods which allow to iterate over all child
1078     levels.
1079 */
1080   //==========================================================================
1081   interface ChildIterator : SALOME::GenericObj
1082   {
1083 /*!
1084
1085 \brief Activates the %ChildIterator.
1086 */
1087     void Init();
1088 /*!
1089
1090 \brief Activates the %ChildIterator for all child levels.
1091
1092 \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels.
1093 */
1094     void InitEx(in boolean allLevels);
1095 /*! \brief Method More
1096
1097    \return True if there is one more %ChildIterator in the list.
1098 */
1099     boolean More();
1100 /*!
1101     \brief Passes the iterator to the next level.
1102 */
1103     void Next();
1104 /*!
1105     \brief Returns the %SObject corresponding to the current object found by the iterator.
1106 */
1107     SObject Value();
1108   };
1109
1110   //==========================================================================
1111   //==========================================================================
1112 /*! \brief Interface of the %UseCaseIterator.
1113
1114    This interface contains a set of methods used for iteration over the objects in the use case.
1115 */
1116   interface UseCaseIterator : SALOME::GenericObj
1117   {
1118 /*!
1119 Activates the %UseCaseIterator.
1120 \param allLevels If the value of this parameter is True the Iterator is activated for all subobjects.
1121 */
1122     void Init(in boolean allLevels);
1123 /*! Method More
1124
1125     \return True if the %UseCaseIterator finds one more object.
1126 */
1127     boolean More();
1128 /*!
1129     Passes the iterator to the next object.
1130 */
1131     void Next();
1132 /*!
1133     Returns the %SObject corresponding to the current object found by the Iterator.
1134 */
1135     SObject Value();
1136   };
1137
1138   //==========================================================================
1139   //==========================================================================
1140 /*! \brief Interface of the %UseCaseBuilder
1141
1142    Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
1143    The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
1144 */
1145   interface UseCaseBuilder : SALOME::GenericObj
1146   {
1147 /*!
1148    Adds to the use case an object as a child of the current object of the use case.
1149
1150    \param theObject The added %SObject.
1151    \return True if this %SObject has been added in the use case.
1152 */
1153     boolean Append(in SObject theObject);
1154 /*!
1155    Removes an object from the use case.
1156
1157    \param theObject The deleted %SObject
1158    \return True if this %SObject has been deleted from the use case.
1159 */
1160     boolean Remove(in SObject theObject);
1161 /*!
1162    Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
1163 */
1164     boolean AppendTo(in SObject theFather, in SObject theObject);
1165 /*!
1166     Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
1167 */
1168     boolean InsertBefore(in SObject theFirst, in SObject theNext);
1169 /*!
1170     Sets the current object of the use case.
1171 */
1172     boolean SetCurrentObject(in SObject theObject);
1173 /*!
1174     Makes the root object to be the current object of the use case.
1175 */
1176     boolean SetRootCurrent();
1177 /*!
1178    Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
1179 */
1180     boolean HasChildren(in SObject theObject);
1181 /*!
1182    Returns True if children of the given object <VAR>theObject</VAR> of the use case tree were sorted successfully.
1183 */
1184     boolean SortChildren(in SObject theObject, in boolean theAscendingOrder);
1185 /*!
1186    Gets father object of the given object <VAR>theObject</VAR> in the use cases tree.
1187 */
1188     SObject GetFather(in SObject theObject);
1189 /*!
1190    Sets the name of the use case.
1191 */
1192     boolean SetName(in string theName);
1193 /*!
1194    Gets the name of the use case.
1195 */
1196     string GetName();
1197 /*!
1198    Returns True if the given object <VAR>theObject</VAR> represents a use case.
1199 */
1200     boolean IsUseCase(in SObject theObject);
1201 /*!
1202    Returns True if the given object <VAR>theObject</VAR> is included in the use cases tree on any level.
1203 */
1204     boolean IsUseCaseNode(in SObject theObject);
1205 /*!
1206     Gets the current object of the use case.
1207 */
1208     SObject GetCurrentObject();
1209 /*!
1210     Creates a new use case in the use case browser.
1211 */
1212     SObject AddUseCase(in string theName);
1213 /*!
1214     Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
1215 */
1216     UseCaseIterator GetUseCaseIterator(in SObject theObject);
1217   };
1218   //==========================================================================
1219 /*! \brief %Driver interface
1220
1221 This class represents a common tool for all components integrated into SALOME application, that allows them to communicate with the study. It contains a set of methods which
1222 can be called by any component and which provide the following functionality:
1223 <ul>
1224     <li> publishing in the study of the objects created by a definite component
1225     <li> saving/loading of the data created by a definite component. These methods are called when loading/saving a study containing the data created by a definite component.
1226     <li> transforming of the transient references into persistent references (or vice versa) of the SObjects when saving (or loading) a study
1227     <li> copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study
1228 </ul>
1229
1230 */
1231   //==========================================================================
1232   interface Driver
1233   {
1234
1235     /*! \brief Saving the data produced by a definite component.
1236
1237         This method is called when saving a study.
1238        \param theComponent    %SComponent corresponding to this Component
1239        \param theURL  The path to the file in which the data will be saved.
1240        \param isMultiFile  If the value of this boolean parameter is True, the data will be saved in several files.
1241        \return A byte stream TMPFile that contains all saved data
1242
1243 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1244
1245      */
1246
1247
1248     TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1249
1250 /*! \brief Saving the data in ASCII format produced by a definite component.
1251
1252         This method is called when saving a study in ASCII format.
1253        \param theComponent    %SComponent corresponding to this Component
1254        \param theURL  The path to the file in which the data will be saved.
1255        \param isMultiFile  If the value of this boolean parameter is True, the data will be saved in several files.
1256        \return A byte stream TMPFile that will contain all saved data
1257
1258 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1259
1260      */
1261     TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1262
1263     /*! \brief Loading the data.
1264
1265        This method is called when opening a study.
1266        \param theComponent      %SComponent corresponding to this Component
1267        \param theStream   The file which contains all data saved by the component on Save method
1268        \param isMultiFile  If the value of this boolean parameter is True, the data will be loaded from several files
1269
1270      */
1271
1272     boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1273
1274     /*! \brief Loading the data from files in ASCII format.
1275
1276        This method is called when opening a study.
1277        \param theComponent      %SComponent corresponding to this Component
1278        \param theStream   The file which contains all data saved by the component on Save method
1279        \param isMultiFile  If the value of this boolean parameter is True, the data will be loaded from several files
1280
1281      */
1282
1283     boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1284
1285     /*! \brief Closing of the study
1286
1287       This method Close is called when closing a study.
1288     \param aSComponent The according %SComponent
1289      */
1290
1291     void Close (in SComponent aSComponent);
1292     //void Close ( in string  aIORSComponent);
1293
1294     /*! Gets the type of the data
1295
1296         \return The type of data produced by the Component in the study.
1297      */
1298
1299      string ComponentDataType();
1300
1301     // Driver Transient -> persistent called for each object in study
1302 /*!
1303    Transforms IOR of a given %SObject into PersistentID. It is called for each
1304    object in the %study.
1305 \note <br> In %SALOME the objects which are present in an active study are identified by an IOR, when this
1306 study is saved these references are transformed into persintent IDs.
1307
1308    \param theSObject The given %SObject.
1309    \param IORString The IOR of the given %SObject.
1310    \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1311    \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1312
1313    \return The persistent ID of the given %SObject
1314
1315 */
1316     string IORToLocalPersistentID (in SObject theSObject,
1317                                    in string IORString,
1318                                    in boolean isMultiFile,
1319                                    in boolean isASCII);
1320 /*!
1321   Transforms PersistentID into IOR of the object. It is called for each
1322    object in the %study.
1323
1324    \note <br> In %SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this
1325 study is open, these references are transformed into persintent IORs.
1326
1327    \param theSObject The given %SObject.
1328    \param IORString The IOR of the given %SObject.
1329    \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1330    \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1331
1332    \return The IOR of the given %SObject
1333
1334 */
1335     string LocalPersistentIDToIOR (in SObject theSObject,
1336                                    in string aLocalPersistentID,
1337                                    in boolean isMultiFile,
1338                                    in boolean isASCII)
1339       raises (SALOME::SALOME_Exception);
1340
1341     // Publishing in the study
1342 /*! Publishing in the study
1343
1344     \return True if the given %Component can publish a definite object with a given IOR in the %study.
1345     \param theIOR The IOR of a definite object
1346 */
1347     boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1348 /*! \brief Publishing in the study
1349
1350    Publishes the given object in the %study, using the algorithm of this component.
1351     \param theSObject     If this parameter is null the object is published for the first time. Otherwise
1352     this parameter should contain a reference to the object published earlier
1353     \param theObject      The object which is published
1354     \param theName      The name of the published object. If this parameter is empty, the name is generated
1355     automatically by the component.
1356
1357     \return The published %SObject.
1358 */
1359     SObject PublishInStudy(in SObject theSObject, in Object theObject, in string theName);
1360
1361     // copy/paste methods
1362
1363 /*!
1364     Returns True, if the given %SObject can be copied to the clipboard.
1365
1366     \param theObject The given %SObject which should be copied.
1367 */
1368     boolean CanCopy(in SObject theObject);
1369 /*!
1370     Returns the object %ID and the %TMPFile of the object from the given %SObject.
1371 */
1372     TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1373 /*!
1374     Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1375 */
1376     boolean CanPaste(in string theComponentName, in long theObjectID);
1377 /*!
1378     Returns the %SObject of the pasted object.
1379 */
1380     SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);
1381
1382   };
1383 };
1384
1385 #endif