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
27 \file SALOMEDS.idl This file contains a set of interfaces used for creation, managment
28 and modification of the %Study
31 #ifndef _SALOMEDS_IDL_
32 #define _SALOMEDS_IDL_
34 #include "SALOME_Exception.idl"
35 #include "SALOME_GenericObj.idl"
38 This package contains the interfaces used for creation, managment
39 and modification of the %Study
44 Name of the file in which the %Study is saved.
49 /*! Main identifier of an object in %SALOME application
53 /*! While saving the data, IOR is transformed into persistent reference
55 typedef string PersistentReference;
57 /*! IOR of the study in %SALOME application
59 typedef string SalomeReference;
61 /*! List of the names of studies which are currently open in this %SALOME session.
62 Since %SALOME is a multi-study application, it allows to open a lot of studies
63 during each working session.
65 typedef sequence<string> ListOfOpenStudies;
66 /*! List of file names
68 typedef sequence<string> ListOfFileNames;
69 /*! List of modification dates of a study
71 typedef sequence<string> ListOfDates ;
72 /*! An unbounded sequence of strings
74 typedef sequence<string> ListOfStrings ;
75 /*! An unbounded sequence of sequence of strings
77 typedef sequence<ListOfStrings> ListOfListOfStrings ;
78 /*! A byte stream which is used for binary data transfer between different components
80 typedef sequence<octet> TMPFile;
82 // Reference to other objects is treated with function AddReference
83 // and ReferencedObject
84 // All other type of attributes defined in AttributeType enum are
85 // treated with AddAdttribute and GetAttribute
86 // The difference is made because Reference attribute don't contain
87 // strings but reference to ID of other objects
89 interface GenericAttribute;
91 interface StudyManager;
92 interface StudyBuilder;
95 interface SComponentIterator;
96 interface ChildIterator;
98 interface AttributeStudyProperties;
99 interface AttributeParameter;
100 interface UseCaseIterator;
101 interface UseCaseBuilder;
103 /*! List of attributes of %SObjects
105 typedef sequence<GenericAttribute> ListOfAttributes;
107 /*! Exception indicating that this feature hasn't been implemented in %SALOME PRO application.
109 exception NotImplemented {};
112 //===========================================================================
113 /*! \brief %Study Interface
115 The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
116 Most of the %Study operations are handled by the StudyManager and the StudyBuilder.
117 What is left in the %Study interface are elementary inquiries.
118 (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
119 and set methods.) A %Study is explored by a set of tools, mainly iterators
120 , which are described further. Nevertheless, the %Study
121 interface allows the search of an object by name or by ID.
123 <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
124 In general it's a string of names of directories divided by a slash '/'.
125 <BR><VAR>The Context</VAR> is the current directory of an object.</P>
131 exception StudyInvalidContext {};
132 exception StudyInvalidComponent {};
133 /*! Invalid directory of the %study exception
135 exception StudyInvalidDirectory {};
136 /*! Exception pointing that this name of the study has already been used.
138 exception StudyNameAlreadyUsed {};
139 exception StudyObjectAlreadyExists {};
140 /*! Invalid name of the %study exception
142 exception StudyNameError {};
143 exception StudyCommentError {};
144 /*! \brief The name of the %Study
146 This is equivalent to the methods setName() & getName()
148 attribute string Name; // equivalent to setName() & getName()
149 /*! \brief The ID of the %Study
151 This is equivalent to the methods setID() & getID()
153 attribute short StudyId;
154 /*! Sequence containing %SObjects
156 typedef sequence<SObject> ListOfSObject;
158 Gets the persistent reference to the %Study.
160 PersistentReference GetPersistentReference();
162 Gets a transient reference to the %Study.
164 SalomeReference GetTransientReference();
167 Returns True if the %Study is empty
171 Allows to find a %SComponent by its name.
172 \param aComponentName It's a string value in the Comment Attribute of the Component,
173 which is looked for, defining the data type of this Component.
175 <BR><VAR>See also <A href="exemple/Example1.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
177 SComponent FindComponent (in string aComponentName);
179 Allows to find a %SComponent by ID of the according %SObject
181 SComponent FindComponentID(in ID aComponentID);
183 Allows to find a %SObject by the Name Attribute of this %SObject
185 \param anObjectName String parameter defining the name of the object
186 \return The obtained %SObject
188 <BR><VAR>See also <A href="exemple/Example19.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
191 SObject FindObject (in string anObjectName);
193 Allows to find a %SObject by its ID
194 \param aObjectID This parameter defines the ID of the required object
195 \return The obtained %SObject
198 SObject FindObjectID (in ID aObjectID);
200 Allows to create a %SObject by its ID
201 \param aObjectID This parameter defines the ID of the required object
202 \return The created %SObject
205 SObject CreateObjectID (in ID aObjectID);
207 Allows to find a %SObject by IOR of the object belonging to this %SObject.
208 \param anObjectName This parameter defines the IOR of the object
209 \return The obtained %SObject
212 SObject FindObjectIOR (in ID aObjectIOR);
214 Finds in the study all %SObjects produced by a given %Component.
215 \param anObjectName The Name Attribute of the searched %SObjects should correspond to <VAR>anObjectName</VAR>.
216 \param aComponentName The name of the component, which objects are searched for.
218 ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName);
220 Allows to find a %SObject by the path to it.
222 \param thePath The path to the required %SObject.
223 \return The obtained %SObject.
226 SObject FindObjectByPath(in string thePath);
228 Returns the path to the %SObject.
230 string GetObjectPath(in Object theObject);
233 Sets the context of the %Study.
234 \param thePath String parameter defining the context of the study.
236 <BR><VAR>See also <A href="exemple/Example23.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
239 void SetContext(in string thePath);
241 Gets the context of the %Study.
243 <BR><VAR>See also <A href="exemple/Example23.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
248 Returns a list of names of objects corresponding to the context.
249 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
251 ListOfStrings GetObjectNames(in string theContext);
253 Returns a list of names of directories and subdirectories corresponding to the context.
254 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
256 ListOfStrings GetDirectoryNames(in string theContext);
258 Returns a list of names of Files corresponding to the context.
259 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
261 ListOfStrings GetFileNames(in string theContext);
263 Returns a list of names of Components corresponding to the context.
264 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
266 ListOfStrings GetComponentNames(in string theContext);
268 Creates a new iterator of child levels of the given %SObject.
269 \param aSO The given %SObject
270 \return A new iterator of child levels of the given %SObject.
272 ChildIterator NewChildIterator(in SObject aSO);
275 Creates a new iterator of the %SComponents.
277 \return A new iterator of the %SComponents.
279 SComponentIterator NewComponentIterator();
281 Creates a new %StudyBuilder to add or modify an object in the study.
283 \return A new %StudyBuilder.
285 <BR><VAR>See also <A href="exemple/Example20.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
288 StudyBuilder NewBuilder() ;
289 /*! \brief Labels dependency
291 Updates the map with IOR attribute. It's an inner method used for optimization.
293 void UpdateIORLabelMap(in string anIOR, in string anEntry);
295 /*! \brief Getting properties of the study
297 Returns the attriubte, which contains the properties of this study.
299 <BR><VAR>See also <A href="exemple/Example20.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
302 AttributeStudyProperties GetProperties();
304 Determines whether the %study has been saved
306 attribute boolean IsSaved;
308 Returns True if the %study has been modified and not saved.
310 boolean IsModified();
313 Marks the %study as being modified and not saved.
318 Determines the file where the %study has been saved
320 attribute string URL;
322 /*! \brief List of %SObjects
324 Returns the list of %SObjects which refers to %anObject.
326 ListOfSObject FindDependances(in SObject anObject);
328 /*! \brief The date of the last saving of the study
330 Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
332 string GetLastModificationDate();
333 /*! \brief The list of modification dates of the study
335 Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
336 Note : the first modification begins the list.
338 ListOfDates GetModificationsDate();
339 /*! \brief Object conversion.
341 Converts an object into IOR.
344 string ConvertObjectToIOR(in Object theObject);
345 /*! \brief Object conversion.
347 Converts IOR into an object.
350 Object ConvertIORToObject(in string theIOR);
352 Gets a new %UseCaseBuilder.
354 UseCaseBuilder GetUseCaseBuilder();
357 Closes the components in the study, removes itself from the %StudyManager.
362 Enables(if isEnabled = True)/disables automatic addition of new %SObjects to the use case.
364 void EnableUseCaseAutoFilling(in boolean isEnabled);
367 Functions for internal usage only
369 void AddPostponed(in string theIOR);
371 void AddCreatedPostponed(in string theIOR);
373 void RemovePostponed(in long theUndoLimit);
375 void UndoPostponed(in long theWay);
377 boolean DumpStudy(in string thePath, in string theBaseName, in boolean isPublished);
380 Returns an AttributeParameter used to store common parameters for given %theSavePoint.
381 \param theID identifies a common parameters set (Example: "Interface Applicative")
382 \param theSavePoint is number of a set of parameters as there can be several sets
384 AttributeParameter GetCommonParameters(in string theID, in long theSavePoint);
387 Returns an AttributeParameter used to store parameters for given %theModuleName.
388 \param theID identifies a common parameters set (Example: "Interface Applicative")
389 \param theModuleName is a name of the module (Example: "Geometry")
390 \param theSavePoint is number of a set of parameters as there can be several sets
392 AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint);
396 Returns a default Python script to restore visual parameters for given %theModuleName.
397 \param theID identifies a common parameters set (Example: "Interface Applicative")
398 \param theModuleName is a name of the module (Example: "Geometry")
400 string GetDefaultScript(in string theID, in string theModuleName);
403 Private method, returns an implementation of this Study.
404 \param theHostname is a hostname of the caller
405 \param thePID is a process ID of the caller
406 \param isLocal is set True if the Study is launched locally with the caller
408 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
412 Marks this Study as being locked by the given locker. The lock status can be checked by method IsStudyLocked
413 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
415 void SetStudyLock(in string theLockerID);
418 Returns True if the Study was marked locked.
420 boolean IsStudyLocked();
423 Marks this Study as being unlocked by the given locker. The lock status can be checked by method IsStudyLocked
424 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
426 void UnLockStudy(in string theLockerID);
429 Returns the list iof IDs of the Study's lockers.
431 ListOfStrings GetLockerID();
434 Create real variable with Name theVarName value theValue
435 (or set if variable value in to theValue already exists)
436 \param theVarName is a name of the variable
437 \param theVarName is a value of the variable.
439 void SetReal( in string theVarName, in double theValue );
442 Create integer variable with Name theVarName value theValue
443 (or set if variable value in to theValue already exists)
444 \param theVarName is a name of the variable
445 \param theVarName is a value of the variable.
447 void SetInteger( in string theVarName, in long theValue );
449 Create boolean variable with Name theVarName value theValue
450 (or set if variable value in to theValue already exists)
451 \param theVarName is a name of the variable
452 \param theVarName is a value of the variable.
454 void SetBoolean( in string theVarName, in boolean theValue );
457 Return real value of the variable
458 \param theVarName is a name of the variable.
460 double GetReal( in string theVarName );
463 Return integer value of the variable
464 \param theVarName is a name of the variable.
466 long GetInteger( in string theVarName );
469 Return boolean value of the variable
470 \param theVarName is a name of the variable.
472 boolean GetBoolean( in string theVarName );
476 Return true if variable is real otherwise return false.
477 \param theVarName is a name of the variable.
479 boolean IsReal( in string theVarName );
482 Return true if variable is integer otherwise return false.
483 \param theVarName is a name of the variable.
485 boolean IsInteger( in string theVarName );
488 Return true if variable is boolean otherwise return false.
489 \param theVarName is a name of the variable.
491 boolean IsBoolean( in string theVarName );
494 Return true if variable exists in the study,
495 otherwise return false.
496 \param theVarName is a name of the variable.
498 boolean IsVariable( in string theVarName );
501 Return names of all variables from the study.
503 ListOfStrings GetVariableNames();
505 /*! \brief Removing variable
507 Remove variable with the specified name from the study with substitution of its value.
509 \param theVarName Name of the variable.
510 \return Status of operation.
512 boolean RemoveVariable( in string theVarName );
514 /*! \brief Renaming variable
516 Rename variable with the specified name within the study.
518 \param theVarName Name of the variable.
519 \param theNewVarName New name for the variable.
520 \return Status of operation.
522 boolean RenameVariable( in string theVarName, in string theNewVarName );
524 /*! \brief Checking variable usage
526 Check that variable is used in the study.
528 \param theVarName Name of the variable.
529 \return Variable usage.
531 boolean IsVariableUsed( in string theVarName );
533 /*! \brief Parse variables used for object creation
535 \param string with variables, separated by special symbol.
536 \return Variables list.
538 ListOfListOfStrings ParseVariables( in string theVars );
542 //==========================================================================
543 /*! \brief %Study Builder Interface
545 The purpose of the Builder is to add and/or remove objects and attributes.
546 A %StudyBuilder is linked to a %Study. A
547 command management is provided for the undo/redo functionalities.
549 <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
550 item's position in the tree-type structure of the browser. In general it has the following
551 form: <TT>0:2:1:1</TT>
553 //==========================================================================
555 interface StudyBuilder
557 /*! \brief %LockProtection Exception
559 This exception is raised while attempting to modify a locked %study.
561 exception LockProtection {};
562 /*! \brief Creation of a new %SComponent.
564 Creates a new %SComponent
565 \param ComponentDataType Data type of the %SComponent which will be created.
567 <BR><VAR>See also <A href="exemple/Example17.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
570 SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
571 /*! \brief Definition of the instance to the %SComponent
573 Defines the instance to the %SComponent.
575 void DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
577 /*! \brief Deletion of a %SComponent
579 Removes a %SComponent.
581 void RemoveComponent(in SComponent aComponent) raises(LockProtection);
583 /*! \brief Creation of a new %SObject
585 Creates a new %SObject under a definite father %SObject.
587 \param theFatherObject The father %SObject under which this one should be created.
590 <BR><VAR>See also <A href="exemple/Example18.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
594 SObject NewObject (in SObject theFatherObject) raises(LockProtection);
596 /*! \brief Creation of a new %SObject with a definite %tag
598 Creates a new %SObject with a definite %tag.
600 \param atag Long value corresponding to the tag of the new %SObject.
604 SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
605 /*! \brief Deletion of the %SObject
607 Removes a %SObject from the %StudyBuilder.
609 \param anObject The %SObject to be deleted.
611 void RemoveObject (in SObject anObject) raises(LockProtection);
612 /*! \brief Deletion of the %SObject with all his child objects.
614 Removes the %SObject with all his child objects.
616 \param anObject The %SObject to be deleted with all child objects.
618 void RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
623 <BR><VAR>See also <A href="exemple/Example19.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
626 void LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
630 \param sco %SObject to be loaded.
632 void Load (in SObject sco);
634 /*! \brief Looking for or creating an attribute assigned to the %SObject
636 Allows to find or create an attribute of a specific type which is assigned to the object.
637 \param anObject The %SObject corresponding to the attribute which is looked for.
638 \param aTypeOfAttribute Type of the attribute.
640 <BR><VAR>See also <A href="exemple/Example1.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
643 GenericAttribute FindOrCreateAttribute(in SObject anObject,
644 in string aTypeOfAttribute) raises(LockProtection);
646 /*! \brief Looking for an attribute assigned to a %SObject
648 Allows to find an attribute of a specific type which is assigned to the object.
649 \param anObject The %SObject corresponding to the attribute which is looked for.
650 \param aTypeOfAttribute Type of the attribute.
651 \param anAttribute Where the attribute is placed if it's found.
652 \return True if it finds an attribute.
655 boolean FindAttribute(in SObject anObject,
656 out GenericAttribute anAttribute,
657 in string aTypeOfAttribute);
658 /*! \brief Deleting the attribute assigned to the %SObject
660 Removes the attribute of a specific type which is assigned to the object.
661 \param anObject The %SObject corresponding to the attribute.
662 \param aTypeOfAttribute Type of the attribute.
664 <BR><VAR>See also <A href="exemple/Example17.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
666 void RemoveAttribute(in SObject anObject,
667 in string aTypeOfAttribute) raises(LockProtection);
669 Adds a reference between %anObject and %theReferencedObject.
670 \param anObject The %SObject which will get a reference
671 \param theReferencedObject The %SObject having a reference
674 void Addreference(in SObject anObject,
675 in SObject theReferencedObject) ;
678 Removes a reference from %anObject to another object.
679 \param anObject The %SObject which contains a reference
682 void RemoveReference(in SObject anObject) ;
685 Adds a directory in the %Study.
686 \param theName String parameter defining the name of the directory.
688 <BR><VAR>See also <A href="exemple/Example23.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
691 void AddDirectory(in string theName) raises(LockProtection);
693 /*! \brief Identification of the %SObject's substructure.
695 Identification of the %SObject's substructure by GUID.
698 \param anObject The %SObject which will be identified
699 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
702 void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
704 Searches for a definite %SObject with a definite GUID and returns True if it finds it.
706 \param anObject A definite %SObject which will be identified
707 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
709 boolean IsGUID(in SObject anObject, in string theGUID);
711 /*! \brief Creation of a new command
713 Creates a new command which can contain several different actions.
715 <BR><VAR>See also <A href="exemple/Example3.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
718 void NewCommand(); // command management
719 /*! \brief Execution of the command
721 Commits all actions declared within this command.
723 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
725 <BR><VAR>See also <A href="exemple/Example16.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
728 void CommitCommand() raises(LockProtection); // command management
730 Returns True if at this moment there is a command under execution.
732 boolean HasOpenCommand();
733 /*! \brief Cancelation of the command
735 Cancels all actions declared within the command.
737 <BR><VAR>See also <A href="exemple/Example17.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
739 void AbortCommand(); // command management
742 The number of actions which can be undone
744 attribute long UndoLimit;
745 /*! \brief Undo method
747 Cancels all actions of the last command.
749 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
751 <BR><VAR>See also <A href="exemple/Example16.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
754 void Undo() raises (LockProtection);
755 /*! \brief Redo method
757 Redoes all actions of the last command.
759 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
761 <BR><VAR>See also <A href="exemple/Example16.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
764 void Redo() raises (LockProtection);
766 Returns True if at this moment there are any actions which can be canceled.
768 <BR><VAR>See also <A href="exemple/Example16.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
771 boolean GetAvailableUndos();
773 Returns True if at this moment there are any actions which can be redone.
775 <BR><VAR>See also <A href="exemple/Example3.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
778 boolean GetAvailableRedos();
780 Puts name attribute with the given string value to the given %SObject
782 \param theSO Existing SObject to set name attribute.
783 \param theValue The value to be set to the name attribute.
785 void SetName(in SObject theSO, in string theValue) raises (LockProtection);
788 Puts comment attribute with the given string value to the given %SObject
790 \param theSO Existing SObject to set comment attribute.
791 \param theValue The value to be set to the comment attribute.
793 void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
796 Puts IOR attribute with the given string value to the given %SObject
798 \param theSO Existing SObject to set IOR attribute.
799 \param theValue The value to be set to the IOR attribute.
801 void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
804 //==========================================================================
805 /*! \brief %Study Manager interface
807 The purpose of the Manager is to manipulate the %Studies. You will find in this
808 interface the methods to create, open,
809 close, and save a %Study. Since a %SALOME session is multi-document, you will
810 also find the methods allowing to navigate
811 through the collection of studies present in a session.
813 //==========================================================================
815 interface StudyManager
818 Determines whether the server has already been loaded or not.
825 Returns the PID of the server
830 Shutdown the StudyManager process.
832 oneway void ShutdownWithExit();
834 /*! \brief Creation of a new study
836 Creates a new study with a definite name.
838 \param study_name String parameter defining the name of the study
840 <BR><VAR>See also <A href="exemple/Example17.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
843 Study NewStudy(in string study_name);
845 /*! \brief Open a study
847 Reads and activates the structure of the study %Objects.
848 \param aStudyUrl The path to the study
849 \warning This method doesn't activate the corba objects. Only a component can do it.
851 <BR><VAR>See also <A href="exemple/Example1.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
853 Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
855 /*! \brief Closing the study
859 void Close(in Study aStudy);
860 /*! \brief Saving the study in a HDF file (or files).
864 \param theMultiFile If this parameter is True the study will be saved in several files.
866 <BR><VAR>See also <A href="exemple/Example19.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
869 boolean Save(in Study aStudy, in boolean theMultiFile);
870 /*! \brief Saving a study in a ASCII file (or files).
872 Saves a study in an ASCII format file (or files).
873 \param theMultiFile If this parameter is True the study will be saved in several files.
875 boolean SaveASCII(in Study aStudy, in boolean theMultiFile);
876 /*! \brief Saving the study in a specified HDF file (or files).
878 Saves the study in a specified file (or files).
879 \param aUrl The path to the definite file in whcih the study will be saved
880 \param aStudy The study which will be saved
881 \param theMultiFile If this parameter is True the study will be saved in several files.
883 <BR><VAR>See also <A href="exemple/Example1.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
885 boolean SaveAs(in URL aUrl, // if the file already exists
887 in boolean theMultiFile); // overwrite (as option)
888 /*! \brief Saving the study in a specified ASCII file (or files).
890 Saves the study in a specified ASCII file (or files).
892 \param aUrl The path to the definite file in whcih the study will be saved
893 \param aStudy The study which will be saved
894 \param theMultiFile If this parameter is True the study will be saved in several files.
896 boolean SaveAsASCII(in URL aUrl, // if the file already exists
898 in boolean theMultiFile); // overwrite (as option)
901 /*! \brief List of open studies.
903 Gets the list of open studies
905 \return A list of open studies in the current session.
907 ListOfOpenStudies GetOpenStudies();
909 /*! \brief Getting a particular %Study picked by name
911 Activates a particular %Study
912 among the session collection picking it by name.
913 \param aStudyName The name of the study
915 Study GetStudyByName (in string aStudyName);
917 /*! \brief Getting a particular %Study picked by ID
919 Activates a particular %Study
920 among the session collection picking it by ID.
921 \param aStudyID The ID of the study
923 Study GetStudyByID (in short aStudyID);
925 // copy/paste methods
928 Returns True, if the given %SObject can be copied to the clipboard.
930 boolean CanCopy(in SObject theObject);
932 Returns True, if the given %SObject is copied to the clipboard.
933 \param theObject The %SObject which will be copied
935 boolean Copy(in SObject theObject);
937 Returns True, if the object from the clipboard can be pasted to the given %SObject.
938 \param theObject The %SObject stored in the clipboard.
940 boolean CanPaste(in SObject theObject);
942 Returns the %SObject in which the object from the clipboard was pasted to.
943 \param theObject The %SObject which will be pasted
944 \exception SALOMEDS::StudyBuilder::LockProtection This exception is raised, when trying to paste
945 an object into a study, which is protected for modifications.
947 SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
949 /*! \brief Object conversion.
951 Converts an object into IOR.
954 string ConvertObjectToIOR(in Object theObject);
955 /*! \brief Object conversion.
957 Converts IOR into an object.
960 Object ConvertIORToObject(in string theIOR);
963 Private method, returns an implementation of this StudyManager.
964 \param theHostname is a hostname of the caller
965 \param thePID is a process ID of the caller
966 \param isLocal is set True if the StudyManager is launched locally with the caller
968 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
974 //==========================================================================
975 /*! \brief %SObject interface
977 The objects in the %study are built by the %StudyBuilder. The %SObject interface
978 provides methods for elementary inquiries, like getting an object %ID or its attribuites.
981 <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
982 in the tree-type data structure.
983 <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
984 ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
986 //==========================================================================
988 interface SObject : SALOME::GenericObj
990 /*! Name of the %SObject
992 attribute string Name; // equivalent to setName() & getName()
993 /*! Gets an object %ID
995 \return ID of the %SObject.
998 /*! Acquisition of the father %Component of the %SObject
1000 \return The father %Component of the %SObject.
1002 SComponent GetFatherComponent();
1003 /*! Acquisition of the father %SObject of the %SObject
1005 \return the father %SObject of the given %SObject.
1007 SObject GetFather();
1008 /*! Gets the %tag of a %SObject
1010 \return the %tag of a %SObject.
1013 /*! Gets the depth of a %SObject
1015 \return the depth of a %SObject.
1018 /*! Looks for subobjects of a given %SObject.
1020 \param atag Tag of the given %SObject
1021 \return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
1024 boolean FindSubObject (in long atag, out SObject obj);
1025 /*! Looks for attributes of a given %SObject
1027 \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
1028 \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
1030 <BR><VAR>See also <A href="exemple/Example1.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
1032 boolean FindAttribute(out GenericAttribute anAttribute,
1033 in string aTypeOfAttribute);
1034 /*! Looks for a %SObject which the given %SObject refers to.
1036 \return The object which the given %SObject refers to as well as True if it finds
1039 boolean ReferencedObject(out SObject obj); // A REVOIR
1040 /*! Gets all attributes of a given %SObject
1042 \return The list of all attributes of the given %SObject.
1044 <BR><VAR>See also <A href="exemple/Example17.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
1047 ListOfAttributes GetAllAttributes();
1048 /*! Gets the study of a given %SObject.
1050 \return The study containing the given %SObject.
1054 /*! Gets the CORBA object by its own IOR attribute.
1055 Returns nil, if can't.
1057 \return The CORBA object of the %SObject.
1062 Returns the name attribute value of this SObject.
1063 Returns empty string if there is no name attribute.
1068 Returns the comment attribute value of this SObject.
1069 Returns empty string if there is no comment attribute.
1071 string GetComment();
1074 Returns the IOR attribute value of this SObject.
1075 Returns empty string if there is no IOR attribute.
1080 Private method, returns an implementation of this SObject.
1081 \param theHostname is a hostname of the caller
1082 \param thePID is a process ID of the caller
1083 \param isLocal is set True if the SObject is launched locally with the caller
1085 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1089 //==========================================================================
1090 /*! \brief %Generic attribute interface
1092 %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
1094 //==========================================================================
1095 interface GenericAttribute : SALOME::GenericObj
1097 /*! \brief Exception locking all changes
1099 This exception locks all modifications in attributes.
1101 exception LockProtection {};
1102 /*! \brief Method CheckLocked
1104 Checks whether the %Study is protected for modifications.
1106 \note <BR>This exception is raised only outside a transaction.
1108 void CheckLocked() raises (LockProtection);
1112 string GetClassType();
1114 SObject GetSObject();
1117 Private method, returns an implementation of this GenericAttribute.
1118 \param theHostname is a hostname of the caller
1119 \param thePID is a process ID of the caller
1120 \param isLocal is set True if the GenericAttribute is launched locally with the caller
1122 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1127 //==========================================================================
1128 /*! \brief %SComponent interface
1130 The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
1131 The %SComponent interface is a specialization of the %SObject interface.
1132 It inherits the most of its methods from the %SObject interface.
1134 //==========================================================================
1135 interface SComponent : SObject
1137 /*! Gets the data type of the given %SComponent
1139 \return The data type of this %SComponent.
1141 string ComponentDataType();
1142 /*! Gets the IOR of the given component
1144 \return True (if there is an instance of the given component) and its IOR.
1146 boolean ComponentIOR (out ID theID); //returns True if there is an instance
1147 //In this case ID identifies this one
1151 //==========================================================================
1152 /*! \brief %SComponentIterator interface
1154 This interface contains the methods allowing to iterate over all components in the list.
1155 The search is started from the first %SComponent in the list.
1157 //==========================================================================
1158 interface SComponentIterator : SALOME::GenericObj
1161 Activates the %SComponentIterator.
1166 \return True if there is one more %SComponent in the list.
1170 Moves the iterator to the next %SComponent in the list.
1174 Returns the %SComponent corresponding to the current %SComponent found by the iterator.
1176 <BR><VAR>See also <A href="exemple/Example1.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
1182 //==========================================================================
1183 /*! \brief %ChildIterator interface
1185 This interface contains methods which allow to iterate over all child
1188 //==========================================================================
1189 interface ChildIterator : SALOME::GenericObj
1193 Activates the %ChildIterator.
1198 Activates the %ChildIterator for all child levels.
1200 \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels.
1202 void InitEx(in boolean allLevels);
1205 \return True if there is one more %ChildIterator in the list.
1209 Passes the iterator to the next level.
1213 Returns the %SObject corresponding to the current object found by the iterator.
1218 //==========================================================================
1219 //==========================================================================
1220 /*! \brief Interface of the %UseCaseIterator.
1222 This interface contains a set of methods used for iteration over the objects in the use case.
1224 interface UseCaseIterator : SALOME::GenericObj
1227 Activates the %UseCaseIterator.
1228 \param allLevels If the value of this parameter is True the Iterator is activated for all subobjects.
1230 void Init(in boolean allLevels);
1233 \return True if the %UseCaseIterator finds one more object.
1237 Passes the iterator to the next object.
1241 Returns the %SObject corresponding to the current object found by the Iterator.
1246 //==========================================================================
1247 //==========================================================================
1248 /*! \brief Interface of the %UseCaseBuilder
1250 Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
1251 The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
1253 interface UseCaseBuilder : SALOME::GenericObj
1256 Adds to the use case an object as a child of the current object of the use case.
1258 \param theObject The added %SObject.
1259 \return True if this %SObject has been added in the use case.
1261 boolean Append(in SObject theObject);
1263 Removes an object from the use case.
1265 \param theObject The deleted %SObject
1266 \return True if this %SObject has been deleted from the use case.
1268 boolean Remove(in SObject theObject);
1270 Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
1272 boolean AppendTo(in SObject theFather, in SObject theObject);
1274 Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
1276 boolean InsertBefore(in SObject theFirst, in SObject theNext);
1278 Sets the current object of the use case.
1280 boolean SetCurrentObject(in SObject theObject);
1282 Makes the root object to be the current object of the use case.
1284 boolean SetRootCurrent();
1286 Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
1288 boolean HasChildren(in SObject theObject);
1290 Sets the name of the use case.
1292 boolean SetName(in string theName);
1294 Gets the name of the use case.
1298 Returns True if the given object <VAR>theObject</VAR> represents a use case.
1300 boolean IsUseCase(in SObject theObject);
1302 Gets the current object of the use case.
1304 SObject GetCurrentObject();
1306 Creates a new use case in the use case browser.
1308 SObject AddUseCase(in string theName);
1310 Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
1312 UseCaseIterator GetUseCaseIterator(in SObject theObject);
1314 //==========================================================================
1315 /*! \brief %Driver interface
1317 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
1318 can be called by any component and which provide the following functionality:
1320 <li> publishing in the study of the objects created by a definite component
1321 <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.
1322 <li> transforming of the transient references into persistant references (or vice versa) of the SObjects when saving (or loading) a study
1323 <li> copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study
1327 //==========================================================================
1331 /*! \brief Saving the data produced by a definite component.
1333 This method is called by the StudyManager when saving a study.
1334 \param theComponent %SComponent corresponding to this Component
1335 \param theURL The path to the file in which the data will be saved.
1336 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1337 \return A byte stream TMPFile that contains all saved data
1339 <BR><VAR>See also <A href="exemple/Example19.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
1344 TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1346 /*! \brief Saving the data in ASCII format produced by a definite component.
1348 This method is called by the StudyManager when saving a study in ASCII format.
1349 \param theComponent %SComponent corresponding to this Component
1350 \param theURL The path to the file in which the data will be saved.
1351 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1352 \return A byte stream TMPFile that will contain all saved data
1354 <BR><VAR>See also <A href="exemple/Example19.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
1357 TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1359 /*! \brief Loading the data.
1361 This method is called by the StudyManager when opening a study.
1362 \param theComponent %SComponent corresponding to this Component
1363 \param theStream The file which contains all data saved by the component on Save method
1364 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1368 boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1370 /*! \brief Loading the data from files in ASCII format.
1372 This method is called by the StudyManager when opening a study.
1373 \param theComponent %SComponent corresponding to this Component
1374 \param theStream The file which contains all data saved by the component on Save method
1375 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1379 boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1381 /*! \brief Closing of the study
1383 This method Close is called by the StudyManager when closing a study.
1384 \param aSComponent The according %SComponent
1387 void Close (in SComponent aSComponent);
1388 //void Close ( in string aIORSComponent);
1390 /*! Gets the type of the data
1392 \return The type of data produced by the Component in the study.
1395 string ComponentDataType();
1397 // Driver Transient -> persistent called for each object in study
1399 Transforms IOR of a given %SObject into PersistentID. It is called for each
1400 object in the %study.
1401 \note <br> In %SALOME the objects which are present in an active study are identified by an IOR, when this
1402 study is saved these references are transformed into persintent IDs.
1404 \param theSObject The given %SObject.
1405 \param IORString The IOR of the given %SObject.
1406 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1407 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1409 \return The persistent ID of the given %SObject
1412 string IORToLocalPersistentID (in SObject theSObject,
1413 in string IORString,
1414 in boolean isMultiFile,
1415 in boolean isASCII);
1417 Transforms PersistentID into IOR of the object. It is called for each
1418 object in the %study.
1420 \note <br> In %SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this
1421 study is open, these references are transformed into persintent IORs.
1423 \param theSObject The given %SObject.
1424 \param IORString The IOR of the given %SObject.
1425 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1426 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1428 \return The IOR of the given %SObject
1431 string LocalPersistentIDToIOR (in SObject theSObject,
1432 in string aLocalPersistentID,
1433 in boolean isMultiFile,
1435 raises (SALOME::SALOME_Exception);
1437 // Publishing in the study
1438 /*! Publishing in the study
1440 \return True if the given %Component can publish a definite object with a given IOR in the %study.
1441 \param theIOR The IOR of a definite object
1443 boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1444 /*! \brief Publishing in the study
1446 Publishes the given object in the %study, using the algorithm of this component.
1447 \param theStudy The %study in which the object is published
1448 \param theSObject If this parameter is null the object is published for the first time. Otherwise
1449 this parameter should contain a reference to the object published earlier
1450 \param theObject The object which is published
1451 \param theName The name of the published object. If this parameter is empty, the name is generated
1452 automatically by the component.
1454 \return The published %SObject.
1456 SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
1458 // copy/paste methods
1461 Returns True, if the given %SObject can be copied to the clipboard.
1463 \param theObject The given %SObject which should be copied.
1465 boolean CanCopy(in SObject theObject);
1467 Returns the object %ID and the %TMPFile of the object from the given %SObject.
1469 TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1471 Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1473 boolean CanPaste(in string theComponentName, in long theObjectID);
1475 Returns the %SObject of the pasted object.
1477 SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);