1 // Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // File : SALOMEDS.idl
24 // Author : Yves FRICAUD
26 /*! \file SALOMEDS.idl \brief This file contains a set of interfaces used for creation, management
27 and modification of the %Study
30 #ifndef _SALOMEDS_IDL_
31 #define _SALOMEDS_IDL_
33 #include "SALOME_Exception.idl"
34 #include "SALOME_GenericObj.idl"
37 This package contains the interfaces used for creation, management
38 and modification of the %Study
42 /*! \brief Name of the file in which the %Study is saved.
44 typedef string URLPath;
46 /*! \brief Main identifier of an object in %SALOME application
50 /*! \brief While saving the data, IOR is transformed into persistent reference
52 typedef string PersistentReference;
54 /*! \brief IOR of the study in %SALOME application
56 typedef string SalomeReference;
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;
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
76 interface GenericAttribute;
78 interface StudyBuilder;
81 interface SComponentIterator;
82 interface ChildIterator;
84 interface AttributeStudyProperties;
85 interface AttributeParameter;
86 interface UseCaseIterator;
87 interface UseCaseBuilder;
91 oneway void notifyObserverID(in string theID, in long event);
95 //! List of attributes of %SObjects
96 typedef sequence<GenericAttribute> ListOfAttributes;
98 //! Exception indicating that this feature hasn't been implemented in %SALOME application.
99 exception NotImplemented {};
101 //==========================================================================
102 /*! \brief %Study Builder Interface
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.
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>
112 //==========================================================================
114 interface StudyBuilder
116 /*! \brief %LockProtection Exception
118 This exception is raised while attempting to modify a locked %study.
120 exception LockProtection {};
121 /*! \brief Creation of a new %SComponent.
123 Creates a new %SComponent
124 \param ComponentDataType Data type of the %SComponent which will be created.
126 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
129 SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
130 /*! \brief Definition of the instance to the %SComponent
132 Defines the instance to the %SComponent.
134 void DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
136 /*! \brief Deletion of a %SComponent
138 Removes a %SComponent.
140 void RemoveComponent(in SComponent aComponent) raises(LockProtection);
142 /*! \brief Creation of a new %SObject
144 Creates a new %SObject under a definite father %SObject.
146 \param theFatherObject The father %SObject under which this one should be created.
149 <em>See \ref example18 for an example of this method usage in batchmode of %SALOME application.</em>
153 SObject NewObject (in SObject theFatherObject) raises(LockProtection);
155 /*! \brief Creation of a new %SObject with a definite %tag
157 Creates a new %SObject with a definite %tag.
159 \param atag Long value corresponding to the tag of the new %SObject.
163 SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
164 /*! \brief Deletion of the %SObject
166 Removes a %SObject from the %StudyBuilder.
168 \param anObject The %SObject to be deleted.
170 void RemoveObject (in SObject anObject) raises(LockProtection);
171 /*! \brief Deletion of the %SObject with all his child objects.
173 Removes the %SObject with all his child objects.
175 \param anObject The %SObject to be deleted with all child objects.
177 void RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
182 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
185 void LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
189 \param sco %SObject to be loaded.
191 void Load (in SObject sco);
193 /*! \brief Looking for or creating an attribute assigned to the %SObject
195 Allows to find or create an attribute of a specific type which is assigned to the object.
196 \param anObject The %SObject corresponding to the attribute which is looked for.
197 \param aTypeOfAttribute Type of the attribute.
199 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
202 GenericAttribute FindOrCreateAttribute(in SObject anObject,
203 in string aTypeOfAttribute) raises(LockProtection);
205 /*! \brief Looking for an attribute assigned to a %SObject
207 Allows to find an attribute of a specific type which is assigned to the object.
208 \param anObject The %SObject corresponding to the attribute which is looked for.
209 \param aTypeOfAttribute Type of the attribute.
210 \param anAttribute Where the attribute is placed if it's found.
211 \return True if it finds an attribute.
214 boolean FindAttribute(in SObject anObject,
215 out GenericAttribute anAttribute,
216 in string aTypeOfAttribute);
217 /*! \brief Deleting the attribute assigned to the %SObject
219 Removes the attribute of a specific type which is assigned to the object.
220 \param anObject The %SObject corresponding to the attribute.
221 \param aTypeOfAttribute Type of the attribute.
223 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
225 void RemoveAttribute(in SObject anObject,
226 in string aTypeOfAttribute) raises(LockProtection);
228 Adds a reference between %anObject and %theReferencedObject.
229 \param anObject The %SObject which will get a reference
230 \param theReferencedObject The %SObject having a reference
233 void Addreference(in SObject anObject,
234 in SObject theReferencedObject) ;
237 Removes a reference from %anObject to another object.
238 \param anObject The %SObject which contains a reference
241 void RemoveReference(in SObject anObject) ;
244 Adds a directory in the %Study.
245 \param theName String parameter defining the name of the directory.
247 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
250 void AddDirectory(in string theName) raises(LockProtection);
252 /*! \brief Identification of the %SObject's substructure.
254 Identification of the %SObject's substructure by GUID.
257 \param anObject The %SObject which will be identified
258 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
261 void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
263 Searches for a definite %SObject with a definite GUID and returns True if it finds it.
265 \param anObject A definite %SObject which will be identified
266 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
268 boolean IsGUID(in SObject anObject, in string theGUID);
270 /*! \brief Creation of a new command
272 Creates a new command which can contain several different actions.
274 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
277 void NewCommand(); // command management
278 /*! \brief Execution of the command
280 Commits all actions declared within this command.
282 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
284 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
287 void CommitCommand() raises(LockProtection); // command management
289 Returns True if at this moment there is a command under execution.
291 boolean HasOpenCommand();
292 /*! \brief Cancelation of the command
294 Cancels all actions declared within the command.
296 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
298 void AbortCommand(); // command management
301 The number of actions which can be undone
303 attribute long UndoLimit;
304 /*! \brief Undo method
306 Cancels all actions of the last command.
308 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
310 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
313 void Undo() raises (LockProtection);
314 /*! \brief Redo method
316 Redoes all actions of the last command.
318 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
320 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
323 void Redo() raises (LockProtection);
325 Returns True if at this moment there are any actions which can be canceled.
327 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
330 boolean GetAvailableUndos();
332 Returns True if at this moment there are any actions which can be redone.
334 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
337 boolean GetAvailableRedos();
339 Puts name attribute with the given string value to the given %SObject
341 \param theSO Existing SObject to set name attribute.
342 \param theValue The value to be set to the name attribute.
344 void SetName(in SObject theSO, in string theValue) raises (LockProtection);
347 Puts comment attribute with the given string value to the given %SObject
349 \param theSO Existing SObject to set comment attribute.
350 \param theValue The value to be set to the comment attribute.
352 void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
355 Puts IOR attribute with the given string value to the given %SObject
357 \param theSO Existing SObject to set IOR attribute.
358 \param theValue The value to be set to the IOR attribute.
360 void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
363 //===========================================================================
364 /*! \brief %Study Interface
366 The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
367 Most of the %Study operations are handled by the StudyBuilder.
368 What is left in the %Study interface are elementary inquiries.
369 (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
370 and set methods.) A %Study is explored by a set of tools, mainly iterators
371 , which are described further. Nevertheless, the %Study
372 interface allows the search of an object by name or by ID.
374 <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
375 In general it's a string of names of directories divided by a slash '/'.
376 <BR><VAR>The Context</VAR> is the current directory of an object.</P>
382 //! Invalid study reference
383 exception StudyInvalidReference {};
384 //! Invalid study context
385 exception StudyInvalidContext {};
386 //! Invalid study component
387 exception StudyInvalidComponent {};
388 //! Invalid directory of the %study exception
389 exception StudyInvalidDirectory {};
390 //! Exception pointing that this name of the study has already been used.
391 exception StudyNameAlreadyUsed {};
392 //! study object already exists
393 exception StudyObjectAlreadyExists {};
394 //! Invalid name of the %study exception
395 exception StudyNameError {};
396 //! Invalid study comment
397 exception StudyCommentError {};
400 Determines whether the server has already been loaded or not.
405 Returns the PID of the server
410 Shutdown the Study process.
412 oneway void ShutdownWithExit();
414 /*! \brief The name of the %Study
416 This is equivalent to the methods setName() & getName()
418 readonly attribute string Name; // equivalent to getName()
420 //! Sequence containing %SObjects
421 typedef sequence<SObject> ListOfSObject;
422 //! Get the persistent reference to the %Study.
423 PersistentReference GetPersistentReference() raises(StudyInvalidReference);
424 //! Get a transient reference to the %Study.
425 SalomeReference GetTransientReference() raises(StudyInvalidReference);
427 /*! \brief indicate whether the %Study is empty
429 \return True if the %Study is empty
431 boolean IsEmpty() raises(StudyInvalidReference);
432 /*! \brief Find a %SComponent by its name.
434 \param aComponentName It's a string value in the Comment Attribute of the Component,
435 which is looked for, defining the data type of this Component.
437 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
440 SComponent FindComponent (in string aComponentName) raises(StudyInvalidReference);
442 /*! \brief Find a %SComponent by ID of the according %SObject
444 SComponent FindComponentID(in ID aComponentID) raises(StudyInvalidReference);
445 /*! \brief Find a %SObject by the Name Attribute of this %SObject
447 \param anObjectName String parameter defining the name of the object
448 \return The obtained %SObject
450 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
452 SObject FindObject (in string anObjectName) raises(StudyInvalidReference);
453 /*! \brief Find a %SObject by its ID
455 \param aObjectID This parameter defines the ID of the required object
456 \return The obtained %SObject
458 SObject FindObjectID (in ID aObjectID) raises(StudyInvalidReference);
459 /*! \brief Create a %SObject by its ID
461 \param aObjectID This parameter defines the ID of the required object
462 \return The created %SObject
464 SObject CreateObjectID (in ID aObjectID) raises(StudyInvalidReference);
465 /*! \brief Find a %SObject by IOR of the object belonging to this %SObject.
467 \param anObjectName This parameter defines the IOR of the object
468 \return The obtained %SObject
470 SObject FindObjectIOR (in ID aObjectIOR) raises(StudyInvalidReference);
471 /*! \brief Find in the study all %SObjects produced by a given %Component.
473 \param anObjectName The Name Attribute of the searched %SObjects should correspond to <VAR>anObjectName</VAR>.
474 \param aComponentName The name of the component, which objects are searched for.
476 ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName) raises(StudyInvalidReference);
477 /*! \brief Find a %SObject by the path to it.
479 \param thePath The path to the required %SObject.
480 \return The obtained %SObject.
482 SObject FindObjectByPath(in string thePath) raises(StudyInvalidReference);
483 /*! \brief Get the path to the %SObject.
485 string GetObjectPath(in Object theObject) raises(StudyInvalidReference);
487 /*! \brief Set the context of the %Study.
489 \param thePath String parameter defining the context of the study.
491 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
493 void SetContext(in string thePath) raises (StudyInvalidReference, StudyInvalidContext);
494 /*! \brief Get the context of the %Study.
496 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
498 string GetContext() raises (StudyInvalidReference, StudyInvalidContext);
499 /*! \brief Get a list of names of objects corresponding to the context.
501 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
503 ListOfStrings GetObjectNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
504 /*! \brief Get a list of names of directories and subdirectories corresponding to the context.
506 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
508 ListOfStrings GetDirectoryNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
509 /*! \brief Get a list of names of Files corresponding to the context.
511 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
513 ListOfStrings GetFileNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
514 /*! \brief Get a list of names of Components corresponding to the context.
516 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
518 ListOfStrings GetComponentNames(in string theContext) raises(StudyInvalidReference);
519 /*! \brief Create a new iterator of child levels of the given %SObject.
521 \param aSO The given %SObject
522 \return A new iterator of child levels of the given %SObject.
524 ChildIterator NewChildIterator(in SObject aSO) raises(StudyInvalidReference);
526 /*! \brief Create a new iterator of the %SComponents.
528 \return A new iterator of the %SComponents.
530 SComponentIterator NewComponentIterator() raises(StudyInvalidReference);
532 /*! \brief Create a new %StudyBuilder to add or modify an object in the study.
534 \return A new %StudyBuilder.
536 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
538 StudyBuilder NewBuilder() raises(StudyInvalidReference);
539 /*! \brief Labels dependency
541 Updates the map with IOR attribute. It's an inner method used for optimization.
543 void UpdateIORLabelMap(in string anIOR, in string anEntry) raises(StudyInvalidReference);
545 /*! \brief Getting properties of the study
547 Returns the attribute, which contains the properties of this study.
549 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
552 AttributeStudyProperties GetProperties() raises(StudyInvalidReference);
553 /*! \brief Indicate whether the %study has been saved
555 attribute boolean IsSaved;
556 /*! \brief Indicate whether the %study has been modified and not saved.
558 Returns True if the %study has been modified and not saved.
560 boolean IsModified() raises(StudyInvalidReference);
562 /*! \brief Mark the %study as being modified and not saved.
564 void Modified() raises(StudyInvalidReference);
566 /*! \brief Indicate the file where the %study has been saved
568 attribute string URL;
570 /*! \brief List of %SObjects
572 Returns the list of %SObjects which refers to %anObject.
574 ListOfSObject FindDependances(in SObject anObject) raises(StudyInvalidReference);
576 /*! \brief The date of the last saving of the study
578 Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
580 string GetLastModificationDate() raises(StudyInvalidReference);
581 /*! \brief The list of modification dates of the study
583 Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
584 Note : the first modification begins the list.
586 ListOfDates GetModificationsDate() raises(StudyInvalidReference);
587 /*! \brief Object conversion.
589 Converts an object into IOR.
592 string ConvertObjectToIOR(in Object theObject);
593 /*! \brief Object conversion.
595 Converts IOR into an object.
598 Object ConvertIORToObject(in string theIOR);
600 /*! \brief Get a new %UseCaseBuilder.
602 UseCaseBuilder GetUseCaseBuilder() raises(StudyInvalidReference);
604 /*! \brief Clear a study object
606 void Clear() raises(StudyInvalidReference);
608 /*! \brief Initialization a study object
610 void Init() raises(StudyInvalidReference);
612 /*! \brief Open a study by url
614 Reads and activates the structure of the study %Objects.
615 \param aStudyUrl The path to the study
617 boolean Open (in URLPath aStudyUrl) raises (SALOME::SALOME_Exception);
619 /*! \brief Saving the study in a HDF file (or files).
622 \param theMultiFile If this parameter is True the study will be saved in several files.
624 boolean Save(in boolean theMultiFile) raises(StudyInvalidReference);
626 /*! \brief Saving a study in a ASCII file (or files).
628 Saves a study in an ASCII format file (or files).
629 \param theMultiFile If this parameter is True the study will be saved in several files.
631 boolean SaveASCII(in boolean theMultiFile) raises(StudyInvalidReference);
632 /*! \brief Saving the study in a specified HDF file (or files).
634 Saves the study in a specified file (or files).
635 \param aUrl The path to the definite file in whcih the study will be saved
636 \param aStudy The study which will be saved
637 \param theMultiFile If this parameter is True the study will be saved in several files.
639 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
641 boolean SaveAs(in URLPath aUrl, // if the file already exists
642 in boolean theMultiFile) // overwrite (as option)
643 raises(StudyInvalidReference);
644 /*! \brief Saving the study in a specified ASCII file (or files).
646 Saves the study in a specified ASCII file (or files).
648 \param aUrl The path to the definite file in whcih the study will be saved
649 \param aStudy The study which will be saved
650 \param theMultiFile If this parameter is True the study will be saved in several files.
652 boolean SaveAsASCII(in URLPath aUrl, // if the file already exists
653 in boolean theMultiFile) // overwrite (as option)
654 raises(StudyInvalidReference);
656 Returns True, if the given %SObject can be copied to the clipboard.
658 boolean CanCopy(in SObject theObject) raises(StudyInvalidReference);
660 Returns True, if the given %SObject is copied to the clipboard.
661 \param theObject The %SObject which will be copied
663 boolean Copy(in SObject theObject) raises(StudyInvalidReference);
665 Returns True, if the object from the clipboard can be pasted to the given %SObject.
666 \param theObject The %SObject stored in the clipboard.
668 boolean CanPaste(in SObject theObject) raises(StudyInvalidReference);
670 Returns the %SObject in which the object from the clipboard was pasted to.
671 \param theObject The %SObject which will be pasted
672 \exception SALOMEDS::StudyBuilder::LockProtection This exception is raised, when trying to paste
673 an object into a study, which is protected for modifications.
675 SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
677 /*! \brief Enable (if isEnabled = True)/disable automatic addition of new %SObjects to the use case.
679 void EnableUseCaseAutoFilling(in boolean isEnabled) raises(StudyInvalidReference);
682 Functions for internal usage only
684 void AddPostponed(in string theIOR) raises(StudyInvalidReference);
686 void AddCreatedPostponed(in string theIOR) raises(StudyInvalidReference);
688 void RemovePostponed(in long theUndoLimit) raises(StudyInvalidReference);
690 void UndoPostponed(in long theWay) raises(StudyInvalidReference);
692 boolean DumpStudy(in string thePath,
693 in string theBaseName,
694 in boolean isPublished,
695 in boolean isMultiFile) raises(StudyInvalidReference);
697 /*! \brief Get an AttributeParameter used to store common parameters for given %theSavePoint.
699 \param theID identifies a common parameters set (Example: "Interface Applicative")
700 \param theSavePoint is number of a set of parameters as there can be several sets
702 AttributeParameter GetCommonParameters(in string theID, in long theSavePoint) raises(StudyInvalidReference);
704 /*! \brief Get an AttributeParameter used to store parameters for given %theModuleName.
706 \param theID identifies a common parameters set (Example: "Interface Applicative")
707 \param theModuleName is a name of the module (Example: "Geometry")
708 \param theSavePoint is number of a set of parameters as there can be several sets
710 AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint) raises(StudyInvalidReference);
713 /*! \brief Get a default Python script to restore visual parameters for given %theModuleName.
715 \param theModuleName is a name of the module (Example: "Geometry")
716 \param indent is a string to use for script indentation
718 string GetDefaultScript(in string theModuleName, in string indent) raises(StudyInvalidReference);
721 Private method, returns an implementation of this Study.
722 \param theHostname is a hostname of the caller
723 \param thePID is a process ID of the caller
724 \param isLocal is set True if the Study is launched locally with the caller
726 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
729 /*! \brief Mark this Study as being locked by the given locker.
731 The lock status can be checked by method IsStudyLocked
732 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
734 void SetStudyLock(in string theLockerID) raises(StudyInvalidReference);
736 /*! \brief Indicate if the Study is locked
738 Returns True if the Study was marked locked.
740 boolean IsStudyLocked() raises(StudyInvalidReference);
742 /*! \brief Mark this Study as being unlocked by the given locker.
744 The lock status can be checked by method IsStudyLocked
745 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
747 void UnLockStudy(in string theLockerID) raises(StudyInvalidReference);
749 /*! \brief Get the list of IDs of the Study's lockers.
751 ListOfStrings GetLockerID() raises(StudyInvalidReference);
753 /*! \brief Create real variable with Name theVarName and value theValue
755 (or set if variable value into theValue already exists)
756 \param theVarName is a name of the variable
757 \param theVarName is a value of the variable.
759 void SetReal( in string theVarName, in double theValue ) raises(StudyInvalidReference);
761 /*! \brief Create integer variable with Name theVarName and value theValue
763 (or set if variable value into theValue already exists)
764 \param theVarName is a name of the variable
765 \param theVarName is a value of the variable.
767 void SetInteger( in string theVarName, in long theValue ) raises(StudyInvalidReference);
768 /*! \brief Create boolean variable with Name theVarName and value theValue
770 (or set if variable value into theValue already exists)
771 \param theVarName is a name of the variable
772 \param theVarName is a value of the variable.
774 void SetBoolean( in string theVarName, in boolean theValue ) raises(StudyInvalidReference);
776 /*! \brief Create string variable with Name theVarName and value theValue
778 (or set if variable value into theValue already exists)
779 \param theVarName is a name of the variable
780 \param theVarName is a value of the variable.
782 void SetString( in string theVarName, in string theValue ) raises(StudyInvalidReference);
784 /*! \brief Set current value as double for string variable
786 void SetStringAsDouble( in string theVarName, in double theValue ) raises(StudyInvalidReference);
788 /*! \brief Get value of a real variable
790 \param theVarName is a name of the variable.
792 double GetReal( in string theVarName ) raises(StudyInvalidReference);
794 /*! \brief Get value of an integer variable
796 \param theVarName is a name of the variable.
798 long GetInteger( in string theVarName ) raises(StudyInvalidReference);
800 /*! \brief Get value of a boolean variable
802 \param theVarName is a name of the variable.
804 boolean GetBoolean( in string theVarName ) raises(StudyInvalidReference);
806 /*! \brief Get value of a string variable
808 \param theVarName is a name of the variable.
810 string GetString( in string theVarName ) raises(StudyInvalidReference);
813 /*! \brief Indicate if a variable is real
815 Return true if variable is real otherwise return false.
816 \param theVarName is a name of the variable.
818 boolean IsReal( in string theVarName ) raises(StudyInvalidReference);
820 /*! \brief Indicate if a variable is integer
822 Return true if variable is integer otherwise return false.
823 \param theVarName is a name of the variable.
825 boolean IsInteger( in string theVarName ) raises(StudyInvalidReference);
827 /*! \brief Indicate if a variable is boolean
829 Return true if variable is boolean otherwise return false.
830 \param theVarName is a name of the variable.
832 boolean IsBoolean( in string theVarName ) raises(StudyInvalidReference);
834 /*! \brief Indicate if a variable is string
836 Return true if variable is string otherwise return false.
837 \param theVarName is a name of the variable.
839 boolean IsString( in string theVarName ) raises(StudyInvalidReference);
841 /*! \brief Indicate if a variable exists in the study
843 Return true if variable exists in the study,
844 otherwise return false.
845 \param theVarName is a name of the variable.
847 boolean IsVariable( in string theVarName ) raises(StudyInvalidReference);
849 /*! \brief Get names of all variables from the study.
851 ListOfStrings GetVariableNames() raises(StudyInvalidReference);
853 /*! \brief Remove a variable
855 Remove variable with the specified name from the study with substitution of its value.
857 \param theVarName Name of the variable.
858 \return Status of operation.
860 boolean RemoveVariable( in string theVarName ) raises(StudyInvalidReference);
862 /*! \brief Rename a variable
864 Rename variable with the specified name within the study.
866 \param theVarName Name of the variable.
867 \param theNewVarName New name for the variable.
868 \return Status of operation.
870 boolean RenameVariable( in string theVarName, in string theNewVarName ) raises(StudyInvalidReference);
872 /*! \brief Indicate whether variable is used
874 Check that variable is used in the study.
876 \param theVarName Name of the variable.
877 \return Variable usage.
879 boolean IsVariableUsed( in string theVarName ) raises(StudyInvalidReference);
881 /*! \brief Parse variables used for object creation
883 \param string with variables, separated by special symbol.
884 \return Variables list.
886 ListOfListOfStrings ParseVariables( in string theVars ) raises(StudyInvalidReference);
889 Attach an observer to the Study
891 \param theObserver observer being attached
892 \param modify when \c true, observer receives any object's modification events;
893 otherwise observer receives object's creation events only
895 void attach(in SALOMEDS::Observer theObserver, in boolean modify);
897 Detach an observer from the Study
899 \param theObserver observer to be detached
901 void detach(in SALOMEDS::Observer theObserver);
904 //==========================================================================
905 /*! \brief %SObject interface
907 The objects in the %study are built by the %StudyBuilder. The %SObject interface
908 provides methods for elementary inquiries, like getting an object %ID or its attribuites.
911 <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
912 in the tree-type data structure.
913 <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
914 ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
916 //==========================================================================
918 interface SObject : SALOME::GenericObj
920 /*! Name of the %SObject
922 attribute string Name; // equivalent to setName() & getName()
924 /*! Returns true if the %SObject does not belong to any %Study
928 /*! Gets an object %ID
929 \return ID of the %SObject.
933 /*! Acquisition of the father %Component of the %SObject
934 \return The father %Component of the %SObject.
936 SComponent GetFatherComponent();
938 /*! Acquisition of the father %SObject of the %SObject
939 \return the father %SObject of the given %SObject.
943 /*! Gets the %tag of a %SObject
944 \return the %tag of a %SObject.
948 /*! Returns a tag of the last child %SObject (if any) of this %SObject.
949 Returns zero if this %SObject has no children.
951 short GetLastChildTag();
953 /*! Gets the depth of a %SObject
954 \return the depth of a %SObject.
958 /*! Looks for subobjects of a given %SObject.
959 \param atag Tag of the given %SObject
960 \return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
962 boolean FindSubObject (in long atag, out SObject obj);
964 /*! Looks for attributes of a given %SObject
965 \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
966 \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
968 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
970 boolean FindAttribute(out GenericAttribute anAttribute,
971 in string aTypeOfAttribute);
973 /*! Looks for a %SObject which the given %SObject refers to.
974 \return The object which the given %SObject refers to as well as True if it finds
977 boolean ReferencedObject(out SObject obj); // A REVOIR
979 /*! Gets all attributes of a given %SObject
980 \return The list of all attributes of the given %SObject.
982 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
985 ListOfAttributes GetAllAttributes();
987 /*! Gets the study of a given %SObject.
988 \return The study containing the given %SObject.
992 /*! Gets the CORBA object by its own IOR attribute.
993 Returns nil, if can't.
994 \return The CORBA object of the %SObject.
999 Returns the name attribute value of this SObject.
1000 Returns empty string if there is no name attribute.
1005 Returns the comment attribute value of this SObject.
1006 Returns empty string if there is no comment attribute.
1008 string GetComment();
1011 Returns the IOR attribute value of this SObject.
1012 Returns empty string if there is no IOR attribute.
1017 Set an attribute value (of type string)
1018 \param name the name of the attribute
1019 \param value the value of the attribute
1021 void SetAttrString(in string name, in string value);
1024 Private method, returns an implementation of this SObject.
1025 \param theHostname is a hostname of the caller
1026 \param thePID is a process ID of the caller
1027 \param isLocal is set True if the SObject is launched locally with the caller
1029 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1033 //==========================================================================
1034 /*! \brief %Generic attribute interface
1036 %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
1038 //==========================================================================
1039 interface GenericAttribute : SALOME::GenericObj
1041 /*! \brief Exception locking all changes
1043 This exception locks all modifications in attributes.
1045 exception LockProtection {};
1046 /*! \brief Method CheckLocked
1048 Checks whether the %Study is protected for modifications.
1050 \note <BR>This exception is raised only outside a transaction.
1052 void CheckLocked() raises (LockProtection);
1057 //! Get the class type
1058 string GetClassType();
1061 SObject GetSObject();
1063 //! Private method, returns an implementation of this GenericAttribute.
1065 \param theHostname is a hostname of the caller
1066 \param thePID is a process ID of the caller
1067 \param isLocal is set True if the GenericAttribute is launched locally with the caller
1069 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1074 //==========================================================================
1075 /*! \brief %SComponent interface
1077 The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
1078 The %SComponent interface is a specialization of the %SObject interface.
1079 It inherits the most of its methods from the %SObject interface.
1081 //==========================================================================
1082 interface SComponent : SObject
1084 /*! \brief Gets the data type of the given %SComponent
1086 \return The data type of this %SComponent.
1088 string ComponentDataType();
1089 /*! \brief Gets the IOR of the given component
1091 \return True (if there is an instance of the given component) and its IOR.
1093 boolean ComponentIOR (out ID theID); //returns True if there is an instance
1094 //In this case ID identifies this one
1098 //==========================================================================
1099 /*! \brief %SComponentIterator interface
1101 This interface contains the methods allowing to iterate over all components in the list.
1102 The search is started from the first %SComponent in the list.
1104 //==========================================================================
1105 interface SComponentIterator : SALOME::GenericObj
1108 \brief Activates the %SComponentIterator.
1111 /*! \brief Method More
1113 \return True if there is one more %SComponent in the list.
1117 \brief Moves the iterator to the next %SComponent in the list.
1121 \brief Returns the %SComponent corresponding to the current %SComponent found by the iterator.
1123 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1129 //==========================================================================
1130 /*! \brief %ChildIterator interface
1132 This interface contains methods which allow to iterate over all child
1135 //==========================================================================
1136 interface ChildIterator : SALOME::GenericObj
1140 \brief Activates the %ChildIterator.
1145 \brief Activates the %ChildIterator for all child levels.
1147 \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels.
1149 void InitEx(in boolean allLevels);
1150 /*! \brief Method More
1152 \return True if there is one more %ChildIterator in the list.
1156 \brief Passes the iterator to the next level.
1160 \brief Returns the %SObject corresponding to the current object found by the iterator.
1165 //==========================================================================
1166 //==========================================================================
1167 /*! \brief Interface of the %UseCaseIterator.
1169 This interface contains a set of methods used for iteration over the objects in the use case.
1171 interface UseCaseIterator : SALOME::GenericObj
1174 Activates the %UseCaseIterator.
1175 \param allLevels If the value of this parameter is True the Iterator is activated for all subobjects.
1177 void Init(in boolean allLevels);
1180 \return True if the %UseCaseIterator finds one more object.
1184 Passes the iterator to the next object.
1188 Returns the %SObject corresponding to the current object found by the Iterator.
1193 //==========================================================================
1194 //==========================================================================
1195 /*! \brief Interface of the %UseCaseBuilder
1197 Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
1198 The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
1200 interface UseCaseBuilder : SALOME::GenericObj
1203 Adds to the use case an object as a child of the current object of the use case.
1205 \param theObject The added %SObject.
1206 \return True if this %SObject has been added in the use case.
1208 boolean Append(in SObject theObject);
1210 Removes an object from the use case.
1212 \param theObject The deleted %SObject
1213 \return True if this %SObject has been deleted from the use case.
1215 boolean Remove(in SObject theObject);
1217 Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
1219 boolean AppendTo(in SObject theFather, in SObject theObject);
1221 Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
1223 boolean InsertBefore(in SObject theFirst, in SObject theNext);
1225 Sets the current object of the use case.
1227 boolean SetCurrentObject(in SObject theObject);
1229 Makes the root object to be the current object of the use case.
1231 boolean SetRootCurrent();
1233 Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
1235 boolean HasChildren(in SObject theObject);
1237 Returns True if children of the given object <VAR>theObject</VAR> of the use case tree were sorted successfully.
1239 boolean SortChildren(in SObject theObject, in boolean theAscendingOrder);
1241 Gets father object of the given object <VAR>theObject</VAR> in the use cases tree.
1243 SObject GetFather(in SObject theObject);
1245 Sets the name of the use case.
1247 boolean SetName(in string theName);
1249 Gets the name of the use case.
1253 Returns True if the given object <VAR>theObject</VAR> represents a use case.
1255 boolean IsUseCase(in SObject theObject);
1257 Returns True if the given object <VAR>theObject</VAR> is included in the use cases tree on any level.
1259 boolean IsUseCaseNode(in SObject theObject);
1261 Gets the current object of the use case.
1263 SObject GetCurrentObject();
1265 Creates a new use case in the use case browser.
1267 SObject AddUseCase(in string theName);
1269 Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
1271 UseCaseIterator GetUseCaseIterator(in SObject theObject);
1273 //==========================================================================
1274 /*! \brief %Driver interface
1276 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
1277 can be called by any component and which provide the following functionality:
1279 <li> publishing in the study of the objects created by a definite component
1280 <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.
1281 <li> transforming of the transient references into persistant references (or vice versa) of the SObjects when saving (or loading) a study
1282 <li> copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study
1286 //==========================================================================
1290 /*! \brief Saving the data produced by a definite component.
1292 This method is called when saving a study.
1293 \param theComponent %SComponent corresponding to this Component
1294 \param theURL The path to the file in which the data will be saved.
1295 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1296 \return A byte stream TMPFile that contains all saved data
1298 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1303 TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1305 /*! \brief Saving the data in ASCII format produced by a definite component.
1307 This method is called when saving a study in ASCII format.
1308 \param theComponent %SComponent corresponding to this Component
1309 \param theURL The path to the file in which the data will be saved.
1310 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1311 \return A byte stream TMPFile that will contain all saved data
1313 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1316 TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1318 /*! \brief Loading the data.
1320 This method is called when opening a study.
1321 \param theComponent %SComponent corresponding to this Component
1322 \param theStream The file which contains all data saved by the component on Save method
1323 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1327 boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1329 /*! \brief Loading the data from files in ASCII format.
1331 This method is called when opening a study.
1332 \param theComponent %SComponent corresponding to this Component
1333 \param theStream The file which contains all data saved by the component on Save method
1334 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1338 boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1340 /*! \brief Closing of the study
1342 This method Close is called when closing a study.
1343 \param aSComponent The according %SComponent
1346 void Close (in SComponent aSComponent);
1347 //void Close ( in string aIORSComponent);
1349 /*! Gets the type of the data
1351 \return The type of data produced by the Component in the study.
1354 string ComponentDataType();
1356 // Driver Transient -> persistent called for each object in study
1358 Transforms IOR of a given %SObject into PersistentID. It is called for each
1359 object in the %study.
1360 \note <br> In %SALOME the objects which are present in an active study are identified by an IOR, when this
1361 study is saved these references are transformed into persintent IDs.
1363 \param theSObject The given %SObject.
1364 \param IORString The IOR of the given %SObject.
1365 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1366 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1368 \return The persistent ID of the given %SObject
1371 string IORToLocalPersistentID (in SObject theSObject,
1372 in string IORString,
1373 in boolean isMultiFile,
1374 in boolean isASCII);
1376 Transforms PersistentID into IOR of the object. It is called for each
1377 object in the %study.
1379 \note <br> In %SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this
1380 study is open, these references are transformed into persintent IORs.
1382 \param theSObject The given %SObject.
1383 \param IORString The IOR of the given %SObject.
1384 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1385 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1387 \return The IOR of the given %SObject
1390 string LocalPersistentIDToIOR (in SObject theSObject,
1391 in string aLocalPersistentID,
1392 in boolean isMultiFile,
1394 raises (SALOME::SALOME_Exception);
1396 // Publishing in the study
1397 /*! Publishing in the study
1399 \return True if the given %Component can publish a definite object with a given IOR in the %study.
1400 \param theIOR The IOR of a definite object
1402 boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1403 /*! \brief Publishing in the study
1405 Publishes the given object in the %study, using the algorithm of this component.
1406 \param theSObject If this parameter is null the object is published for the first time. Otherwise
1407 this parameter should contain a reference to the object published earlier
1408 \param theObject The object which is published
1409 \param theName The name of the published object. If this parameter is empty, the name is generated
1410 automatically by the component.
1412 \return The published %SObject.
1414 SObject PublishInStudy(in SObject theSObject, in Object theObject, in string theName);
1416 // copy/paste methods
1419 Returns True, if the given %SObject can be copied to the clipboard.
1421 \param theObject The given %SObject which should be copied.
1423 boolean CanCopy(in SObject theObject);
1425 Returns the object %ID and the %TMPFile of the object from the given %SObject.
1427 TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1429 Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1431 boolean CanPaste(in string theComponentName, in long theObjectID);
1433 Returns the %SObject of the pasted object.
1435 SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);