1 // Copyright (C) 2007-2008 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.
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
22 // File : SALOMEDS.idl
23 // 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.
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 /*! \brief List of the names of studies which are currently open in this %SALOME session.
60 Since %SALOME is a multi-study application, it allows to open a lot of studies
61 during each working session.
63 typedef sequence<string> ListOfOpenStudies;
64 //! List of file names
65 typedef sequence<string> ListOfFileNames;
66 //! List of modification dates of a study
67 typedef sequence<string> ListOfDates ;
68 //! An unbounded sequence of strings
69 typedef sequence<string> ListOfStrings ;
70 //! An unbounded sequence of sequence of strings
71 typedef sequence<ListOfStrings> ListOfListOfStrings ;
72 //! A byte stream which is used for binary data transfer between different components
73 typedef sequence<octet> TMPFile;
75 // Reference to other objects is treated with function AddReference
76 // and ReferencedObject
77 // All other type of attributes defined in AttributeType enum are
78 // treated with AddAdttribute and GetAttribute
79 // The difference is made because Reference attribute don't contain
80 // strings but reference to ID of other objects
82 interface GenericAttribute;
84 interface StudyManager;
85 interface StudyBuilder;
88 interface SComponentIterator;
89 interface ChildIterator;
91 interface AttributeStudyProperties;
92 interface AttributeParameter;
93 interface UseCaseIterator;
94 interface UseCaseBuilder;
96 //! List of attributes of %SObjects
97 typedef sequence<GenericAttribute> ListOfAttributes;
99 //! Exception indicating that this feature hasn't been implemented in %SALOME application.
100 exception NotImplemented {};
103 //===========================================================================
104 /*! \brief %Study Interface
106 The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
107 Most of the %Study operations are handled by the StudyManager and the StudyBuilder.
108 What is left in the %Study interface are elementary inquiries.
109 (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
110 and set methods.) A %Study is explored by a set of tools, mainly iterators
111 , which are described further. Nevertheless, the %Study
112 interface allows the search of an object by name or by ID.
114 <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
115 In general it's a string of names of directories divided by a slash '/'.
116 <BR><VAR>The Context</VAR> is the current directory of an object.</P>
122 //! Invalid study context
123 exception StudyInvalidContext {};
124 //! Invalid study component
125 exception StudyInvalidComponent {};
126 //! Invalid directory of the %study exception
127 exception StudyInvalidDirectory {};
128 //! Exception pointing that this name of the study has already been used.
129 exception StudyNameAlreadyUsed {};
130 //! study object already exists
131 exception StudyObjectAlreadyExists {};
132 //! Invalid name of the %study exception
133 exception StudyNameError {};
134 //! Invalid study comment
135 exception StudyCommentError {};
137 /*! \brief The name of the %Study
139 This is equivalent to the methods setName() & getName()
141 attribute string Name; // equivalent to setName() & getName()
142 /*! \brief The ID of the %Study
144 This is equivalent to the methods setID() & getID()
146 attribute short StudyId;
147 //! Sequence containing %SObjects
148 typedef sequence<SObject> ListOfSObject;
149 //! Get the persistent reference to the %Study.
150 PersistentReference GetPersistentReference();
151 //! Get a transient reference to the %Study.
152 SalomeReference GetTransientReference();
154 /*! \brief indicate whether the %Study is empty
156 \return True if the %Study is empty
159 /*! \brief Find a %SComponent by its name.
161 \param aComponentName It's a string value in the Comment Attribute of the Component,
162 which is looked for, defining the data type of this Component.
164 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
167 SComponent FindComponent (in string aComponentName);
169 /*! \brief Find a %SComponent by ID of the according %SObject
171 SComponent FindComponentID(in ID aComponentID);
172 /*! \brief Find a %SObject by the Name Attribute of this %SObject
174 \param anObjectName String parameter defining the name of the object
175 \return The obtained %SObject
177 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
179 SObject FindObject (in string anObjectName);
180 /*! \brief Find a %SObject by its ID
182 \param aObjectID This parameter defines the ID of the required object
183 \return The obtained %SObject
185 SObject FindObjectID (in ID aObjectID);
186 /*! \brief Create a %SObject by its ID
188 \param aObjectID This parameter defines the ID of the required object
189 \return The created %SObject
191 SObject CreateObjectID (in ID aObjectID);
192 /*! \brief Find a %SObject by IOR of the object belonging to this %SObject.
194 \param anObjectName This parameter defines the IOR of the object
195 \return The obtained %SObject
197 SObject FindObjectIOR (in ID aObjectIOR);
198 /*! \brief Find in the study all %SObjects produced by a given %Component.
200 \param anObjectName The Name Attribute of the searched %SObjects should correspond to <VAR>anObjectName</VAR>.
201 \param aComponentName The name of the component, which objects are searched for.
203 ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName);
204 /*! \brief Find a %SObject by the path to it.
206 \param thePath The path to the required %SObject.
207 \return The obtained %SObject.
209 SObject FindObjectByPath(in string thePath);
210 /*! \brief Get the path to the %SObject.
212 string GetObjectPath(in Object theObject);
214 /*! \brief Set the context of the %Study.
216 \param thePath String parameter defining the context of the study.
218 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
220 void SetContext(in string thePath);
221 /*! \brief Get the context of the %Study.
223 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
226 /*! \brief Get a list of names of objects corresponding to the context.
228 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
230 ListOfStrings GetObjectNames(in string theContext);
231 /*! \brief Get a list of names of directories and subdirectories corresponding to the context.
233 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
235 ListOfStrings GetDirectoryNames(in string theContext);
236 /*! \brief Get a list of names of Files corresponding to the context.
238 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
240 ListOfStrings GetFileNames(in string theContext);
241 /*! \brief Get a list of names of Components corresponding to the context.
243 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
245 ListOfStrings GetComponentNames(in string theContext);
246 /*! \brief Create a new iterator of child levels of the given %SObject.
248 \param aSO The given %SObject
249 \return A new iterator of child levels of the given %SObject.
251 ChildIterator NewChildIterator(in SObject aSO);
253 /*! \brief Create a new iterator of the %SComponents.
255 \return A new iterator of the %SComponents.
257 SComponentIterator NewComponentIterator();
259 /*! \brief Create a new %StudyBuilder to add or modify an object in the study.
261 \return A new %StudyBuilder.
263 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
265 StudyBuilder NewBuilder() ;
266 /*! \brief Labels dependency
268 Updates the map with IOR attribute. It's an inner method used for optimization.
270 void UpdateIORLabelMap(in string anIOR, in string anEntry);
272 /*! \brief Getting properties of the study
274 Returns the attribute, which contains the properties of this study.
276 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
279 AttributeStudyProperties GetProperties();
280 /*! \brief Indicate whether the %study has been saved
282 attribute boolean IsSaved;
283 /*! \brief Indicate whether the %study has been modified and not saved.
285 Returns True if the %study has been modified and not saved.
287 boolean IsModified();
289 /*! \brief Mark the %study as being modified and not saved.
293 /*! \brief Indicate the file where the %study has been saved
295 attribute string URL;
297 /*! \brief List of %SObjects
299 Returns the list of %SObjects which refers to %anObject.
301 ListOfSObject FindDependances(in SObject anObject);
303 /*! \brief The date of the last saving of the study
305 Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
307 string GetLastModificationDate();
308 /*! \brief The list of modification dates of the study
310 Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
311 Note : the first modification begins the list.
313 ListOfDates GetModificationsDate();
314 /*! \brief Object conversion.
316 Converts an object into IOR.
319 string ConvertObjectToIOR(in Object theObject);
320 /*! \brief Object conversion.
322 Converts IOR into an object.
325 Object ConvertIORToObject(in string theIOR);
326 /*! \brief Get a new %UseCaseBuilder.
328 UseCaseBuilder GetUseCaseBuilder();
330 /*! \brief Close the components in the study, remove itself from the %StudyManager.
334 /*! \brief Enable (if isEnabled = True)/disable automatic addition of new %SObjects to the use case.
336 void EnableUseCaseAutoFilling(in boolean isEnabled);
339 Functions for internal usage only
341 void AddPostponed(in string theIOR);
343 void AddCreatedPostponed(in string theIOR);
345 void RemovePostponed(in long theUndoLimit);
347 void UndoPostponed(in long theWay);
349 boolean DumpStudy(in string thePath, in string theBaseName, in boolean isPublished);
351 /*! \brief Get an AttributeParameter used to store common parameters for given %theSavePoint.
353 \param theID identifies a common parameters set (Example: "Interface Applicative")
354 \param theSavePoint is number of a set of parameters as there can be several sets
356 AttributeParameter GetCommonParameters(in string theID, in long theSavePoint);
358 /*! \brief Get an AttributeParameter used to store parameters for given %theModuleName.
360 \param theID identifies a common parameters set (Example: "Interface Applicative")
361 \param theModuleName is a name of the module (Example: "Geometry")
362 \param theSavePoint is number of a set of parameters as there can be several sets
364 AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint);
367 /*! \brief Get a default Python script to restore visual parameters for given %theModuleName.
369 \param theID identifies a common parameters set (Example: "Interface Applicative")
370 \param theModuleName is a name of the module (Example: "Geometry")
372 string GetDefaultScript(in string theID, in string theModuleName);
375 Private method, returns an implementation of this Study.
376 \param theHostname is a hostname of the caller
377 \param thePID is a process ID of the caller
378 \param isLocal is set True if the Study is launched locally with the caller
380 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
383 /*! \brief Mark this Study as being locked by the given locker.
385 The lock status can be checked by method IsStudyLocked
386 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
388 void SetStudyLock(in string theLockerID);
390 /*! \brief Indicate if the Study is locked
392 Returns True if the Study was marked locked.
394 boolean IsStudyLocked();
396 /*! \brief Mark this Study as being unlocked by the given locker.
398 The lock status can be checked by method IsStudyLocked
399 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
401 void UnLockStudy(in string theLockerID);
403 /*! \brief Get the list of IDs of the Study's lockers.
405 ListOfStrings GetLockerID();
407 /*! \brief Create real variable with Name theVarName and value theValue
409 (or set if variable value into theValue already exists)
410 \param theVarName is a name of the variable
411 \param theVarName is a value of the variable.
413 void SetReal( in string theVarName, in double theValue );
415 /*! \brief Create integer variable with Name theVarName and value theValue
417 (or set if variable value into theValue already exists)
418 \param theVarName is a name of the variable
419 \param theVarName is a value of the variable.
421 void SetInteger( in string theVarName, in long theValue );
422 /*! \brief Create boolean variable with Name theVarName and value theValue
424 (or set if variable value into theValue already exists)
425 \param theVarName is a name of the variable
426 \param theVarName is a value of the variable.
428 void SetBoolean( in string theVarName, in boolean theValue );
430 /*! \brief Get value of a real variable
432 \param theVarName is a name of the variable.
434 double GetReal( in string theVarName );
436 /*! \brief Get value of an integer variable
438 \param theVarName is a name of the variable.
440 long GetInteger( in string theVarName );
442 /*! \brief Get value of a boolean variable
444 \param theVarName is a name of the variable.
446 boolean GetBoolean( in string theVarName );
449 /*! \brief Indicate if a variable is real
451 Return true if variable is real otherwise return false.
452 \param theVarName is a name of the variable.
454 boolean IsReal( in string theVarName );
456 /*! \brief Indicate if a variable is integer
458 Return true if variable is integer otherwise return false.
459 \param theVarName is a name of the variable.
461 boolean IsInteger( in string theVarName );
463 /*! \brief Indicate if a variable is boolean
465 Return true if variable is boolean otherwise return false.
466 \param theVarName is a name of the variable.
468 boolean IsBoolean( in string theVarName );
470 /*! \brief Indicate if a variable exists in the study
472 Return true if variable exists in the study,
473 otherwise return false.
474 \param theVarName is a name of the variable.
476 boolean IsVariable( in string theVarName );
478 /*! \brief Get names of all variables from the study.
480 ListOfStrings GetVariableNames();
482 /*! \brief Remove a variable
484 Remove variable with the specified name from the study with substitution of its value.
486 \param theVarName Name of the variable.
487 \return Status of operation.
489 boolean RemoveVariable( in string theVarName );
491 /*! \brief Rename a variable
493 Rename variable with the specified name within the study.
495 \param theVarName Name of the variable.
496 \param theNewVarName New name for the variable.
497 \return Status of operation.
499 boolean RenameVariable( in string theVarName, in string theNewVarName );
501 /*! \brief Indicate whether variable is used
503 Check that variable is used in the study.
505 \param theVarName Name of the variable.
506 \return Variable usage.
508 boolean IsVariableUsed( in string theVarName );
510 /*! \brief Parse variables used for object creation
512 \param string with variables, separated by special symbol.
513 \return Variables list.
515 ListOfListOfStrings ParseVariables( in string theVars );
519 //==========================================================================
520 /*! \brief %Study Builder Interface
522 The purpose of the Builder is to add and/or remove objects and attributes.
523 A %StudyBuilder is linked to a %Study. A
524 command management is provided for the undo/redo functionalities.
526 <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
527 item's position in the tree-type structure of the browser. In general it has the following
528 form: <TT>0:2:1:1</TT>
530 //==========================================================================
532 interface StudyBuilder
534 /*! \brief %LockProtection Exception
536 This exception is raised while attempting to modify a locked %study.
538 exception LockProtection {};
539 /*! \brief Creation of a new %SComponent.
541 Creates a new %SComponent
542 \param ComponentDataType Data type of the %SComponent which will be created.
544 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
547 SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
548 /*! \brief Definition of the instance to the %SComponent
550 Defines the instance to the %SComponent.
552 void DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
554 /*! \brief Deletion of a %SComponent
556 Removes a %SComponent.
558 void RemoveComponent(in SComponent aComponent) raises(LockProtection);
560 /*! \brief Creation of a new %SObject
562 Creates a new %SObject under a definite father %SObject.
564 \param theFatherObject The father %SObject under which this one should be created.
567 <em>See \ref example18 for an example of this method usage in batchmode of %SALOME application.</em>
571 SObject NewObject (in SObject theFatherObject) raises(LockProtection);
573 /*! \brief Creation of a new %SObject with a definite %tag
575 Creates a new %SObject with a definite %tag.
577 \param atag Long value corresponding to the tag of the new %SObject.
581 SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
582 /*! \brief Deletion of the %SObject
584 Removes a %SObject from the %StudyBuilder.
586 \param anObject The %SObject to be deleted.
588 void RemoveObject (in SObject anObject) raises(LockProtection);
589 /*! \brief Deletion of the %SObject with all his child objects.
591 Removes the %SObject with all his child objects.
593 \param anObject The %SObject to be deleted with all child objects.
595 void RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
600 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
603 void LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
607 \param sco %SObject to be loaded.
609 void Load (in SObject sco);
611 /*! \brief Looking for or creating an attribute assigned to the %SObject
613 Allows to find or create an attribute of a specific type which is assigned to the object.
614 \param anObject The %SObject corresponding to the attribute which is looked for.
615 \param aTypeOfAttribute Type of the attribute.
617 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
620 GenericAttribute FindOrCreateAttribute(in SObject anObject,
621 in string aTypeOfAttribute) raises(LockProtection);
623 /*! \brief Looking for an attribute assigned to a %SObject
625 Allows to find an attribute of a specific type which is assigned to the object.
626 \param anObject The %SObject corresponding to the attribute which is looked for.
627 \param aTypeOfAttribute Type of the attribute.
628 \param anAttribute Where the attribute is placed if it's found.
629 \return True if it finds an attribute.
632 boolean FindAttribute(in SObject anObject,
633 out GenericAttribute anAttribute,
634 in string aTypeOfAttribute);
635 /*! \brief Deleting the attribute assigned to the %SObject
637 Removes the attribute of a specific type which is assigned to the object.
638 \param anObject The %SObject corresponding to the attribute.
639 \param aTypeOfAttribute Type of the attribute.
641 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
643 void RemoveAttribute(in SObject anObject,
644 in string aTypeOfAttribute) raises(LockProtection);
646 Adds a reference between %anObject and %theReferencedObject.
647 \param anObject The %SObject which will get a reference
648 \param theReferencedObject The %SObject having a reference
651 void Addreference(in SObject anObject,
652 in SObject theReferencedObject) ;
655 Removes a reference from %anObject to another object.
656 \param anObject The %SObject which contains a reference
659 void RemoveReference(in SObject anObject) ;
662 Adds a directory in the %Study.
663 \param theName String parameter defining the name of the directory.
665 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
668 void AddDirectory(in string theName) raises(LockProtection);
670 /*! \brief Identification of the %SObject's substructure.
672 Identification of the %SObject's substructure by GUID.
675 \param anObject The %SObject which will be identified
676 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
679 void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
681 Searches for a definite %SObject with a definite GUID and returns True if it finds it.
683 \param anObject A definite %SObject which will be identified
684 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
686 boolean IsGUID(in SObject anObject, in string theGUID);
688 /*! \brief Creation of a new command
690 Creates a new command which can contain several different actions.
692 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
695 void NewCommand(); // command management
696 /*! \brief Execution of the command
698 Commits all actions declared within this command.
700 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
702 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
705 void CommitCommand() raises(LockProtection); // command management
707 Returns True if at this moment there is a command under execution.
709 boolean HasOpenCommand();
710 /*! \brief Cancelation of the command
712 Cancels all actions declared within the command.
714 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
716 void AbortCommand(); // command management
719 The number of actions which can be undone
721 attribute long UndoLimit;
722 /*! \brief Undo method
724 Cancels all actions of the last command.
726 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
728 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
731 void Undo() raises (LockProtection);
732 /*! \brief Redo method
734 Redoes all actions of the last command.
736 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
738 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
741 void Redo() raises (LockProtection);
743 Returns True if at this moment there are any actions which can be canceled.
745 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
748 boolean GetAvailableUndos();
750 Returns True if at this moment there are any actions which can be redone.
752 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
755 boolean GetAvailableRedos();
757 Puts name attribute with the given string value to the given %SObject
759 \param theSO Existing SObject to set name attribute.
760 \param theValue The value to be set to the name attribute.
762 void SetName(in SObject theSO, in string theValue) raises (LockProtection);
765 Puts comment attribute with the given string value to the given %SObject
767 \param theSO Existing SObject to set comment attribute.
768 \param theValue The value to be set to the comment attribute.
770 void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
773 Puts IOR attribute with the given string value to the given %SObject
775 \param theSO Existing SObject to set IOR attribute.
776 \param theValue The value to be set to the IOR attribute.
778 void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
781 //==========================================================================
782 /*! \brief %Study Manager interface
784 The purpose of the Manager is to manipulate the %Studies. You will find in this
785 interface the methods to create, open,
786 close, and save a %Study. Since a %SALOME session is multi-document, you will
787 also find the methods allowing to navigate
788 through the collection of studies present in a session.
790 //==========================================================================
792 interface StudyManager
795 Determines whether the server has already been loaded or not.
802 Returns the PID of the server
807 Shutdown the StudyManager process.
809 oneway void ShutdownWithExit();
811 /*! \brief Creation of a new study
813 Creates a new study with a definite name.
815 \param study_name String parameter defining the name of the study
817 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
820 Study NewStudy(in string study_name);
822 /*! \brief Open a study
824 Reads and activates the structure of the study %Objects.
825 \param aStudyUrl The path to the study
826 \warning This method doesn't activate the corba objects. Only a component can do it.
828 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
830 Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
832 /*! \brief Closing the study
836 void Close(in Study aStudy);
837 /*! \brief Saving the study in a HDF file (or files).
841 \param theMultiFile If this parameter is True the study will be saved in several files.
843 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
846 boolean Save(in Study aStudy, in boolean theMultiFile);
847 /*! \brief Saving a study in a ASCII file (or files).
849 Saves a study in an ASCII format file (or files).
850 \param theMultiFile If this parameter is True the study will be saved in several files.
852 boolean SaveASCII(in Study aStudy, in boolean theMultiFile);
853 /*! \brief Saving the study in a specified HDF file (or files).
855 Saves the study in a specified file (or files).
856 \param aUrl The path to the definite file in whcih the study will be saved
857 \param aStudy The study which will be saved
858 \param theMultiFile If this parameter is True the study will be saved in several files.
860 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
862 boolean SaveAs(in URL aUrl, // if the file already exists
864 in boolean theMultiFile); // overwrite (as option)
865 /*! \brief Saving the study in a specified ASCII file (or files).
867 Saves the study in a specified ASCII file (or files).
869 \param aUrl The path to the definite file in whcih the study will be saved
870 \param aStudy The study which will be saved
871 \param theMultiFile If this parameter is True the study will be saved in several files.
873 boolean SaveAsASCII(in URL aUrl, // if the file already exists
875 in boolean theMultiFile); // overwrite (as option)
878 /*! \brief List of open studies.
880 Gets the list of open studies
882 \return A list of open studies in the current session.
884 ListOfOpenStudies GetOpenStudies();
886 /*! \brief Getting a particular %Study picked by name
888 Activates a particular %Study
889 among the session collection picking it by name.
890 \param aStudyName The name of the study
892 Study GetStudyByName (in string aStudyName);
894 /*! \brief Getting a particular %Study picked by ID
896 Activates a particular %Study
897 among the session collection picking it by ID.
898 \param aStudyID The ID of the study
900 Study GetStudyByID (in short aStudyID);
902 // copy/paste methods
905 Returns True, if the given %SObject can be copied to the clipboard.
907 boolean CanCopy(in SObject theObject);
909 Returns True, if the given %SObject is copied to the clipboard.
910 \param theObject The %SObject which will be copied
912 boolean Copy(in SObject theObject);
914 Returns True, if the object from the clipboard can be pasted to the given %SObject.
915 \param theObject The %SObject stored in the clipboard.
917 boolean CanPaste(in SObject theObject);
919 Returns the %SObject in which the object from the clipboard was pasted to.
920 \param theObject The %SObject which will be pasted
921 \exception SALOMEDS::StudyBuilder::LockProtection This exception is raised, when trying to paste
922 an object into a study, which is protected for modifications.
924 SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
926 /*! \brief Object conversion.
928 Converts an object into IOR.
931 string ConvertObjectToIOR(in Object theObject);
932 /*! \brief Object conversion.
934 Converts IOR into an object.
937 Object ConvertIORToObject(in string theIOR);
940 Private method, returns an implementation of this StudyManager.
941 \param theHostname is a hostname of the caller
942 \param thePID is a process ID of the caller
943 \param isLocal is set True if the StudyManager is launched locally with the caller
945 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
951 //==========================================================================
952 /*! \brief %SObject interface
954 The objects in the %study are built by the %StudyBuilder. The %SObject interface
955 provides methods for elementary inquiries, like getting an object %ID or its attribuites.
958 <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
959 in the tree-type data structure.
960 <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
961 ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
963 //==========================================================================
965 interface SObject : SALOME::GenericObj
967 /*! Name of the %SObject
969 attribute string Name; // equivalent to setName() & getName()
970 /*! Gets an object %ID
972 \return ID of the %SObject.
975 /*! Acquisition of the father %Component of the %SObject
977 \return The father %Component of the %SObject.
979 SComponent GetFatherComponent();
980 /*! Acquisition of the father %SObject of the %SObject
982 \return the father %SObject of the given %SObject.
985 /*! Gets the %tag of a %SObject
987 \return the %tag of a %SObject.
990 /*! Gets the depth of a %SObject
992 \return the depth of a %SObject.
995 /*! Looks for subobjects of a given %SObject.
997 \param atag Tag of the given %SObject
998 \return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
1001 boolean FindSubObject (in long atag, out SObject obj);
1002 /*! Looks for attributes of a given %SObject
1004 \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
1005 \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
1007 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1009 boolean FindAttribute(out GenericAttribute anAttribute,
1010 in string aTypeOfAttribute);
1011 /*! Looks for a %SObject which the given %SObject refers to.
1013 \return The object which the given %SObject refers to as well as True if it finds
1016 boolean ReferencedObject(out SObject obj); // A REVOIR
1017 /*! Gets all attributes of a given %SObject
1019 \return The list of all attributes of the given %SObject.
1021 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
1024 ListOfAttributes GetAllAttributes();
1025 /*! Gets the study of a given %SObject.
1027 \return The study containing the given %SObject.
1031 /*! Gets the CORBA object by its own IOR attribute.
1032 Returns nil, if can't.
1034 \return The CORBA object of the %SObject.
1039 Returns the name attribute value of this SObject.
1040 Returns empty string if there is no name attribute.
1045 Returns the comment attribute value of this SObject.
1046 Returns empty string if there is no comment attribute.
1048 string GetComment();
1051 Returns the IOR attribute value of this SObject.
1052 Returns empty string if there is no IOR attribute.
1057 Private method, returns an implementation of this SObject.
1058 \param theHostname is a hostname of the caller
1059 \param thePID is a process ID of the caller
1060 \param isLocal is set True if the SObject is launched locally with the caller
1062 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1066 //==========================================================================
1067 /*! \brief %Generic attribute interface
1069 %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
1071 //==========================================================================
1072 interface GenericAttribute : SALOME::GenericObj
1074 /*! \brief Exception locking all changes
1076 This exception locks all modifications in attributes.
1078 exception LockProtection {};
1079 /*! \brief Method CheckLocked
1081 Checks whether the %Study is protected for modifications.
1083 \note <BR>This exception is raised only outside a transaction.
1085 void CheckLocked() raises (LockProtection);
1090 //! Get the class type
1091 string GetClassType();
1094 SObject GetSObject();
1096 //! Private method, returns an implementation of this GenericAttribute.
1098 \param theHostname is a hostname of the caller
1099 \param thePID is a process ID of the caller
1100 \param isLocal is set True if the GenericAttribute is launched locally with the caller
1102 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1107 //==========================================================================
1108 /*! \brief %SComponent interface
1110 The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
1111 The %SComponent interface is a specialization of the %SObject interface.
1112 It inherits the most of its methods from the %SObject interface.
1114 //==========================================================================
1115 interface SComponent : SObject
1117 /*! \brief Gets the data type of the given %SComponent
1119 \return The data type of this %SComponent.
1121 string ComponentDataType();
1122 /*! \brief Gets the IOR of the given component
1124 \return True (if there is an instance of the given component) and its IOR.
1126 boolean ComponentIOR (out ID theID); //returns True if there is an instance
1127 //In this case ID identifies this one
1131 //==========================================================================
1132 /*! \brief %SComponentIterator interface
1134 This interface contains the methods allowing to iterate over all components in the list.
1135 The search is started from the first %SComponent in the list.
1137 //==========================================================================
1138 interface SComponentIterator : SALOME::GenericObj
1141 \brief Activates the %SComponentIterator.
1144 /*! \brief Method More
1146 \return True if there is one more %SComponent in the list.
1150 \brief Moves the iterator to the next %SComponent in the list.
1154 \brief Returns the %SComponent corresponding to the current %SComponent found by the iterator.
1156 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1162 //==========================================================================
1163 /*! \brief %ChildIterator interface
1165 This interface contains methods which allow to iterate over all child
1168 //==========================================================================
1169 interface ChildIterator : SALOME::GenericObj
1173 \brief Activates the %ChildIterator.
1178 \brief Activates the %ChildIterator for all child levels.
1180 \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels.
1182 void InitEx(in boolean allLevels);
1183 /*! \brief Method More
1185 \return True if there is one more %ChildIterator in the list.
1189 \brief Passes the iterator to the next level.
1193 \brief Returns the %SObject corresponding to the current object found by the iterator.
1198 //==========================================================================
1199 //==========================================================================
1200 /*! \brief Interface of the %UseCaseIterator.
1202 This interface contains a set of methods used for iteration over the objects in the use case.
1204 interface UseCaseIterator : SALOME::GenericObj
1207 Activates the %UseCaseIterator.
1208 \param allLevels If the value of this parameter is True the Iterator is activated for all subobjects.
1210 void Init(in boolean allLevels);
1213 \return True if the %UseCaseIterator finds one more object.
1217 Passes the iterator to the next object.
1221 Returns the %SObject corresponding to the current object found by the Iterator.
1226 //==========================================================================
1227 //==========================================================================
1228 /*! \brief Interface of the %UseCaseBuilder
1230 Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
1231 The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
1233 interface UseCaseBuilder : SALOME::GenericObj
1236 Adds to the use case an object as a child of the current object of the use case.
1238 \param theObject The added %SObject.
1239 \return True if this %SObject has been added in the use case.
1241 boolean Append(in SObject theObject);
1243 Removes an object from the use case.
1245 \param theObject The deleted %SObject
1246 \return True if this %SObject has been deleted from the use case.
1248 boolean Remove(in SObject theObject);
1250 Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
1252 boolean AppendTo(in SObject theFather, in SObject theObject);
1254 Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
1256 boolean InsertBefore(in SObject theFirst, in SObject theNext);
1258 Sets the current object of the use case.
1260 boolean SetCurrentObject(in SObject theObject);
1262 Makes the root object to be the current object of the use case.
1264 boolean SetRootCurrent();
1266 Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
1268 boolean HasChildren(in SObject theObject);
1270 Sets the name of the use case.
1272 boolean SetName(in string theName);
1274 Gets the name of the use case.
1278 Returns True if the given object <VAR>theObject</VAR> represents a use case.
1280 boolean IsUseCase(in SObject theObject);
1282 Gets the current object of the use case.
1284 SObject GetCurrentObject();
1286 Creates a new use case in the use case browser.
1288 SObject AddUseCase(in string theName);
1290 Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
1292 UseCaseIterator GetUseCaseIterator(in SObject theObject);
1294 //==========================================================================
1295 /*! \brief %Driver interface
1297 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
1298 can be called by any component and which provide the following functionality:
1300 <li> publishing in the study of the objects created by a definite component
1301 <li> saving/loading of the data created by a definite component. These methods are called by the StudyManager when loading/saving a study containing the data created by a definite component.
1302 <li> transforming of the transient references into persistant references (or vice versa) of the SObjects when saving (or loading) a study
1303 <li> copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study
1307 //==========================================================================
1311 /*! \brief Saving the data produced by a definite component.
1313 This method is called by the StudyManager when saving a study.
1314 \param theComponent %SComponent corresponding to this Component
1315 \param theURL The path to the file in which the data will be saved.
1316 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1317 \return A byte stream TMPFile that contains all saved data
1319 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1324 TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1326 /*! \brief Saving the data in ASCII format produced by a definite component.
1328 This method is called by the StudyManager when saving a study in ASCII format.
1329 \param theComponent %SComponent corresponding to this Component
1330 \param theURL The path to the file in which the data will be saved.
1331 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1332 \return A byte stream TMPFile that will contain all saved data
1334 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1337 TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1339 /*! \brief Loading the data.
1341 This method is called by the StudyManager when opening a study.
1342 \param theComponent %SComponent corresponding to this Component
1343 \param theStream The file which contains all data saved by the component on Save method
1344 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1348 boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1350 /*! \brief Loading the data from files in ASCII format.
1352 This method is called by the StudyManager when opening a study.
1353 \param theComponent %SComponent corresponding to this Component
1354 \param theStream The file which contains all data saved by the component on Save method
1355 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1359 boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1361 /*! \brief Closing of the study
1363 This method Close is called by the StudyManager when closing a study.
1364 \param aSComponent The according %SComponent
1367 void Close (in SComponent aSComponent);
1368 //void Close ( in string aIORSComponent);
1370 /*! Gets the type of the data
1372 \return The type of data produced by the Component in the study.
1375 string ComponentDataType();
1377 // Driver Transient -> persistent called for each object in study
1379 Transforms IOR of a given %SObject into PersistentID. It is called for each
1380 object in the %study.
1381 \note <br> In %SALOME the objects which are present in an active study are identified by an IOR, when this
1382 study is saved these references are transformed into persintent IDs.
1384 \param theSObject The given %SObject.
1385 \param IORString The IOR of the given %SObject.
1386 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1387 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1389 \return The persistent ID of the given %SObject
1392 string IORToLocalPersistentID (in SObject theSObject,
1393 in string IORString,
1394 in boolean isMultiFile,
1395 in boolean isASCII);
1397 Transforms PersistentID into IOR of the object. It is called for each
1398 object in the %study.
1400 \note <br> In %SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this
1401 study is open, these references are transformed into persintent IORs.
1403 \param theSObject The given %SObject.
1404 \param IORString The IOR of the given %SObject.
1405 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1406 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1408 \return The IOR of the given %SObject
1411 string LocalPersistentIDToIOR (in SObject theSObject,
1412 in string aLocalPersistentID,
1413 in boolean isMultiFile,
1415 raises (SALOME::SALOME_Exception);
1417 // Publishing in the study
1418 /*! Publishing in the study
1420 \return True if the given %Component can publish a definite object with a given IOR in the %study.
1421 \param theIOR The IOR of a definite object
1423 boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1424 /*! \brief Publishing in the study
1426 Publishes the given object in the %study, using the algorithm of this component.
1427 \param theStudy The %study in which the object is published
1428 \param theSObject If this parameter is null the object is published for the first time. Otherwise
1429 this parameter should contain a reference to the object published earlier
1430 \param theObject The object which is published
1431 \param theName The name of the published object. If this parameter is empty, the name is generated
1432 automatically by the component.
1434 \return The published %SObject.
1436 SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
1438 // copy/paste methods
1441 Returns True, if the given %SObject can be copied to the clipboard.
1443 \param theObject The given %SObject which should be copied.
1445 boolean CanCopy(in SObject theObject);
1447 Returns the object %ID and the %TMPFile of the object from the given %SObject.
1449 TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1451 Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1453 boolean CanPaste(in string theComponentName, in long theObjectID);
1455 Returns the %SObject of the pasted object.
1457 SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);