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;
99 void notifyObserverID(in string theID, in long event);
103 //! List of attributes of %SObjects
104 typedef sequence<GenericAttribute> ListOfAttributes;
106 //! Exception indicating that this feature hasn't been implemented in %SALOME application.
107 exception NotImplemented {};
110 //===========================================================================
111 /*! \brief %Study Interface
113 The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
114 Most of the %Study operations are handled by the StudyManager and the StudyBuilder.
115 What is left in the %Study interface are elementary inquiries.
116 (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
117 and set methods.) A %Study is explored by a set of tools, mainly iterators
118 , which are described further. Nevertheless, the %Study
119 interface allows the search of an object by name or by ID.
121 <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
122 In general it's a string of names of directories divided by a slash '/'.
123 <BR><VAR>The Context</VAR> is the current directory of an object.</P>
129 //! Invalid study context
130 exception StudyInvalidContext {};
131 //! Invalid study component
132 exception StudyInvalidComponent {};
133 //! Invalid directory of the %study exception
134 exception StudyInvalidDirectory {};
135 //! Exception pointing that this name of the study has already been used.
136 exception StudyNameAlreadyUsed {};
137 //! study object already exists
138 exception StudyObjectAlreadyExists {};
139 //! Invalid name of the %study exception
140 exception StudyNameError {};
141 //! Invalid study comment
142 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
155 typedef sequence<SObject> ListOfSObject;
156 //! Get the persistent reference to the %Study.
157 PersistentReference GetPersistentReference();
158 //! Get a transient reference to the %Study.
159 SalomeReference GetTransientReference();
161 /*! \brief indicate whether the %Study is empty
163 \return True if the %Study is empty
166 /*! \brief Find a %SComponent by its name.
168 \param aComponentName It's a string value in the Comment Attribute of the Component,
169 which is looked for, defining the data type of this Component.
171 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
174 SComponent FindComponent (in string aComponentName);
176 /*! \brief Find a %SComponent by ID of the according %SObject
178 SComponent FindComponentID(in ID aComponentID);
179 /*! \brief Find a %SObject by the Name Attribute of this %SObject
181 \param anObjectName String parameter defining the name of the object
182 \return The obtained %SObject
184 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
186 SObject FindObject (in string anObjectName);
187 /*! \brief Find a %SObject by its ID
189 \param aObjectID This parameter defines the ID of the required object
190 \return The obtained %SObject
192 SObject FindObjectID (in ID aObjectID);
193 /*! \brief Create a %SObject by its ID
195 \param aObjectID This parameter defines the ID of the required object
196 \return The created %SObject
198 SObject CreateObjectID (in ID aObjectID);
199 /*! \brief Find a %SObject by IOR of the object belonging to this %SObject.
201 \param anObjectName This parameter defines the IOR of the object
202 \return The obtained %SObject
204 SObject FindObjectIOR (in ID aObjectIOR);
205 /*! \brief Find in the study all %SObjects produced by a given %Component.
207 \param anObjectName The Name Attribute of the searched %SObjects should correspond to <VAR>anObjectName</VAR>.
208 \param aComponentName The name of the component, which objects are searched for.
210 ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName);
211 /*! \brief Find a %SObject by the path to it.
213 \param thePath The path to the required %SObject.
214 \return The obtained %SObject.
216 SObject FindObjectByPath(in string thePath);
217 /*! \brief Get the path to the %SObject.
219 string GetObjectPath(in Object theObject);
221 /*! \brief Set the context of the %Study.
223 \param thePath String parameter defining the context of the study.
225 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
227 void SetContext(in string thePath);
228 /*! \brief Get the context of the %Study.
230 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
233 /*! \brief Get a list of names of objects corresponding to the context.
235 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
237 ListOfStrings GetObjectNames(in string theContext);
238 /*! \brief Get a list of names of directories and subdirectories corresponding to the context.
240 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
242 ListOfStrings GetDirectoryNames(in string theContext);
243 /*! \brief Get a list of names of Files corresponding to the context.
245 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
247 ListOfStrings GetFileNames(in string theContext);
248 /*! \brief Get a list of names of Components corresponding to the context.
250 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
252 ListOfStrings GetComponentNames(in string theContext);
253 /*! \brief Create a new iterator of child levels of the given %SObject.
255 \param aSO The given %SObject
256 \return A new iterator of child levels of the given %SObject.
258 ChildIterator NewChildIterator(in SObject aSO);
260 /*! \brief Create a new iterator of the %SComponents.
262 \return A new iterator of the %SComponents.
264 SComponentIterator NewComponentIterator();
266 /*! \brief Create a new %StudyBuilder to add or modify an object in the study.
268 \return A new %StudyBuilder.
270 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
272 StudyBuilder NewBuilder() ;
273 /*! \brief Labels dependency
275 Updates the map with IOR attribute. It's an inner method used for optimization.
277 void UpdateIORLabelMap(in string anIOR, in string anEntry);
279 /*! \brief Getting properties of the study
281 Returns the attribute, which contains the properties of this study.
283 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
286 AttributeStudyProperties GetProperties();
287 /*! \brief Indicate whether the %study has been saved
289 attribute boolean IsSaved;
290 /*! \brief Indicate whether the %study has been modified and not saved.
292 Returns True if the %study has been modified and not saved.
294 boolean IsModified();
296 /*! \brief Mark the %study as being modified and not saved.
300 /*! \brief Indicate the file where the %study has been saved
302 attribute string URL;
304 /*! \brief List of %SObjects
306 Returns the list of %SObjects which refers to %anObject.
308 ListOfSObject FindDependances(in SObject anObject);
310 /*! \brief The date of the last saving of the study
312 Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
314 string GetLastModificationDate();
315 /*! \brief The list of modification dates of the study
317 Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
318 Note : the first modification begins the list.
320 ListOfDates GetModificationsDate();
321 /*! \brief Object conversion.
323 Converts an object into IOR.
326 string ConvertObjectToIOR(in Object theObject);
327 /*! \brief Object conversion.
329 Converts IOR into an object.
332 Object ConvertIORToObject(in string theIOR);
333 /*! \brief Get a new %UseCaseBuilder.
335 UseCaseBuilder GetUseCaseBuilder();
337 /*! \brief Close the components in the study, remove itself from the %StudyManager.
341 /*! \brief Enable (if isEnabled = True)/disable automatic addition of new %SObjects to the use case.
343 void EnableUseCaseAutoFilling(in boolean isEnabled);
346 Functions for internal usage only
348 void AddPostponed(in string theIOR);
350 void AddCreatedPostponed(in string theIOR);
352 void RemovePostponed(in long theUndoLimit);
354 void UndoPostponed(in long theWay);
356 boolean DumpStudy(in string thePath, in string theBaseName, in boolean isPublished);
358 /*! \brief Get an AttributeParameter used to store common parameters for given %theSavePoint.
360 \param theID identifies a common parameters set (Example: "Interface Applicative")
361 \param theSavePoint is number of a set of parameters as there can be several sets
363 AttributeParameter GetCommonParameters(in string theID, in long theSavePoint);
365 /*! \brief Get an AttributeParameter used to store parameters for given %theModuleName.
367 \param theID identifies a common parameters set (Example: "Interface Applicative")
368 \param theModuleName is a name of the module (Example: "Geometry")
369 \param theSavePoint is number of a set of parameters as there can be several sets
371 AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint);
374 /*! \brief Get a default Python script to restore visual parameters for given %theModuleName.
376 \param theID identifies a common parameters set (Example: "Interface Applicative")
377 \param theModuleName is a name of the module (Example: "Geometry")
379 string GetDefaultScript(in string theID, in string theModuleName);
382 Private method, returns an implementation of this Study.
383 \param theHostname is a hostname of the caller
384 \param thePID is a process ID of the caller
385 \param isLocal is set True if the Study is launched locally with the caller
387 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
390 /*! \brief Mark this Study as being locked by the given locker.
392 The lock status can be checked by method IsStudyLocked
393 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
395 void SetStudyLock(in string theLockerID);
397 /*! \brief Indicate if the Study is locked
399 Returns True if the Study was marked locked.
401 boolean IsStudyLocked();
403 /*! \brief Mark this Study as being unlocked by the given locker.
405 The lock status can be checked by method IsStudyLocked
406 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
408 void UnLockStudy(in string theLockerID);
410 /*! \brief Get the list of IDs of the Study's lockers.
412 ListOfStrings GetLockerID();
414 /*! \brief Create real variable with Name theVarName and value theValue
416 (or set if variable value into theValue already exists)
417 \param theVarName is a name of the variable
418 \param theVarName is a value of the variable.
420 void SetReal( in string theVarName, in double theValue );
422 /*! \brief Create integer variable with Name theVarName and value theValue
424 (or set if variable value into theValue already exists)
425 \param theVarName is a name of the variable
426 \param theVarName is a value of the variable.
428 void SetInteger( in string theVarName, in long theValue );
429 /*! \brief Create boolean variable with Name theVarName and value theValue
431 (or set if variable value into theValue already exists)
432 \param theVarName is a name of the variable
433 \param theVarName is a value of the variable.
435 void SetBoolean( in string theVarName, in boolean theValue );
437 /*! \brief Create string variable with Name theVarName and value theValue
439 (or set if variable value into theValue already exists)
440 \param theVarName is a name of the variable
441 \param theVarName is a value of the variable.
443 void SetString( in string theVarName, in string theValue );
445 /*! \brief Set current value as double for string variable
447 void SetStringAsDouble( in string theVarName, in double theValue );
449 /*! \brief Get value of a real variable
451 \param theVarName is a name of the variable.
453 double GetReal( in string theVarName );
455 /*! \brief Get value of an integer variable
457 \param theVarName is a name of the variable.
459 long GetInteger( in string theVarName );
461 /*! \brief Get value of a boolean variable
463 \param theVarName is a name of the variable.
465 boolean GetBoolean( in string theVarName );
467 /*! \brief Get value of a string variable
469 \param theVarName is a name of the variable.
471 string GetString( in string theVarName );
474 /*! \brief Indicate if a variable is real
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 );
481 /*! \brief Indicate if a variable is integer
483 Return true if variable is integer otherwise return false.
484 \param theVarName is a name of the variable.
486 boolean IsInteger( in string theVarName );
488 /*! \brief Indicate if a variable is boolean
490 Return true if variable is boolean otherwise return false.
491 \param theVarName is a name of the variable.
493 boolean IsBoolean( in string theVarName );
495 /*! \brief Indicate if a variable is string
497 Return true if variable is string otherwise return false.
498 \param theVarName is a name of the variable.
500 boolean IsString( in string theVarName );
502 /*! \brief Indicate if a variable exists in the study
504 Return true if variable exists in the study,
505 otherwise return false.
506 \param theVarName is a name of the variable.
508 boolean IsVariable( in string theVarName );
510 /*! \brief Get names of all variables from the study.
512 ListOfStrings GetVariableNames();
514 /*! \brief Remove a variable
516 Remove variable with the specified name from the study with substitution of its value.
518 \param theVarName Name of the variable.
519 \return Status of operation.
521 boolean RemoveVariable( in string theVarName );
523 /*! \brief Rename a variable
525 Rename variable with the specified name within the study.
527 \param theVarName Name of the variable.
528 \param theNewVarName New name for the variable.
529 \return Status of operation.
531 boolean RenameVariable( in string theVarName, in string theNewVarName );
533 /*! \brief Indicate whether variable is used
535 Check that variable is used in the study.
537 \param theVarName Name of the variable.
538 \return Variable usage.
540 boolean IsVariableUsed( in string theVarName );
542 /*! \brief Parse variables used for object creation
544 \param string with variables, separated by special symbol.
545 \return Variables list.
547 ListOfListOfStrings ParseVariables( in string theVars );
550 Attach an observer to the Study
554 void attach(in SALOMEDS::Observer theObserver, in boolean modify);
557 //==========================================================================
558 /*! \brief %Study Builder Interface
560 The purpose of the Builder is to add and/or remove objects and attributes.
561 A %StudyBuilder is linked to a %Study. A
562 command management is provided for the undo/redo functionalities.
564 <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
565 item's position in the tree-type structure of the browser. In general it has the following
566 form: <TT>0:2:1:1</TT>
568 //==========================================================================
570 interface StudyBuilder
572 /*! \brief %LockProtection Exception
574 This exception is raised while attempting to modify a locked %study.
576 exception LockProtection {};
577 /*! \brief Creation of a new %SComponent.
579 Creates a new %SComponent
580 \param ComponentDataType Data type of the %SComponent which will be created.
582 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
585 SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
586 /*! \brief Definition of the instance to the %SComponent
588 Defines the instance to the %SComponent.
590 void DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
592 /*! \brief Deletion of a %SComponent
594 Removes a %SComponent.
596 void RemoveComponent(in SComponent aComponent) raises(LockProtection);
598 /*! \brief Creation of a new %SObject
600 Creates a new %SObject under a definite father %SObject.
602 \param theFatherObject The father %SObject under which this one should be created.
605 <em>See \ref example18 for an example of this method usage in batchmode of %SALOME application.</em>
609 SObject NewObject (in SObject theFatherObject) raises(LockProtection);
611 /*! \brief Creation of a new %SObject with a definite %tag
613 Creates a new %SObject with a definite %tag.
615 \param atag Long value corresponding to the tag of the new %SObject.
619 SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
620 /*! \brief Deletion of the %SObject
622 Removes a %SObject from the %StudyBuilder.
624 \param anObject The %SObject to be deleted.
626 void RemoveObject (in SObject anObject) raises(LockProtection);
627 /*! \brief Deletion of the %SObject with all his child objects.
629 Removes the %SObject with all his child objects.
631 \param anObject The %SObject to be deleted with all child objects.
633 void RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
638 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
641 void LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
645 \param sco %SObject to be loaded.
647 void Load (in SObject sco);
649 /*! \brief Looking for or creating an attribute assigned to the %SObject
651 Allows to find or create 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.
655 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
658 GenericAttribute FindOrCreateAttribute(in SObject anObject,
659 in string aTypeOfAttribute) raises(LockProtection);
661 /*! \brief Looking for an attribute assigned to a %SObject
663 Allows to find an attribute of a specific type which is assigned to the object.
664 \param anObject The %SObject corresponding to the attribute which is looked for.
665 \param aTypeOfAttribute Type of the attribute.
666 \param anAttribute Where the attribute is placed if it's found.
667 \return True if it finds an attribute.
670 boolean FindAttribute(in SObject anObject,
671 out GenericAttribute anAttribute,
672 in string aTypeOfAttribute);
673 /*! \brief Deleting the attribute assigned to the %SObject
675 Removes the attribute of a specific type which is assigned to the object.
676 \param anObject The %SObject corresponding to the attribute.
677 \param aTypeOfAttribute Type of the attribute.
679 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
681 void RemoveAttribute(in SObject anObject,
682 in string aTypeOfAttribute) raises(LockProtection);
684 Adds a reference between %anObject and %theReferencedObject.
685 \param anObject The %SObject which will get a reference
686 \param theReferencedObject The %SObject having a reference
689 void Addreference(in SObject anObject,
690 in SObject theReferencedObject) ;
693 Removes a reference from %anObject to another object.
694 \param anObject The %SObject which contains a reference
697 void RemoveReference(in SObject anObject) ;
700 Adds a directory in the %Study.
701 \param theName String parameter defining the name of the directory.
703 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
706 void AddDirectory(in string theName) raises(LockProtection);
708 /*! \brief Identification of the %SObject's substructure.
710 Identification of the %SObject's substructure by GUID.
713 \param anObject The %SObject which will be identified
714 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
717 void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
719 Searches for a definite %SObject with a definite GUID and returns True if it finds it.
721 \param anObject A definite %SObject which will be identified
722 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
724 boolean IsGUID(in SObject anObject, in string theGUID);
726 /*! \brief Creation of a new command
728 Creates a new command which can contain several different actions.
730 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
733 void NewCommand(); // command management
734 /*! \brief Execution of the command
736 Commits all actions declared within this command.
738 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
740 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
743 void CommitCommand() raises(LockProtection); // command management
745 Returns True if at this moment there is a command under execution.
747 boolean HasOpenCommand();
748 /*! \brief Cancelation of the command
750 Cancels all actions declared within the command.
752 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
754 void AbortCommand(); // command management
757 The number of actions which can be undone
759 attribute long UndoLimit;
760 /*! \brief Undo method
762 Cancels all actions of the last command.
764 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
766 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
769 void Undo() raises (LockProtection);
770 /*! \brief Redo method
772 Redoes all actions of the last command.
774 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
776 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
779 void Redo() raises (LockProtection);
781 Returns True if at this moment there are any actions which can be canceled.
783 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
786 boolean GetAvailableUndos();
788 Returns True if at this moment there are any actions which can be redone.
790 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
793 boolean GetAvailableRedos();
795 Puts name attribute with the given string value to the given %SObject
797 \param theSO Existing SObject to set name attribute.
798 \param theValue The value to be set to the name attribute.
800 void SetName(in SObject theSO, in string theValue) raises (LockProtection);
803 Puts comment attribute with the given string value to the given %SObject
805 \param theSO Existing SObject to set comment attribute.
806 \param theValue The value to be set to the comment attribute.
808 void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
811 Puts IOR attribute with the given string value to the given %SObject
813 \param theSO Existing SObject to set IOR attribute.
814 \param theValue The value to be set to the IOR attribute.
816 void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
819 //==========================================================================
820 /*! \brief %Study Manager interface
822 The purpose of the Manager is to manipulate the %Studies. You will find in this
823 interface the methods to create, open,
824 close, and save a %Study. Since a %SALOME session is multi-document, you will
825 also find the methods allowing to navigate
826 through the collection of studies present in a session.
828 //==========================================================================
830 interface StudyManager
833 Determines whether the server has already been loaded or not.
840 Returns the PID of the server
845 Shutdown the StudyManager process.
847 oneway void ShutdownWithExit();
849 /*! \brief Creation of a new study
851 Creates a new study with a definite name.
853 \param study_name String parameter defining the name of the study
855 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
858 Study NewStudy(in string study_name);
860 /*! \brief Open a study
862 Reads and activates the structure of the study %Objects.
863 \param aStudyUrl The path to the study
864 \warning This method doesn't activate the corba objects. Only a component can do it.
866 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
868 Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
870 /*! \brief Closing the study
874 void Close(in Study aStudy);
875 /*! \brief Saving the study in a HDF file (or files).
879 \param theMultiFile If this parameter is True the study will be saved in several files.
881 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
884 boolean Save(in Study aStudy, in boolean theMultiFile);
885 /*! \brief Saving a study in a ASCII file (or files).
887 Saves a study in an ASCII format file (or files).
888 \param theMultiFile If this parameter is True the study will be saved in several files.
890 boolean SaveASCII(in Study aStudy, in boolean theMultiFile);
891 /*! \brief Saving the study in a specified HDF file (or files).
893 Saves the study in a specified file (or files).
894 \param aUrl The path to the definite file in whcih the study will be saved
895 \param aStudy The study which will be saved
896 \param theMultiFile If this parameter is True the study will be saved in several files.
898 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
900 boolean SaveAs(in URL aUrl, // if the file already exists
902 in boolean theMultiFile); // overwrite (as option)
903 /*! \brief Saving the study in a specified ASCII file (or files).
905 Saves the study in a specified ASCII file (or files).
907 \param aUrl The path to the definite file in whcih the study will be saved
908 \param aStudy The study which will be saved
909 \param theMultiFile If this parameter is True the study will be saved in several files.
911 boolean SaveAsASCII(in URL aUrl, // if the file already exists
913 in boolean theMultiFile); // overwrite (as option)
916 /*! \brief List of open studies.
918 Gets the list of open studies
920 \return A list of open studies in the current session.
922 ListOfOpenStudies GetOpenStudies();
924 /*! \brief Getting a particular %Study picked by name
926 Activates a particular %Study
927 among the session collection picking it by name.
928 \param aStudyName The name of the study
930 Study GetStudyByName (in string aStudyName);
932 /*! \brief Getting a particular %Study picked by ID
934 Activates a particular %Study
935 among the session collection picking it by ID.
936 \param aStudyID The ID of the study
938 Study GetStudyByID (in short aStudyID);
940 // copy/paste methods
943 Returns True, if the given %SObject can be copied to the clipboard.
945 boolean CanCopy(in SObject theObject);
947 Returns True, if the given %SObject is copied to the clipboard.
948 \param theObject The %SObject which will be copied
950 boolean Copy(in SObject theObject);
952 Returns True, if the object from the clipboard can be pasted to the given %SObject.
953 \param theObject The %SObject stored in the clipboard.
955 boolean CanPaste(in SObject theObject);
957 Returns the %SObject in which the object from the clipboard was pasted to.
958 \param theObject The %SObject which will be pasted
959 \exception SALOMEDS::StudyBuilder::LockProtection This exception is raised, when trying to paste
960 an object into a study, which is protected for modifications.
962 SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
964 /*! \brief Object conversion.
966 Converts an object into IOR.
969 string ConvertObjectToIOR(in Object theObject);
970 /*! \brief Object conversion.
972 Converts IOR into an object.
975 Object ConvertIORToObject(in string theIOR);
978 Private method, returns an implementation of this StudyManager.
979 \param theHostname is a hostname of the caller
980 \param thePID is a process ID of the caller
981 \param isLocal is set True if the StudyManager is launched locally with the caller
983 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
989 //==========================================================================
990 /*! \brief %SObject interface
992 The objects in the %study are built by the %StudyBuilder. The %SObject interface
993 provides methods for elementary inquiries, like getting an object %ID or its attribuites.
996 <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
997 in the tree-type data structure.
998 <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
999 ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
1001 //==========================================================================
1003 interface SObject : SALOME::GenericObj
1005 /*! Name of the %SObject
1007 attribute string Name; // equivalent to setName() & getName()
1008 /*! Gets an object %ID
1010 \return ID of the %SObject.
1013 /*! Acquisition of the father %Component of the %SObject
1015 \return The father %Component of the %SObject.
1017 SComponent GetFatherComponent();
1018 /*! Acquisition of the father %SObject of the %SObject
1020 \return the father %SObject of the given %SObject.
1022 SObject GetFather();
1023 /*! Gets the %tag of a %SObject
1025 \return the %tag of a %SObject.
1028 /*! Gets the depth of a %SObject
1030 \return the depth of a %SObject.
1033 /*! Looks for subobjects of a given %SObject.
1035 \param atag Tag of the given %SObject
1036 \return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
1039 boolean FindSubObject (in long atag, out SObject obj);
1040 /*! Looks for attributes of a given %SObject
1042 \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
1043 \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
1045 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1047 boolean FindAttribute(out GenericAttribute anAttribute,
1048 in string aTypeOfAttribute);
1049 /*! Looks for a %SObject which the given %SObject refers to.
1051 \return The object which the given %SObject refers to as well as True if it finds
1054 boolean ReferencedObject(out SObject obj); // A REVOIR
1055 /*! Gets all attributes of a given %SObject
1057 \return The list of all attributes of the given %SObject.
1059 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
1062 ListOfAttributes GetAllAttributes();
1063 /*! Gets the study of a given %SObject.
1065 \return The study containing the given %SObject.
1069 /*! Gets the CORBA object by its own IOR attribute.
1070 Returns nil, if can't.
1072 \return The CORBA object of the %SObject.
1077 Returns the name attribute value of this SObject.
1078 Returns empty string if there is no name attribute.
1083 Returns the comment attribute value of this SObject.
1084 Returns empty string if there is no comment attribute.
1086 string GetComment();
1089 Returns the IOR attribute value of this SObject.
1090 Returns empty string if there is no IOR attribute.
1095 Set an attribute value (of type string)
1096 \param name the name of the attribute
1097 \param value the value of the attribute
1099 void SetAttrString(in string name, in string value);
1102 Private method, returns an implementation of this SObject.
1103 \param theHostname is a hostname of the caller
1104 \param thePID is a process ID of the caller
1105 \param isLocal is set True if the SObject is launched locally with the caller
1107 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1111 //==========================================================================
1112 /*! \brief %Generic attribute interface
1114 %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
1116 //==========================================================================
1117 interface GenericAttribute : SALOME::GenericObj
1119 /*! \brief Exception locking all changes
1121 This exception locks all modifications in attributes.
1123 exception LockProtection {};
1124 /*! \brief Method CheckLocked
1126 Checks whether the %Study is protected for modifications.
1128 \note <BR>This exception is raised only outside a transaction.
1130 void CheckLocked() raises (LockProtection);
1135 //! Get the class type
1136 string GetClassType();
1139 SObject GetSObject();
1141 //! Private method, returns an implementation of this GenericAttribute.
1143 \param theHostname is a hostname of the caller
1144 \param thePID is a process ID of the caller
1145 \param isLocal is set True if the GenericAttribute is launched locally with the caller
1147 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1152 //==========================================================================
1153 /*! \brief %SComponent interface
1155 The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
1156 The %SComponent interface is a specialization of the %SObject interface.
1157 It inherits the most of its methods from the %SObject interface.
1159 //==========================================================================
1160 interface SComponent : SObject
1162 /*! \brief Gets the data type of the given %SComponent
1164 \return The data type of this %SComponent.
1166 string ComponentDataType();
1167 /*! \brief Gets the IOR of the given component
1169 \return True (if there is an instance of the given component) and its IOR.
1171 boolean ComponentIOR (out ID theID); //returns True if there is an instance
1172 //In this case ID identifies this one
1176 //==========================================================================
1177 /*! \brief %SComponentIterator interface
1179 This interface contains the methods allowing to iterate over all components in the list.
1180 The search is started from the first %SComponent in the list.
1182 //==========================================================================
1183 interface SComponentIterator : SALOME::GenericObj
1186 \brief Activates the %SComponentIterator.
1189 /*! \brief Method More
1191 \return True if there is one more %SComponent in the list.
1195 \brief Moves the iterator to the next %SComponent in the list.
1199 \brief Returns the %SComponent corresponding to the current %SComponent found by the iterator.
1201 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1207 //==========================================================================
1208 /*! \brief %ChildIterator interface
1210 This interface contains methods which allow to iterate over all child
1213 //==========================================================================
1214 interface ChildIterator : SALOME::GenericObj
1218 \brief Activates the %ChildIterator.
1223 \brief Activates the %ChildIterator for all child levels.
1225 \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels.
1227 void InitEx(in boolean allLevels);
1228 /*! \brief Method More
1230 \return True if there is one more %ChildIterator in the list.
1234 \brief Passes the iterator to the next level.
1238 \brief Returns the %SObject corresponding to the current object found by the iterator.
1243 //==========================================================================
1244 //==========================================================================
1245 /*! \brief Interface of the %UseCaseIterator.
1247 This interface contains a set of methods used for iteration over the objects in the use case.
1249 interface UseCaseIterator : SALOME::GenericObj
1252 Activates the %UseCaseIterator.
1253 \param allLevels If the value of this parameter is True the Iterator is activated for all subobjects.
1255 void Init(in boolean allLevels);
1258 \return True if the %UseCaseIterator finds one more object.
1262 Passes the iterator to the next object.
1266 Returns the %SObject corresponding to the current object found by the Iterator.
1271 //==========================================================================
1272 //==========================================================================
1273 /*! \brief Interface of the %UseCaseBuilder
1275 Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
1276 The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
1278 interface UseCaseBuilder : SALOME::GenericObj
1281 Adds to the use case an object as a child of the current object of the use case.
1283 \param theObject The added %SObject.
1284 \return True if this %SObject has been added in the use case.
1286 boolean Append(in SObject theObject);
1288 Removes an object from the use case.
1290 \param theObject The deleted %SObject
1291 \return True if this %SObject has been deleted from the use case.
1293 boolean Remove(in SObject theObject);
1295 Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
1297 boolean AppendTo(in SObject theFather, in SObject theObject);
1299 Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
1301 boolean InsertBefore(in SObject theFirst, in SObject theNext);
1303 Sets the current object of the use case.
1305 boolean SetCurrentObject(in SObject theObject);
1307 Makes the root object to be the current object of the use case.
1309 boolean SetRootCurrent();
1311 Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
1313 boolean HasChildren(in SObject theObject);
1315 Sets the name of the use case.
1317 boolean SetName(in string theName);
1319 Gets the name of the use case.
1323 Returns True if the given object <VAR>theObject</VAR> represents a use case.
1325 boolean IsUseCase(in SObject theObject);
1327 Gets the current object of the use case.
1329 SObject GetCurrentObject();
1331 Creates a new use case in the use case browser.
1333 SObject AddUseCase(in string theName);
1335 Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
1337 UseCaseIterator GetUseCaseIterator(in SObject theObject);
1339 //==========================================================================
1340 /*! \brief %Driver interface
1342 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
1343 can be called by any component and which provide the following functionality:
1345 <li> publishing in the study of the objects created by a definite component
1346 <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.
1347 <li> transforming of the transient references into persistant references (or vice versa) of the SObjects when saving (or loading) a study
1348 <li> copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study
1352 //==========================================================================
1356 /*! \brief Saving the data produced by a definite component.
1358 This method is called by the StudyManager when saving a study.
1359 \param theComponent %SComponent corresponding to this Component
1360 \param theURL The path to the file in which the data will be saved.
1361 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1362 \return A byte stream TMPFile that contains all saved data
1364 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1369 TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1371 /*! \brief Saving the data in ASCII format produced by a definite component.
1373 This method is called by the StudyManager when saving a study in ASCII format.
1374 \param theComponent %SComponent corresponding to this Component
1375 \param theURL The path to the file in which the data will be saved.
1376 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1377 \return A byte stream TMPFile that will contain all saved data
1379 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1382 TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1384 /*! \brief Loading the data.
1386 This method is called by the StudyManager when opening a study.
1387 \param theComponent %SComponent corresponding to this Component
1388 \param theStream The file which contains all data saved by the component on Save method
1389 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1393 boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1395 /*! \brief Loading the data from files in ASCII format.
1397 This method is called by the StudyManager when opening a study.
1398 \param theComponent %SComponent corresponding to this Component
1399 \param theStream The file which contains all data saved by the component on Save method
1400 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1404 boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1406 /*! \brief Closing of the study
1408 This method Close is called by the StudyManager when closing a study.
1409 \param aSComponent The according %SComponent
1412 void Close (in SComponent aSComponent);
1413 //void Close ( in string aIORSComponent);
1415 /*! Gets the type of the data
1417 \return The type of data produced by the Component in the study.
1420 string ComponentDataType();
1422 // Driver Transient -> persistent called for each object in study
1424 Transforms IOR of a given %SObject into PersistentID. It is called for each
1425 object in the %study.
1426 \note <br> In %SALOME the objects which are present in an active study are identified by an IOR, when this
1427 study is saved these references are transformed into persintent IDs.
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 persistent ID of the given %SObject
1437 string IORToLocalPersistentID (in SObject theSObject,
1438 in string IORString,
1439 in boolean isMultiFile,
1440 in boolean isASCII);
1442 Transforms PersistentID into IOR of the object. It is called for each
1443 object in the %study.
1445 \note <br> In %SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this
1446 study is open, these references are transformed into persintent IORs.
1448 \param theSObject The given %SObject.
1449 \param IORString The IOR of the given %SObject.
1450 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1451 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1453 \return The IOR of the given %SObject
1456 string LocalPersistentIDToIOR (in SObject theSObject,
1457 in string aLocalPersistentID,
1458 in boolean isMultiFile,
1460 raises (SALOME::SALOME_Exception);
1462 // Publishing in the study
1463 /*! Publishing in the study
1465 \return True if the given %Component can publish a definite object with a given IOR in the %study.
1466 \param theIOR The IOR of a definite object
1468 boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1469 /*! \brief Publishing in the study
1471 Publishes the given object in the %study, using the algorithm of this component.
1472 \param theStudy The %study in which the object is published
1473 \param theSObject If this parameter is null the object is published for the first time. Otherwise
1474 this parameter should contain a reference to the object published earlier
1475 \param theObject The object which is published
1476 \param theName The name of the published object. If this parameter is empty, the name is generated
1477 automatically by the component.
1479 \return The published %SObject.
1481 SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
1483 // copy/paste methods
1486 Returns True, if the given %SObject can be copied to the clipboard.
1488 \param theObject The given %SObject which should be copied.
1490 boolean CanCopy(in SObject theObject);
1492 Returns the object %ID and the %TMPFile of the object from the given %SObject.
1494 TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1496 Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1498 boolean CanPaste(in string theComponentName, in long theObjectID);
1500 Returns the %SObject of the pasted object.
1502 SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);