1 // Copyright (C) 2007-2010 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
23 // File : SALOMEDS.idl
24 // Author : Yves FRICAUD
27 /*! \file SALOMEDS.idl \brief This file contains a set of interfaces used for creation, management
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, management
39 and modification of the %Study
43 /*! \brief Name of the file in which the %Study is saved.
47 /*! \brief Main identifier of an object in %SALOME application
51 /*! \brief While saving the data, IOR is transformed into persistent reference
53 typedef string PersistentReference;
55 /*! \brief IOR of the study in %SALOME application
57 typedef string SalomeReference;
59 /*! \brief List of the names of studies which are currently open in this %SALOME session.
61 Since %SALOME is a multi-study application, it allows to open a lot of studies
62 during each working session.
64 typedef sequence<string> ListOfOpenStudies;
65 //! List of file names
66 typedef sequence<string> ListOfFileNames;
67 //! List of modification dates of a study
68 typedef sequence<string> ListOfDates ;
69 //! An unbounded sequence of strings
70 typedef sequence<string> ListOfStrings ;
71 //! An unbounded sequence of sequence of strings
72 typedef sequence<ListOfStrings> ListOfListOfStrings ;
73 //! A byte stream which is used for binary data transfer between different components
74 typedef sequence<octet> TMPFile;
76 // Reference to other objects is treated with function AddReference
77 // and ReferencedObject
78 // All other type of attributes defined in AttributeType enum are
79 // treated with AddAdttribute and GetAttribute
80 // The difference is made because Reference attribute don't contain
81 // strings but reference to ID of other objects
83 interface GenericAttribute;
85 interface StudyManager;
86 interface StudyBuilder;
89 interface SComponentIterator;
90 interface ChildIterator;
92 interface AttributeStudyProperties;
93 interface AttributeParameter;
94 interface UseCaseIterator;
95 interface UseCaseBuilder;
97 //! List of attributes of %SObjects
98 typedef sequence<GenericAttribute> ListOfAttributes;
100 //! Exception indicating that this feature hasn't been implemented in %SALOME application.
101 exception NotImplemented {};
104 //===========================================================================
105 /*! \brief %Study Interface
107 The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
108 Most of the %Study operations are handled by the StudyManager and the StudyBuilder.
109 What is left in the %Study interface are elementary inquiries.
110 (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
111 and set methods.) A %Study is explored by a set of tools, mainly iterators
112 , which are described further. Nevertheless, the %Study
113 interface allows the search of an object by name or by ID.
115 <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
116 In general it's a string of names of directories divided by a slash '/'.
117 <BR><VAR>The Context</VAR> is the current directory of an object.</P>
123 //! Invalid study context
124 exception StudyInvalidContext {};
125 //! Invalid study component
126 exception StudyInvalidComponent {};
127 //! Invalid directory of the %study exception
128 exception StudyInvalidDirectory {};
129 //! Exception pointing that this name of the study has already been used.
130 exception StudyNameAlreadyUsed {};
131 //! study object already exists
132 exception StudyObjectAlreadyExists {};
133 //! Invalid name of the %study exception
134 exception StudyNameError {};
135 //! Invalid study comment
136 exception StudyCommentError {};
138 /*! \brief The name of the %Study
140 This is equivalent to the methods setName() & getName()
142 attribute string Name; // equivalent to setName() & getName()
143 /*! \brief The ID of the %Study
145 This is equivalent to the methods setID() & getID()
147 attribute short StudyId;
148 //! Sequence containing %SObjects
149 typedef sequence<SObject> ListOfSObject;
150 //! Get the persistent reference to the %Study.
151 PersistentReference GetPersistentReference();
152 //! Get a transient reference to the %Study.
153 SalomeReference GetTransientReference();
155 /*! \brief indicate whether the %Study is empty
157 \return True if the %Study is empty
160 /*! \brief Find a %SComponent by its name.
162 \param aComponentName It's a string value in the Comment Attribute of the Component,
163 which is looked for, defining the data type of this Component.
165 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
168 SComponent FindComponent (in string aComponentName);
170 /*! \brief Find a %SComponent by ID of the according %SObject
172 SComponent FindComponentID(in ID aComponentID);
173 /*! \brief Find a %SObject by the Name Attribute of this %SObject
175 \param anObjectName String parameter defining the name of the object
176 \return The obtained %SObject
178 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
180 SObject FindObject (in string anObjectName);
181 /*! \brief Find a %SObject by its ID
183 \param aObjectID This parameter defines the ID of the required object
184 \return The obtained %SObject
186 SObject FindObjectID (in ID aObjectID);
187 /*! \brief Create a %SObject by its ID
189 \param aObjectID This parameter defines the ID of the required object
190 \return The created %SObject
192 SObject CreateObjectID (in ID aObjectID);
193 /*! \brief Find a %SObject by IOR of the object belonging to this %SObject.
195 \param anObjectName This parameter defines the IOR of the object
196 \return The obtained %SObject
198 SObject FindObjectIOR (in ID aObjectIOR);
199 /*! \brief Find in the study all %SObjects produced by a given %Component.
201 \param anObjectName The Name Attribute of the searched %SObjects should correspond to <VAR>anObjectName</VAR>.
202 \param aComponentName The name of the component, which objects are searched for.
204 ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName);
205 /*! \brief Find a %SObject by the path to it.
207 \param thePath The path to the required %SObject.
208 \return The obtained %SObject.
210 SObject FindObjectByPath(in string thePath);
211 /*! \brief Get the path to the %SObject.
213 string GetObjectPath(in Object theObject);
215 /*! \brief Set the context of the %Study.
217 \param thePath String parameter defining the context of the study.
219 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
221 void SetContext(in string thePath);
222 /*! \brief Get the context of the %Study.
224 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
227 /*! \brief Get a list of names of objects corresponding to the context.
229 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
231 ListOfStrings GetObjectNames(in string theContext);
232 /*! \brief Get a list of names of directories and subdirectories corresponding to the context.
234 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
236 ListOfStrings GetDirectoryNames(in string theContext);
237 /*! \brief Get a list of names of Files corresponding to the context.
239 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
241 ListOfStrings GetFileNames(in string theContext);
242 /*! \brief Get a list of names of Components corresponding to the context.
244 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
246 ListOfStrings GetComponentNames(in string theContext);
247 /*! \brief Create a new iterator of child levels of the given %SObject.
249 \param aSO The given %SObject
250 \return A new iterator of child levels of the given %SObject.
252 ChildIterator NewChildIterator(in SObject aSO);
254 /*! \brief Create a new iterator of the %SComponents.
256 \return A new iterator of the %SComponents.
258 SComponentIterator NewComponentIterator();
260 /*! \brief Create a new %StudyBuilder to add or modify an object in the study.
262 \return A new %StudyBuilder.
264 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
266 StudyBuilder NewBuilder() ;
267 /*! \brief Labels dependency
269 Updates the map with IOR attribute. It's an inner method used for optimization.
271 void UpdateIORLabelMap(in string anIOR, in string anEntry);
273 /*! \brief Getting properties of the study
275 Returns the attribute, which contains the properties of this study.
277 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
280 AttributeStudyProperties GetProperties();
281 /*! \brief Indicate whether the %study has been saved
283 attribute boolean IsSaved;
284 /*! \brief Indicate whether the %study has been modified and not saved.
286 Returns True if the %study has been modified and not saved.
288 boolean IsModified();
290 /*! \brief Mark the %study as being modified and not saved.
294 /*! \brief Indicate the file where the %study has been saved
296 attribute string URL;
298 /*! \brief List of %SObjects
300 Returns the list of %SObjects which refers to %anObject.
302 ListOfSObject FindDependances(in SObject anObject);
304 /*! \brief The date of the last saving of the study
306 Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
308 string GetLastModificationDate();
309 /*! \brief The list of modification dates of the study
311 Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
312 Note : the first modification begins the list.
314 ListOfDates GetModificationsDate();
315 /*! \brief Object conversion.
317 Converts an object into IOR.
320 string ConvertObjectToIOR(in Object theObject);
321 /*! \brief Object conversion.
323 Converts IOR into an object.
326 Object ConvertIORToObject(in string theIOR);
327 /*! \brief Get a new %UseCaseBuilder.
329 UseCaseBuilder GetUseCaseBuilder();
331 /*! \brief Close the components in the study, remove itself from the %StudyManager.
335 /*! \brief Enable (if isEnabled = True)/disable automatic addition of new %SObjects to the use case.
337 void EnableUseCaseAutoFilling(in boolean isEnabled);
340 Functions for internal usage only
342 void AddPostponed(in string theIOR);
344 void AddCreatedPostponed(in string theIOR);
346 void RemovePostponed(in long theUndoLimit);
348 void UndoPostponed(in long theWay);
350 boolean DumpStudy(in string thePath, in string theBaseName, in boolean isPublished);
352 /*! \brief Get an AttributeParameter used to store common parameters for given %theSavePoint.
354 \param theID identifies a common parameters set (Example: "Interface Applicative")
355 \param theSavePoint is number of a set of parameters as there can be several sets
357 AttributeParameter GetCommonParameters(in string theID, in long theSavePoint);
359 /*! \brief Get an AttributeParameter used to store parameters for given %theModuleName.
361 \param theID identifies a common parameters set (Example: "Interface Applicative")
362 \param theModuleName is a name of the module (Example: "Geometry")
363 \param theSavePoint is number of a set of parameters as there can be several sets
365 AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint);
368 /*! \brief Get a default Python script to restore visual parameters for given %theModuleName.
370 \param theID identifies a common parameters set (Example: "Interface Applicative")
371 \param theModuleName is a name of the module (Example: "Geometry")
373 string GetDefaultScript(in string theID, in string theModuleName);
376 Private method, returns an implementation of this Study.
377 \param theHostname is a hostname of the caller
378 \param thePID is a process ID of the caller
379 \param isLocal is set True if the Study is launched locally with the caller
381 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
384 /*! \brief Mark this Study as being locked by the given locker.
386 The lock status can be checked by method IsStudyLocked
387 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
389 void SetStudyLock(in string theLockerID);
391 /*! \brief Indicate if the Study is locked
393 Returns True if the Study was marked locked.
395 boolean IsStudyLocked();
397 /*! \brief Mark this Study as being unlocked by the given locker.
399 The lock status can be checked by method IsStudyLocked
400 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
402 void UnLockStudy(in string theLockerID);
404 /*! \brief Get the list of IDs of the Study's lockers.
406 ListOfStrings GetLockerID();
408 /*! \brief Create real variable with Name theVarName and value theValue
410 (or set if variable value into theValue already exists)
411 \param theVarName is a name of the variable
412 \param theVarName is a value of the variable.
414 void SetReal( in string theVarName, in double theValue );
416 /*! \brief Create integer variable with Name theVarName and value theValue
418 (or set if variable value into theValue already exists)
419 \param theVarName is a name of the variable
420 \param theVarName is a value of the variable.
422 void SetInteger( in string theVarName, in long theValue );
423 /*! \brief Create boolean variable with Name theVarName and value theValue
425 (or set if variable value into theValue already exists)
426 \param theVarName is a name of the variable
427 \param theVarName is a value of the variable.
429 void SetBoolean( in string theVarName, in boolean theValue );
431 /*! \brief Create string variable with Name theVarName and value theValue
433 (or set if variable value into theValue already exists)
434 \param theVarName is a name of the variable
435 \param theVarName is a value of the variable.
437 void SetString( in string theVarName, in string theValue );
439 /*! \brief Set current value as double for string variable
441 void SetStringAsDouble( in string theVarName, in double theValue );
443 /*! \brief Get value of a real variable
445 \param theVarName is a name of the variable.
447 double GetReal( in string theVarName );
449 /*! \brief Get value of an integer variable
451 \param theVarName is a name of the variable.
453 long GetInteger( in string theVarName );
455 /*! \brief Get value of a boolean variable
457 \param theVarName is a name of the variable.
459 boolean GetBoolean( in string theVarName );
461 /*! \brief Get value of a string variable
463 \param theVarName is a name of the variable.
465 string GetString( in string theVarName );
468 /*! \brief Indicate if a variable is real
470 Return true if variable is real otherwise return false.
471 \param theVarName is a name of the variable.
473 boolean IsReal( in string theVarName );
475 /*! \brief Indicate if a variable is integer
477 Return true if variable is integer otherwise return false.
478 \param theVarName is a name of the variable.
480 boolean IsInteger( in string theVarName );
482 /*! \brief Indicate if a variable is boolean
484 Return true if variable is boolean otherwise return false.
485 \param theVarName is a name of the variable.
487 boolean IsBoolean( in string theVarName );
489 /*! \brief Indicate if a variable is string
491 Return true if variable is string otherwise return false.
492 \param theVarName is a name of the variable.
494 boolean IsString( in string theVarName );
496 /*! \brief Indicate if a variable exists in the study
498 Return true if variable exists in the study,
499 otherwise return false.
500 \param theVarName is a name of the variable.
502 boolean IsVariable( in string theVarName );
504 /*! \brief Get names of all variables from the study.
506 ListOfStrings GetVariableNames();
508 /*! \brief Remove a variable
510 Remove variable with the specified name from the study with substitution of its value.
512 \param theVarName Name of the variable.
513 \return Status of operation.
515 boolean RemoveVariable( in string theVarName );
517 /*! \brief Rename a variable
519 Rename variable with the specified name within the study.
521 \param theVarName Name of the variable.
522 \param theNewVarName New name for the variable.
523 \return Status of operation.
525 boolean RenameVariable( in string theVarName, in string theNewVarName );
527 /*! \brief Indicate whether variable is used
529 Check that variable is used in the study.
531 \param theVarName Name of the variable.
532 \return Variable usage.
534 boolean IsVariableUsed( in string theVarName );
536 /*! \brief Parse variables used for object creation
538 \param string with variables, separated by special symbol.
539 \return Variables list.
541 ListOfListOfStrings ParseVariables( in string theVars );
545 //==========================================================================
546 /*! \brief %Study Builder Interface
548 The purpose of the Builder is to add and/or remove objects and attributes.
549 A %StudyBuilder is linked to a %Study. A
550 command management is provided for the undo/redo functionalities.
552 <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
553 item's position in the tree-type structure of the browser. In general it has the following
554 form: <TT>0:2:1:1</TT>
556 //==========================================================================
558 interface StudyBuilder
560 /*! \brief %LockProtection Exception
562 This exception is raised while attempting to modify a locked %study.
564 exception LockProtection {};
565 /*! \brief Creation of a new %SComponent.
567 Creates a new %SComponent
568 \param ComponentDataType Data type of the %SComponent which will be created.
570 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
573 SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
574 /*! \brief Definition of the instance to the %SComponent
576 Defines the instance to the %SComponent.
578 void DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
580 /*! \brief Deletion of a %SComponent
582 Removes a %SComponent.
584 void RemoveComponent(in SComponent aComponent) raises(LockProtection);
586 /*! \brief Creation of a new %SObject
588 Creates a new %SObject under a definite father %SObject.
590 \param theFatherObject The father %SObject under which this one should be created.
593 <em>See \ref example18 for an example of this method usage in batchmode of %SALOME application.</em>
597 SObject NewObject (in SObject theFatherObject) raises(LockProtection);
599 /*! \brief Creation of a new %SObject with a definite %tag
601 Creates a new %SObject with a definite %tag.
603 \param atag Long value corresponding to the tag of the new %SObject.
607 SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
608 /*! \brief Deletion of the %SObject
610 Removes a %SObject from the %StudyBuilder.
612 \param anObject The %SObject to be deleted.
614 void RemoveObject (in SObject anObject) raises(LockProtection);
615 /*! \brief Deletion of the %SObject with all his child objects.
617 Removes the %SObject with all his child objects.
619 \param anObject The %SObject to be deleted with all child objects.
621 void RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
626 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
629 void LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
633 \param sco %SObject to be loaded.
635 void Load (in SObject sco);
637 /*! \brief Looking for or creating an attribute assigned to the %SObject
639 Allows to find or create an attribute of a specific type which is assigned to the object.
640 \param anObject The %SObject corresponding to the attribute which is looked for.
641 \param aTypeOfAttribute Type of the attribute.
643 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
646 GenericAttribute FindOrCreateAttribute(in SObject anObject,
647 in string aTypeOfAttribute) raises(LockProtection);
649 /*! \brief Looking for an attribute assigned to a %SObject
651 Allows to find an attribute of a specific type which is assigned to the object.
652 \param anObject The %SObject corresponding to the attribute which is looked for.
653 \param aTypeOfAttribute Type of the attribute.
654 \param anAttribute Where the attribute is placed if it's found.
655 \return True if it finds an attribute.
658 boolean FindAttribute(in SObject anObject,
659 out GenericAttribute anAttribute,
660 in string aTypeOfAttribute);
661 /*! \brief Deleting the attribute assigned to the %SObject
663 Removes the attribute of a specific type which is assigned to the object.
664 \param anObject The %SObject corresponding to the attribute.
665 \param aTypeOfAttribute Type of the attribute.
667 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
669 void RemoveAttribute(in SObject anObject,
670 in string aTypeOfAttribute) raises(LockProtection);
672 Adds a reference between %anObject and %theReferencedObject.
673 \param anObject The %SObject which will get a reference
674 \param theReferencedObject The %SObject having a reference
677 void Addreference(in SObject anObject,
678 in SObject theReferencedObject) ;
681 Removes a reference from %anObject to another object.
682 \param anObject The %SObject which contains a reference
685 void RemoveReference(in SObject anObject) ;
688 Adds a directory in the %Study.
689 \param theName String parameter defining the name of the directory.
691 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
694 void AddDirectory(in string theName) raises(LockProtection);
696 /*! \brief Identification of the %SObject's substructure.
698 Identification of the %SObject's substructure by GUID.
701 \param anObject The %SObject which will be identified
702 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
705 void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
707 Searches for a definite %SObject with a definite GUID and returns True if it finds it.
709 \param anObject A definite %SObject which will be identified
710 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
712 boolean IsGUID(in SObject anObject, in string theGUID);
714 /*! \brief Creation of a new command
716 Creates a new command which can contain several different actions.
718 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
721 void NewCommand(); // command management
722 /*! \brief Execution of the command
724 Commits all actions declared within this 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 CommitCommand() raises(LockProtection); // command management
733 Returns True if at this moment there is a command under execution.
735 boolean HasOpenCommand();
736 /*! \brief Cancelation of the command
738 Cancels all actions declared within the command.
740 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
742 void AbortCommand(); // command management
745 The number of actions which can be undone
747 attribute long UndoLimit;
748 /*! \brief Undo method
750 Cancels all actions of the last command.
752 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
754 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
757 void Undo() raises (LockProtection);
758 /*! \brief Redo method
760 Redoes all actions of the last command.
762 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
764 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
767 void Redo() raises (LockProtection);
769 Returns True if at this moment there are any actions which can be canceled.
771 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
774 boolean GetAvailableUndos();
776 Returns True if at this moment there are any actions which can be redone.
778 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
781 boolean GetAvailableRedos();
783 Puts name attribute with the given string value to the given %SObject
785 \param theSO Existing SObject to set name attribute.
786 \param theValue The value to be set to the name attribute.
788 void SetName(in SObject theSO, in string theValue) raises (LockProtection);
791 Puts comment attribute with the given string value to the given %SObject
793 \param theSO Existing SObject to set comment attribute.
794 \param theValue The value to be set to the comment attribute.
796 void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
799 Puts IOR attribute with the given string value to the given %SObject
801 \param theSO Existing SObject to set IOR attribute.
802 \param theValue The value to be set to the IOR attribute.
804 void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
807 //==========================================================================
808 /*! \brief %Study Manager interface
810 The purpose of the Manager is to manipulate the %Studies. You will find in this
811 interface the methods to create, open,
812 close, and save a %Study. Since a %SALOME session is multi-document, you will
813 also find the methods allowing to navigate
814 through the collection of studies present in a session.
816 //==========================================================================
818 interface StudyManager
821 Determines whether the server has already been loaded or not.
828 Returns the PID of the server
833 Shutdown the StudyManager process.
835 oneway void ShutdownWithExit();
837 /*! \brief Creation of a new study
839 Creates a new study with a definite name.
841 \param study_name String parameter defining the name of the study
843 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
846 Study NewStudy(in string study_name);
848 /*! \brief Open a study
850 Reads and activates the structure of the study %Objects.
851 \param aStudyUrl The path to the study
852 \warning This method doesn't activate the corba objects. Only a component can do it.
854 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
856 Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
858 /*! \brief Closing the study
862 void Close(in Study aStudy);
863 /*! \brief Saving the study in a HDF file (or files).
867 \param theMultiFile If this parameter is True the study will be saved in several files.
869 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
872 boolean Save(in Study aStudy, in boolean theMultiFile);
873 /*! \brief Saving a study in a ASCII file (or files).
875 Saves a study in an ASCII format file (or files).
876 \param theMultiFile If this parameter is True the study will be saved in several files.
878 boolean SaveASCII(in Study aStudy, in boolean theMultiFile);
879 /*! \brief Saving the study in a specified HDF file (or files).
881 Saves the study in a specified file (or files).
882 \param aUrl The path to the definite file in whcih the study will be saved
883 \param aStudy The study which will be saved
884 \param theMultiFile If this parameter is True the study will be saved in several files.
886 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
888 boolean SaveAs(in URL aUrl, // if the file already exists
890 in boolean theMultiFile); // overwrite (as option)
891 /*! \brief Saving the study in a specified ASCII file (or files).
893 Saves the study in a specified ASCII file (or files).
895 \param aUrl The path to the definite file in whcih the study will be saved
896 \param aStudy The study which will be saved
897 \param theMultiFile If this parameter is True the study will be saved in several files.
899 boolean SaveAsASCII(in URL aUrl, // if the file already exists
901 in boolean theMultiFile); // overwrite (as option)
904 /*! \brief List of open studies.
906 Gets the list of open studies
908 \return A list of open studies in the current session.
910 ListOfOpenStudies GetOpenStudies();
912 /*! \brief Getting a particular %Study picked by name
914 Activates a particular %Study
915 among the session collection picking it by name.
916 \param aStudyName The name of the study
918 Study GetStudyByName (in string aStudyName);
920 /*! \brief Getting a particular %Study picked by ID
922 Activates a particular %Study
923 among the session collection picking it by ID.
924 \param aStudyID The ID of the study
926 Study GetStudyByID (in short aStudyID);
928 // copy/paste methods
931 Returns True, if the given %SObject can be copied to the clipboard.
933 boolean CanCopy(in SObject theObject);
935 Returns True, if the given %SObject is copied to the clipboard.
936 \param theObject The %SObject which will be copied
938 boolean Copy(in SObject theObject);
940 Returns True, if the object from the clipboard can be pasted to the given %SObject.
941 \param theObject The %SObject stored in the clipboard.
943 boolean CanPaste(in SObject theObject);
945 Returns the %SObject in which the object from the clipboard was pasted to.
946 \param theObject The %SObject which will be pasted
947 \exception SALOMEDS::StudyBuilder::LockProtection This exception is raised, when trying to paste
948 an object into a study, which is protected for modifications.
950 SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
952 /*! \brief Object conversion.
954 Converts an object into IOR.
957 string ConvertObjectToIOR(in Object theObject);
958 /*! \brief Object conversion.
960 Converts IOR into an object.
963 Object ConvertIORToObject(in string theIOR);
966 Private method, returns an implementation of this StudyManager.
967 \param theHostname is a hostname of the caller
968 \param thePID is a process ID of the caller
969 \param isLocal is set True if the StudyManager is launched locally with the caller
971 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
977 //==========================================================================
978 /*! \brief %SObject interface
980 The objects in the %study are built by the %StudyBuilder. The %SObject interface
981 provides methods for elementary inquiries, like getting an object %ID or its attribuites.
984 <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
985 in the tree-type data structure.
986 <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
987 ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
989 //==========================================================================
991 interface SObject : SALOME::GenericObj
993 /*! Name of the %SObject
995 attribute string Name; // equivalent to setName() & getName()
996 /*! Gets an object %ID
998 \return ID of the %SObject.
1001 /*! Acquisition of the father %Component of the %SObject
1003 \return The father %Component of the %SObject.
1005 SComponent GetFatherComponent();
1006 /*! Acquisition of the father %SObject of the %SObject
1008 \return the father %SObject of the given %SObject.
1010 SObject GetFather();
1011 /*! Gets the %tag of a %SObject
1013 \return the %tag of a %SObject.
1016 /*! Gets the depth of a %SObject
1018 \return the depth of a %SObject.
1021 /*! Looks for subobjects of a given %SObject.
1023 \param atag Tag of the given %SObject
1024 \return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
1027 boolean FindSubObject (in long atag, out SObject obj);
1028 /*! Looks for attributes of a given %SObject
1030 \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
1031 \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
1033 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1035 boolean FindAttribute(out GenericAttribute anAttribute,
1036 in string aTypeOfAttribute);
1037 /*! Looks for a %SObject which the given %SObject refers to.
1039 \return The object which the given %SObject refers to as well as True if it finds
1042 boolean ReferencedObject(out SObject obj); // A REVOIR
1043 /*! Gets all attributes of a given %SObject
1045 \return The list of all attributes of the given %SObject.
1047 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
1050 ListOfAttributes GetAllAttributes();
1051 /*! Gets the study of a given %SObject.
1053 \return The study containing the given %SObject.
1057 /*! Gets the CORBA object by its own IOR attribute.
1058 Returns nil, if can't.
1060 \return The CORBA object of the %SObject.
1065 Returns the name attribute value of this SObject.
1066 Returns empty string if there is no name attribute.
1071 Returns the comment attribute value of this SObject.
1072 Returns empty string if there is no comment attribute.
1074 string GetComment();
1077 Returns the IOR attribute value of this SObject.
1078 Returns empty string if there is no IOR attribute.
1083 Private method, returns an implementation of this SObject.
1084 \param theHostname is a hostname of the caller
1085 \param thePID is a process ID of the caller
1086 \param isLocal is set True if the SObject is launched locally with the caller
1088 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1092 //==========================================================================
1093 /*! \brief %Generic attribute interface
1095 %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
1097 //==========================================================================
1098 interface GenericAttribute : SALOME::GenericObj
1100 /*! \brief Exception locking all changes
1102 This exception locks all modifications in attributes.
1104 exception LockProtection {};
1105 /*! \brief Method CheckLocked
1107 Checks whether the %Study is protected for modifications.
1109 \note <BR>This exception is raised only outside a transaction.
1111 void CheckLocked() raises (LockProtection);
1116 //! Get the class type
1117 string GetClassType();
1120 SObject GetSObject();
1122 //! Private method, returns an implementation of this GenericAttribute.
1124 \param theHostname is a hostname of the caller
1125 \param thePID is a process ID of the caller
1126 \param isLocal is set True if the GenericAttribute is launched locally with the caller
1128 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1133 //==========================================================================
1134 /*! \brief %SComponent interface
1136 The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
1137 The %SComponent interface is a specialization of the %SObject interface.
1138 It inherits the most of its methods from the %SObject interface.
1140 //==========================================================================
1141 interface SComponent : SObject
1143 /*! \brief Gets the data type of the given %SComponent
1145 \return The data type of this %SComponent.
1147 string ComponentDataType();
1148 /*! \brief Gets the IOR of the given component
1150 \return True (if there is an instance of the given component) and its IOR.
1152 boolean ComponentIOR (out ID theID); //returns True if there is an instance
1153 //In this case ID identifies this one
1157 //==========================================================================
1158 /*! \brief %SComponentIterator interface
1160 This interface contains the methods allowing to iterate over all components in the list.
1161 The search is started from the first %SComponent in the list.
1163 //==========================================================================
1164 interface SComponentIterator : SALOME::GenericObj
1167 \brief Activates the %SComponentIterator.
1170 /*! \brief Method More
1172 \return True if there is one more %SComponent in the list.
1176 \brief Moves the iterator to the next %SComponent in the list.
1180 \brief Returns the %SComponent corresponding to the current %SComponent found by the iterator.
1182 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1188 //==========================================================================
1189 /*! \brief %ChildIterator interface
1191 This interface contains methods which allow to iterate over all child
1194 //==========================================================================
1195 interface ChildIterator : SALOME::GenericObj
1199 \brief Activates the %ChildIterator.
1204 \brief Activates the %ChildIterator for all child levels.
1206 \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels.
1208 void InitEx(in boolean allLevels);
1209 /*! \brief Method More
1211 \return True if there is one more %ChildIterator in the list.
1215 \brief Passes the iterator to the next level.
1219 \brief Returns the %SObject corresponding to the current object found by the iterator.
1224 //==========================================================================
1225 //==========================================================================
1226 /*! \brief Interface of the %UseCaseIterator.
1228 This interface contains a set of methods used for iteration over the objects in the use case.
1230 interface UseCaseIterator : SALOME::GenericObj
1233 Activates the %UseCaseIterator.
1234 \param allLevels If the value of this parameter is True the Iterator is activated for all subobjects.
1236 void Init(in boolean allLevels);
1239 \return True if the %UseCaseIterator finds one more object.
1243 Passes the iterator to the next object.
1247 Returns the %SObject corresponding to the current object found by the Iterator.
1252 //==========================================================================
1253 //==========================================================================
1254 /*! \brief Interface of the %UseCaseBuilder
1256 Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
1257 The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
1259 interface UseCaseBuilder : SALOME::GenericObj
1262 Adds to the use case an object as a child of the current object of the use case.
1264 \param theObject The added %SObject.
1265 \return True if this %SObject has been added in the use case.
1267 boolean Append(in SObject theObject);
1269 Removes an object from the use case.
1271 \param theObject The deleted %SObject
1272 \return True if this %SObject has been deleted from the use case.
1274 boolean Remove(in SObject theObject);
1276 Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
1278 boolean AppendTo(in SObject theFather, in SObject theObject);
1280 Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
1282 boolean InsertBefore(in SObject theFirst, in SObject theNext);
1284 Sets the current object of the use case.
1286 boolean SetCurrentObject(in SObject theObject);
1288 Makes the root object to be the current object of the use case.
1290 boolean SetRootCurrent();
1292 Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
1294 boolean HasChildren(in SObject theObject);
1296 Sets the name of the use case.
1298 boolean SetName(in string theName);
1300 Gets the name of the use case.
1304 Returns True if the given object <VAR>theObject</VAR> represents a use case.
1306 boolean IsUseCase(in SObject theObject);
1308 Gets the current object of the use case.
1310 SObject GetCurrentObject();
1312 Creates a new use case in the use case browser.
1314 SObject AddUseCase(in string theName);
1316 Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
1318 UseCaseIterator GetUseCaseIterator(in SObject theObject);
1320 //==========================================================================
1321 /*! \brief %Driver interface
1323 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
1324 can be called by any component and which provide the following functionality:
1326 <li> publishing in the study of the objects created by a definite component
1327 <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.
1328 <li> transforming of the transient references into persistant references (or vice versa) of the SObjects when saving (or loading) a study
1329 <li> copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study
1333 //==========================================================================
1337 /*! \brief Saving the data produced by a definite component.
1339 This method is called by the StudyManager when saving a study.
1340 \param theComponent %SComponent corresponding to this Component
1341 \param theURL The path to the file in which the data will be saved.
1342 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1343 \return A byte stream TMPFile that contains all saved data
1345 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1350 TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1352 /*! \brief Saving the data in ASCII format produced by a definite component.
1354 This method is called by the StudyManager when saving a study in ASCII format.
1355 \param theComponent %SComponent corresponding to this Component
1356 \param theURL The path to the file in which the data will be saved.
1357 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1358 \return A byte stream TMPFile that will contain all saved data
1360 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1363 TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1365 /*! \brief Loading the data.
1367 This method is called by the StudyManager when opening a study.
1368 \param theComponent %SComponent corresponding to this Component
1369 \param theStream The file which contains all data saved by the component on Save method
1370 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1374 boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1376 /*! \brief Loading the data from files in ASCII format.
1378 This method is called by the StudyManager when opening a study.
1379 \param theComponent %SComponent corresponding to this Component
1380 \param theStream The file which contains all data saved by the component on Save method
1381 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1385 boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1387 /*! \brief Closing of the study
1389 This method Close is called by the StudyManager when closing a study.
1390 \param aSComponent The according %SComponent
1393 void Close (in SComponent aSComponent);
1394 //void Close ( in string aIORSComponent);
1396 /*! Gets the type of the data
1398 \return The type of data produced by the Component in the study.
1401 string ComponentDataType();
1403 // Driver Transient -> persistent called for each object in study
1405 Transforms IOR of a given %SObject into PersistentID. It is called for each
1406 object in the %study.
1407 \note <br> In %SALOME the objects which are present in an active study are identified by an IOR, when this
1408 study is saved these references are transformed into persintent IDs.
1410 \param theSObject The given %SObject.
1411 \param IORString The IOR of the given %SObject.
1412 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1413 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1415 \return The persistent ID of the given %SObject
1418 string IORToLocalPersistentID (in SObject theSObject,
1419 in string IORString,
1420 in boolean isMultiFile,
1421 in boolean isASCII);
1423 Transforms PersistentID into IOR of the object. It is called for each
1424 object in the %study.
1426 \note <br> In %SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this
1427 study is open, these references are transformed into persintent IORs.
1429 \param theSObject The given %SObject.
1430 \param IORString The IOR of the given %SObject.
1431 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1432 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1434 \return The IOR of the given %SObject
1437 string LocalPersistentIDToIOR (in SObject theSObject,
1438 in string aLocalPersistentID,
1439 in boolean isMultiFile,
1441 raises (SALOME::SALOME_Exception);
1443 // Publishing in the study
1444 /*! Publishing in the study
1446 \return True if the given %Component can publish a definite object with a given IOR in the %study.
1447 \param theIOR The IOR of a definite object
1449 boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1450 /*! \brief Publishing in the study
1452 Publishes the given object in the %study, using the algorithm of this component.
1453 \param theStudy The %study in which the object is published
1454 \param theSObject If this parameter is null the object is published for the first time. Otherwise
1455 this parameter should contain a reference to the object published earlier
1456 \param theObject The object which is published
1457 \param theName The name of the published object. If this parameter is empty, the name is generated
1458 automatically by the component.
1460 \return The published %SObject.
1462 SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
1464 // copy/paste methods
1467 Returns True, if the given %SObject can be copied to the clipboard.
1469 \param theObject The given %SObject which should be copied.
1471 boolean CanCopy(in SObject theObject);
1473 Returns the object %ID and the %TMPFile of the object from the given %SObject.
1475 TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1477 Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1479 boolean CanPaste(in string theComponentName, in long theObjectID);
1481 Returns the %SObject of the pasted object.
1483 SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);