1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SALOMEDS.idl
23 // Author : Yves FRICAUD
27 \file SALOMEDS.idl This file contains a set of interfaces used for creation, managment
28 and modification of the %Study
31 #ifndef _SALOMEDS_IDL_
32 #define _SALOMEDS_IDL_
34 #include "SALOME_Exception.idl"
35 #include "SALOME_GenericObj.idl"
38 This package contains the interfaces used for creation, managment
39 and modification of the %Study
44 Name of the file in which the %Study is saved.
49 /*! Main identifier of an object in %SALOME application
53 /*! While saving the data, IOR is transformed into persistent reference
55 typedef string PersistentReference;
57 /*! IOR of the study in %SALOME application
59 typedef string SalomeReference;
61 /*! List of the names of studies which are currently open in this %SALOME session.
62 Since %SALOME is a multi-study application, it allows to open a lot of studies
63 during each working session.
65 typedef sequence<string> ListOfOpenStudies;
66 /*! List of file names
68 typedef sequence<string> ListOfFileNames;
69 /*! List of modification dates of a study
71 typedef sequence<string> ListOfDates ;
72 /*! An unbounded sequence of strings
74 typedef sequence<string> ListOfStrings ;
75 /*! A byte stream which is used for binary data transfer between different components
77 typedef sequence<octet> TMPFile;
79 // Reference to other objects is treated with function AddReference
80 // and ReferencedObject
81 // All other type of attributes defined in AttributeType enum are
82 // treated with AddAdttribute and GetAttribute
83 // The difference is made because Reference attribute don't contain
84 // strings but reference to ID of other objects
86 interface GenericAttribute;
88 interface StudyManager;
89 interface StudyBuilder;
92 interface SComponentIterator;
93 interface ChildIterator;
95 interface AttributeStudyProperties;
96 interface AttributeParameter;
97 interface UseCaseIterator;
98 interface UseCaseBuilder;
100 /*! List of attributes of %SObjects
102 typedef sequence<GenericAttribute> ListOfAttributes;
104 /*! Exception indicating that this feature hasn't been implemented in %SALOME PRO application.
106 exception NotImplemented {};
109 //===========================================================================
110 /*! \brief %Study Interface
112 The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
113 Most of the %Study operations are handled by the StudyManager and the StudyBuilder.
114 What is left in the %Study interface are elementary inquiries.
115 (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
116 and set methods.) A %Study is explored by a set of tools, mainly iterators
117 , which are described further. Nevertheless, the %Study
118 interface allows the search of an object by name or by ID.
120 <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
121 In general it's a string of names of directories divided by a slash '/'.
122 <BR><VAR>The Context</VAR> is the current directory of an object.</P>
128 exception StudyInvalidContext {};
129 exception StudyInvalidComponent {};
130 /*! Invalid directory of the %study exception
132 exception StudyInvalidDirectory {};
133 /*! Exception pointing that this name of the study has already been used.
135 exception StudyNameAlreadyUsed {};
136 exception StudyObjectAlreadyExists {};
137 /*! Invalid name of the %study exception
139 exception StudyNameError {};
140 exception StudyCommentError {};
141 /*! \brief The name of the %Study
143 This is equivalent to the methods setName() & getName()
145 attribute string Name; // equivalent to setName() & getName()
146 /*! \brief The ID of the %Study
148 This is equivalent to the methods setID() & getID()
150 attribute short StudyId;
151 /*! Sequence containing %SObjects
153 typedef sequence<SObject> ListOfSObject;
155 Gets the persistent reference to the %Study.
157 PersistentReference GetPersistentReference();
159 Gets a transient reference to the %Study.
161 SalomeReference GetTransientReference();
164 Returns True if the %Study is empty
168 Allows to find a %SComponent by its name.
169 \param aComponentName It's a string value in the Comment Attribute of the Component,
170 which is looked for, defining the data type of this Component.
172 <BR><VAR>See also <A href="exemple/Example1.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
174 SComponent FindComponent (in string aComponentName);
176 Allows to find a %SComponent by ID of the according %SObject
178 SComponent FindComponentID(in ID aComponentID);
180 Allows to find a %SObject by the Name Attribute of this %SObject
182 \param anObjectName String parameter defining the name of the object
183 \return The obtained %SObject
185 <BR><VAR>See also <A href="exemple/Example19.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
188 SObject FindObject (in string anObjectName);
190 Allows to find a %SObject by its ID
191 \param aObjectID This parameter defines the ID of the required object
192 \return The obtained %SObject
195 SObject FindObjectID (in ID aObjectID);
197 Allows to create a %SObject by its ID
198 \param aObjectID This parameter defines the ID of the required object
199 \return The created %SObject
202 SObject CreateObjectID (in ID aObjectID);
204 Allows to find a %SObject by IOR of the object belonging to this %SObject.
205 \param anObjectName This parameter defines the IOR of the object
206 \return The obtained %SObject
209 SObject FindObjectIOR (in ID aObjectIOR);
211 Finds in the study all %SObjects produced by a given %Component.
212 \param anObjectName The Name Attribute of the searched %SObjects should correspond to <VAR>anObjectName</VAR>.
213 \param aComponentName The name of the component, which objects are searched for.
215 ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName);
217 Allows to find a %SObject by the path to it.
219 \param thePath The path to the required %SObject.
220 \return The obtained %SObject.
223 SObject FindObjectByPath(in string thePath);
225 Returns the path to the %SObject.
227 string GetObjectPath(in Object theObject);
230 Sets the context of the %Study.
231 \param thePath String parameter defining the context of the study.
233 <BR><VAR>See also <A href="exemple/Example23.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
236 void SetContext(in string thePath);
238 Gets the context of the %Study.
240 <BR><VAR>See also <A href="exemple/Example23.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
245 Returns a list of names of objects corresponding to the context.
246 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
248 ListOfStrings GetObjectNames(in string theContext);
250 Returns a list of names of directories and subdirectories corresponding to the context.
251 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
253 ListOfStrings GetDirectoryNames(in string theContext);
255 Returns a list of names of Files corresponding to the context.
256 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
258 ListOfStrings GetFileNames(in string theContext);
260 Returns a list of names of Components corresponding to the context.
261 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
263 ListOfStrings GetComponentNames(in string theContext);
265 Creates a new iterator of child levels of the given %SObject.
266 \param aSO The given %SObject
267 \return A new iterator of child levels of the given %SObject.
269 ChildIterator NewChildIterator(in SObject aSO);
272 Creates a new iterator of the %SComponents.
274 \return A new iterator of the %SComponents.
276 SComponentIterator NewComponentIterator();
278 Creates a new %StudyBuilder to add or modify an object in the study.
280 \return A new %StudyBuilder.
282 <BR><VAR>See also <A href="exemple/Example20.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
285 StudyBuilder NewBuilder() ;
286 /*! \brief Labels dependency
288 Updates the map with IOR attribute. It's an inner method used for optimization.
290 void UpdateIORLabelMap(in string anIOR, in string anEntry);
292 /*! \brief Getting properties of the study
294 Returns the attriubte, which contains the properties of this study.
296 <BR><VAR>See also <A href="exemple/Example20.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
299 AttributeStudyProperties GetProperties();
301 Determines whether the %study has been saved
303 attribute boolean IsSaved;
305 Returns True if the %study has been modified and not saved.
307 boolean IsModified();
310 Marks the %study as being modified and not saved.
315 Determines the file where the %study has been saved
317 attribute string URL;
319 /*! \brief List of %SObjects
321 Returns the list of %SObjects which refers to %anObject.
323 ListOfSObject FindDependances(in SObject anObject);
325 /*! \brief The date of the last saving of the study
327 Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
329 string GetLastModificationDate();
330 /*! \brief The list of modification dates of the study
332 Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
333 Note : the first modification begins the list.
335 ListOfDates GetModificationsDate();
336 /*! \brief Object conversion.
338 Converts an object into IOR.
341 string ConvertObjectToIOR(in Object theObject);
342 /*! \brief Object conversion.
344 Converts IOR into an object.
347 Object ConvertIORToObject(in string theIOR);
349 Gets a new %UseCaseBuilder.
351 UseCaseBuilder GetUseCaseBuilder();
354 Closes the components in the study, removes itself from the %StudyManager.
359 Enables(if isEnabled = True)/disables automatic addition of new %SObjects to the use case.
361 void EnableUseCaseAutoFilling(in boolean isEnabled);
364 Functions for internal usage only
366 void AddPostponed(in string theIOR);
368 void AddCreatedPostponed(in string theIOR);
370 void RemovePostponed(in long theUndoLimit);
372 void UndoPostponed(in long theWay);
374 boolean DumpStudy(in string thePath, in string theBaseName, in boolean isPublished);
377 Returns an AttributeParameter used to store common parameters for given %theSavePoint.
378 \param theID identifies a common parameters set (Example: "Interface Applicative")
379 \param theSavePoint is number of a set of parameters as there can be several sets
381 AttributeParameter GetCommonParameters(in string theID, in long theSavePoint);
384 Returns an AttributeParameter used to store parameters for given %theModuleName.
385 \param theID identifies a common parameters set (Example: "Interface Applicative")
386 \param theModuleName is a name of the module (Example: "Geometry")
387 \param theSavePoint is number of a set of parameters as there can be several sets
389 AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint);
393 Returns a default Python script to restore visual parameters for given %theModuleName.
394 \param theID identifies a common parameters set (Example: "Interface Applicative")
395 \param theModuleName is a name of the module (Example: "Geometry")
397 string GetDefaultScript(in string theID, in string theModuleName);
400 Private method, returns an implementation of this Study.
401 \param theHostname is a hostname of the caller
402 \param thePID is a process ID of the caller
403 \param isLocal is set True if the Study is launched locally with the caller
405 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
409 Marks this Study as being locked by the given locker. The lock status can be checked by method IsStudyLocked
410 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
412 void SetStudyLock(in string theLockerID);
415 Returns True if the Study was marked locked.
417 boolean IsStudyLocked();
420 Marks this Study as being unlocked by the given locker. The lock status can be checked by method IsStudyLocked
421 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
423 void UnLockStudy(in string theLockerID);
426 Returns the list iof IDs of the Study's lockers.
428 ListOfStrings GetLockerID();
433 //==========================================================================
434 /*! \brief %Study Builder Interface
436 The purpose of the Builder is to add and/or remove objects and attributes.
437 A %StudyBuilder is linked to a %Study. A
438 command management is provided for the undo/redo functionalities.
440 <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
441 item's position in the tree-type structure of the browser. In general it has the following
442 form: <TT>0:2:1:1</TT>
444 //==========================================================================
446 interface StudyBuilder
448 /*! \brief %LockProtection Exception
450 This exception is raised while attempting to modify a locked %study.
452 exception LockProtection {};
453 /*! \brief Creation of a new %SComponent.
455 Creates a new %SComponent
456 \param ComponentDataType Data type of the %SComponent which will be created.
458 <BR><VAR>See also <A href="exemple/Example17.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
461 SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
462 /*! \brief Definition of the instance to the %SComponent
464 Defines the instance to the %SComponent.
466 void DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
468 /*! \brief Deletion of a %SComponent
470 Removes a %SComponent.
472 void RemoveComponent(in SComponent aComponent) raises(LockProtection);
474 /*! \brief Creation of a new %SObject
476 Creates a new %SObject under a definite father %SObject.
478 \param theFatherObject The father %SObject under which this one should be created.
481 <BR><VAR>See also <A href="exemple/Example18.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
485 SObject NewObject (in SObject theFatherObject) raises(LockProtection);
487 /*! \brief Creation of a new %SObject with a definite %tag
489 Creates a new %SObject with a definite %tag.
491 \param atag Long value corresponding to the tag of the new %SObject.
495 SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
496 /*! \brief Deletion of the %SObject
498 Removes a %SObject from the %StudyBuilder.
500 \param anObject The %SObject to be deleted.
502 void RemoveObject (in SObject anObject) raises(LockProtection);
503 /*! \brief Deletion of the %SObject with all his child objects.
505 Removes the %SObject with all his child objects.
507 \param anObject The %SObject to be deleted with all child objects.
509 void RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
514 <BR><VAR>See also <A href="exemple/Example19.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
517 void LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
521 \param sco %SObject to be loaded.
523 void Load (in SObject sco);
525 /*! \brief Looking for or creating an attribute assigned to the %SObject
527 Allows to find or create an attribute of a specific type which is assigned to the object.
528 \param anObject The %SObject corresponding to the attribute which is looked for.
529 \param aTypeOfAttribute Type of the attribute.
531 <BR><VAR>See also <A href="exemple/Example1.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
534 GenericAttribute FindOrCreateAttribute(in SObject anObject,
535 in string aTypeOfAttribute) raises(LockProtection);
537 /*! \brief Looking for an attribute assigned to a %SObject
539 Allows to find an attribute of a specific type which is assigned to the object.
540 \param anObject The %SObject corresponding to the attribute which is looked for.
541 \param aTypeOfAttribute Type of the attribute.
542 \param anAttribute Where the attribute is placed if it's found.
543 \return True if it finds an attribute.
546 boolean FindAttribute(in SObject anObject,
547 out GenericAttribute anAttribute,
548 in string aTypeOfAttribute);
549 /*! \brief Deleting the attribute assigned to the %SObject
551 Removes the attribute of a specific type which is assigned to the object.
552 \param anObject The %SObject corresponding to the attribute.
553 \param aTypeOfAttribute Type of the attribute.
555 <BR><VAR>See also <A href="exemple/Example17.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
557 void RemoveAttribute(in SObject anObject,
558 in string aTypeOfAttribute) raises(LockProtection);
560 Adds a reference between %anObject and %theReferencedObject.
561 \param anObject The %SObject which will get a reference
562 \param theReferencedObject The %SObject having a reference
565 void Addreference(in SObject anObject,
566 in SObject theReferencedObject) ;
569 Removes a reference from %anObject to another object.
570 \param anObject The %SObject which contains a reference
573 void RemoveReference(in SObject anObject) ;
576 Adds a directory in the %Study.
577 \param theName String parameter defining the name of the directory.
579 <BR><VAR>See also <A href="exemple/Example23.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
582 void AddDirectory(in string theName) raises(LockProtection);
584 /*! \brief Identification of the %SObject's substructure.
586 Identification of the %SObject's substructure by GUID.
589 \param anObject The %SObject which will be identified
590 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
593 void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
595 Searches for a definite %SObject with a definite GUID and returns True if it finds it.
597 \param anObject A definite %SObject which will be identified
598 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
600 boolean IsGUID(in SObject anObject, in string theGUID);
602 /*! \brief Creation of a new command
604 Creates a new command which can contain several different actions.
606 <BR><VAR>See also <A href="exemple/Example3.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
609 void NewCommand(); // command management
610 /*! \brief Execution of the command
612 Commits all actions declared within this command.
614 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
616 <BR><VAR>See also <A href="exemple/Example16.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
619 void CommitCommand() raises(LockProtection); // command management
621 Returns True if at this moment there is a command under execution.
623 boolean HasOpenCommand();
624 /*! \brief Cancelation of the command
626 Cancels all actions declared within the command.
628 <BR><VAR>See also <A href="exemple/Example17.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
630 void AbortCommand(); // command management
633 The number of actions which can be undone
635 attribute long UndoLimit;
636 /*! \brief Undo method
638 Cancels all actions of the last command.
640 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
642 <BR><VAR>See also <A href="exemple/Example16.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
645 void Undo() raises (LockProtection);
646 /*! \brief Redo method
648 Redoes all actions of the last command.
650 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
652 <BR><VAR>See also <A href="exemple/Example16.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
655 void Redo() raises (LockProtection);
657 Returns True if at this moment there are any actions which can be canceled.
659 <BR><VAR>See also <A href="exemple/Example16.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
662 boolean GetAvailableUndos();
664 Returns True if at this moment there are any actions which can be redone.
666 <BR><VAR>See also <A href="exemple/Example3.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
669 boolean GetAvailableRedos();
671 Puts name attribute with the given string value to the given %SObject
673 \param theSO Existing SObject to set name attribute.
674 \param theValue The value to be set to the name attribute.
676 void SetName(in SObject theSO, in string theValue) raises (LockProtection);
679 Puts comment attribute with the given string value to the given %SObject
681 \param theSO Existing SObject to set comment attribute.
682 \param theValue The value to be set to the comment attribute.
684 void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
687 Puts IOR attribute with the given string value to the given %SObject
689 \param theSO Existing SObject to set IOR attribute.
690 \param theValue The value to be set to the IOR attribute.
692 void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
695 //==========================================================================
696 /*! \brief %Study Manager interface
698 The purpose of the Manager is to manipulate the %Studies. You will find in this
699 interface the methods to create, open,
700 close, and save a %Study. Since a %SALOME session is multi-document, you will
701 also find the methods allowing to navigate
702 through the collection of studies present in a session.
704 //==========================================================================
706 interface StudyManager
709 Determines whether the server has already been loaded or not.
716 Returns the PID of the server
721 Shutdown the StudyManager process.
723 oneway void ShutdownWithExit();
725 /*! \brief Creation of a new study
727 Creates a new study with a definite name.
729 \param study_name String parameter defining the name of the study
731 <BR><VAR>See also <A href="exemple/Example17.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
734 Study NewStudy(in string study_name);
736 /*! \brief Open a study
738 Reads and activates the structure of the study %Objects.
739 \param aStudyUrl The path to the study
740 \warning This method doesn't activate the corba objects. Only a component can do it.
742 <BR><VAR>See also <A href="exemple/Example1.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
744 Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
746 /*! \brief Closing the study
750 void Close(in Study aStudy);
751 /*! \brief Saving the study in a HDF file (or files).
755 \param theMultiFile If this parameter is True the study will be saved in several files.
757 <BR><VAR>See also <A href="exemple/Example19.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
760 boolean Save(in Study aStudy, in boolean theMultiFile);
761 /*! \brief Saving a study in a ASCII file (or files).
763 Saves a study in an ASCII format file (or files).
764 \param theMultiFile If this parameter is True the study will be saved in several files.
766 boolean SaveASCII(in Study aStudy, in boolean theMultiFile);
767 /*! \brief Saving the study in a specified HDF file (or files).
769 Saves the study in a specified file (or files).
770 \param aUrl The path to the definite file in whcih the study will be saved
771 \param aStudy The study which will be saved
772 \param theMultiFile If this parameter is True the study will be saved in several files.
774 <BR><VAR>See also <A href="exemple/Example1.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
776 boolean SaveAs(in URL aUrl, // if the file already exists
778 in boolean theMultiFile); // overwrite (as option)
779 /*! \brief Saving the study in a specified ASCII file (or files).
781 Saves the study in a specified ASCII file (or files).
783 \param aUrl The path to the definite file in whcih the study will be saved
784 \param aStudy The study which will be saved
785 \param theMultiFile If this parameter is True the study will be saved in several files.
787 boolean SaveAsASCII(in URL aUrl, // if the file already exists
789 in boolean theMultiFile); // overwrite (as option)
792 /*! \brief List of open studies.
794 Gets the list of open studies
796 \return A list of open studies in the current session.
798 ListOfOpenStudies GetOpenStudies();
800 /*! \brief Getting a particular %Study picked by name
802 Activates a particular %Study
803 among the session collection picking it by name.
804 \param aStudyName The name of the study
806 Study GetStudyByName (in string aStudyName);
808 /*! \brief Getting a particular %Study picked by ID
810 Activates a particular %Study
811 among the session collection picking it by ID.
812 \param aStudyID The ID of the study
814 Study GetStudyByID (in short aStudyID);
816 // copy/paste methods
819 Returns True, if the given %SObject can be copied to the clipboard.
821 boolean CanCopy(in SObject theObject);
823 Returns True, if the given %SObject is copied to the clipboard.
824 \param theObject The %SObject which will be copied
826 boolean Copy(in SObject theObject);
828 Returns True, if the object from the clipboard can be pasted to the given %SObject.
829 \param theObject The %SObject stored in the clipboard.
831 boolean CanPaste(in SObject theObject);
833 Returns the %SObject in which the object from the clipboard was pasted to.
834 \param theObject The %SObject which will be pasted
835 \exception SALOMEDS::StudyBuilder::LockProtection This exception is raised, when trying to paste
836 an object into a study, which is protected for modifications.
838 SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
840 /*! \brief Object conversion.
842 Converts an object into IOR.
845 string ConvertObjectToIOR(in Object theObject);
846 /*! \brief Object conversion.
848 Converts IOR into an object.
851 Object ConvertIORToObject(in string theIOR);
854 Private method, returns an implementation of this StudyManager.
855 \param theHostname is a hostname of the caller
856 \param thePID is a process ID of the caller
857 \param isLocal is set True if the StudyManager is launched locally with the caller
859 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
865 //==========================================================================
866 /*! \brief %SObject interface
868 The objects in the %study are built by the %StudyBuilder. The %SObject interface
869 provides methods for elementary inquiries, like getting an object %ID or its attribuites.
872 <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
873 in the tree-type data structure.
874 <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
875 ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
877 //==========================================================================
879 interface SObject : SALOME::GenericObj
881 /*! Name of the %SObject
883 attribute string Name; // equivalent to setName() & getName()
884 /*! Gets an object %ID
886 \return ID of the %SObject.
889 /*! Acquisition of the father %Component of the %SObject
891 \return The father %Component of the %SObject.
893 SComponent GetFatherComponent();
894 /*! Acquisition of the father %SObject of the %SObject
896 \return the father %SObject of the given %SObject.
899 /*! Gets the %tag of a %SObject
901 \return the %tag of a %SObject.
904 /*! Gets the depth of a %SObject
906 \return the depth of a %SObject.
909 /*! Looks for subobjects of a given %SObject.
911 \param atag Tag of the given %SObject
912 \return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
915 boolean FindSubObject (in long atag, out SObject obj);
916 /*! Looks for attributes of a given %SObject
918 \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
919 \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
921 <BR><VAR>See also <A href="exemple/Example1.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
923 boolean FindAttribute(out GenericAttribute anAttribute,
924 in string aTypeOfAttribute);
925 /*! Looks for a %SObject which the given %SObject refers to.
927 \return The object which the given %SObject refers to as well as True if it finds
930 boolean ReferencedObject(out SObject obj); // A REVOIR
931 /*! Gets all attributes of a given %SObject
933 \return The list of all attributes of the given %SObject.
935 <BR><VAR>See also <A href="exemple/Example17.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
938 ListOfAttributes GetAllAttributes();
939 /*! Gets the study of a given %SObject.
941 \return The study containing the given %SObject.
945 /*! Gets the CORBA object by its own IOR attribute.
946 Returns nil, if can't.
948 \return The CORBA object of the %SObject.
953 Returns the name attribute value of this SObject.
954 Returns empty string if there is no name attribute.
959 Returns the comment attribute value of this SObject.
960 Returns empty string if there is no comment attribute.
965 Returns the IOR attribute value of this SObject.
966 Returns empty string if there is no IOR attribute.
971 Private method, returns an implementation of this SObject.
972 \param theHostname is a hostname of the caller
973 \param thePID is a process ID of the caller
974 \param isLocal is set True if the SObject is launched locally with the caller
976 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
980 //==========================================================================
981 /*! \brief %Generic attribute interface
983 %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
985 //==========================================================================
986 interface GenericAttribute : SALOME::GenericObj
988 /*! \brief Exception locking all changes
990 This exception locks all modifications in attributes.
992 exception LockProtection {};
993 /*! \brief Method CheckLocked
995 Checks whether the %Study is protected for modifications.
997 \note <BR>This exception is raised only outside a transaction.
999 void CheckLocked() raises (LockProtection);
1003 string GetClassType();
1005 SObject GetSObject();
1008 Private method, returns an implementation of this GenericAttribute.
1009 \param theHostname is a hostname of the caller
1010 \param thePID is a process ID of the caller
1011 \param isLocal is set True if the GenericAttribute is launched locally with the caller
1013 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1018 //==========================================================================
1019 /*! \brief %SComponent interface
1021 The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
1022 The %SComponent interface is a specialization of the %SObject interface.
1023 It inherits the most of its methods from the %SObject interface.
1025 //==========================================================================
1026 interface SComponent : SObject
1028 /*! Gets the data type of the given %SComponent
1030 \return The data type of this %SComponent.
1032 string ComponentDataType();
1033 /*! Gets the IOR of the given component
1035 \return True (if there is an instance of the given component) and its IOR.
1037 boolean ComponentIOR (out ID theID); //returns True if there is an instance
1038 //In this case ID identifies this one
1042 //==========================================================================
1043 /*! \brief %SComponentIterator interface
1045 This interface contains the methods allowing to iterate over all components in the list.
1046 The search is started from the first %SComponent in the list.
1048 //==========================================================================
1049 interface SComponentIterator : SALOME::GenericObj
1052 Activates the %SComponentIterator.
1057 \return True if there is one more %SComponent in the list.
1061 Moves the iterator to the next %SComponent in the list.
1065 Returns the %SComponent corresponding to the current %SComponent found by the iterator.
1067 <BR><VAR>See also <A href="exemple/Example1.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
1073 //==========================================================================
1074 /*! \brief %ChildIterator interface
1076 This interface contains methods which allow to iterate over all child
1079 //==========================================================================
1080 interface ChildIterator : SALOME::GenericObj
1084 Activates the %ChildIterator.
1089 Activates the %ChildIterator for all child levels.
1091 \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels.
1093 void InitEx(in boolean allLevels);
1096 \return True if there is one more %ChildIterator in the list.
1100 Passes the iterator to the next level.
1104 Returns the %SObject corresponding to the current object found by the iterator.
1109 //==========================================================================
1110 //==========================================================================
1111 /*! \brief Interface of the %UseCaseIterator.
1113 This interface contains a set of methods used for iteration over the objects in the use case.
1115 interface UseCaseIterator : SALOME::GenericObj
1118 Activates the %UseCaseIterator.
1119 \param allLevels If the value of this parameter is True the Iterator is activated for all subobjects.
1121 void Init(in boolean allLevels);
1124 \return True if the %UseCaseIterator finds one more object.
1128 Passes the iterator to the next object.
1132 Returns the %SObject corresponding to the current object found by the Iterator.
1137 //==========================================================================
1138 //==========================================================================
1139 /*! \brief Interface of the %UseCaseBuilder
1141 Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
1142 The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
1144 interface UseCaseBuilder : SALOME::GenericObj
1147 Adds to the use case an object as a child of the current object of the use case.
1149 \param theObject The added %SObject.
1150 \return True if this %SObject has been added in the use case.
1152 boolean Append(in SObject theObject);
1154 Removes an object from the use case.
1156 \param theObject The deleted %SObject
1157 \return True if this %SObject has been deleted from the use case.
1159 boolean Remove(in SObject theObject);
1161 Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
1163 boolean AppendTo(in SObject theFather, in SObject theObject);
1165 Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
1167 boolean InsertBefore(in SObject theFirst, in SObject theNext);
1169 Sets the current object of the use case.
1171 boolean SetCurrentObject(in SObject theObject);
1173 Makes the root object to be the current object of the use case.
1175 boolean SetRootCurrent();
1177 Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
1179 boolean HasChildren(in SObject theObject);
1181 Sets the name of the use case.
1183 boolean SetName(in string theName);
1185 Gets the name of the use case.
1189 Returns True if the given object <VAR>theObject</VAR> represents a use case.
1191 boolean IsUseCase(in SObject theObject);
1193 Gets the current object of the use case.
1195 SObject GetCurrentObject();
1197 Creates a new use case in the use case browser.
1199 SObject AddUseCase(in string theName);
1201 Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
1203 UseCaseIterator GetUseCaseIterator(in SObject theObject);
1205 //==========================================================================
1206 /*! \brief %Driver interface
1208 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
1209 can be called by any component and which provide the following functionality:
1211 <li> publishing in the study of the objects created by a definite component
1212 <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.
1213 <li> transforming of the transient references into persistant references (or vice versa) of the SObjects when saving (or loading) a study
1214 <li> copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study
1218 //==========================================================================
1222 /*! \brief Saving the data produced by a definite component.
1224 This method is called by the StudyManager when saving a study.
1225 \param theComponent %SComponent corresponding to this Component
1226 \param theURL The path to the file in which the data will be saved.
1227 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1228 \return A byte stream TMPFile that contains all saved data
1230 <BR><VAR>See also <A href="exemple/Example19.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
1235 TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1237 /*! \brief Saving the data in ASCII format produced by a definite component.
1239 This method is called by the StudyManager when saving a study in ASCII format.
1240 \param theComponent %SComponent corresponding to this Component
1241 \param theURL The path to the file in which the data will be saved.
1242 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1243 \return A byte stream TMPFile that will contain all saved data
1245 <BR><VAR>See also <A href="exemple/Example19.html"> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
1248 TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1250 /*! \brief Loading the data.
1252 This method is called by the StudyManager when opening a study.
1253 \param theComponent %SComponent corresponding to this Component
1254 \param theStream The file which contains all data saved by the component on Save method
1255 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1259 boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1261 /*! \brief Loading the data from files in ASCII format.
1263 This method is called by the StudyManager when opening a study.
1264 \param theComponent %SComponent corresponding to this Component
1265 \param theStream The file which contains all data saved by the component on Save method
1266 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1270 boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1272 /*! \brief Closing of the study
1274 This method Close is called by the StudyManager when closing a study.
1275 \param aSComponent The according %SComponent
1278 void Close (in SComponent aSComponent);
1279 //void Close ( in string aIORSComponent);
1281 /*! Gets the type of the data
1283 \return The type of data produced by the Component in the study.
1286 string ComponentDataType();
1288 // Driver Transient -> persistent called for each object in study
1290 Transforms IOR of a given %SObject into PersistentID. It is called for each
1291 object in the %study.
1292 \note <br> In %SALOME the objects which are present in an active study are identified by an IOR, when this
1293 study is saved these references are transformed into persintent IDs.
1295 \param theSObject The given %SObject.
1296 \param IORString The IOR of the given %SObject.
1297 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1298 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1300 \return The persistent ID of the given %SObject
1303 string IORToLocalPersistentID (in SObject theSObject,
1304 in string IORString,
1305 in boolean isMultiFile,
1306 in boolean isASCII);
1308 Transforms PersistentID into IOR of the object. It is called for each
1309 object in the %study.
1311 \note <br> In %SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this
1312 study is open, these references are transformed into persintent IORs.
1314 \param theSObject The given %SObject.
1315 \param IORString The IOR of the given %SObject.
1316 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1317 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1319 \return The IOR of the given %SObject
1322 string LocalPersistentIDToIOR (in SObject theSObject,
1323 in string aLocalPersistentID,
1324 in boolean isMultiFile,
1326 raises (SALOME::SALOME_Exception);
1328 // Publishing in the study
1329 /*! Publishing in the study
1331 \return True if the given %Component can publish a definite object with a given IOR in the %study.
1332 \param theIOR The IOR of a definite object
1334 boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1335 /*! \brief Publishing in the study
1337 Publishes the given object in the %study, using the algorithm of this component.
1338 \param theStudy The %study in which the object is published
1339 \param theSObject If this parameter is null the object is published for the first time. Otherwise
1340 this parameter should contain a reference to the object published earlier
1341 \param theObject The object which is published
1342 \param theName The name of the published object. If this parameter is empty, the name is generated
1343 automatically by the component.
1345 \return The published %SObject.
1347 SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
1349 // copy/paste methods
1352 Returns True, if the given %SObject can be copied to the clipboard.
1354 \param theObject The given %SObject which should be copied.
1356 boolean CanCopy(in SObject theObject);
1358 Returns the object %ID and the %TMPFile of the object from the given %SObject.
1360 TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1362 Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1364 boolean CanPaste(in string theComponentName, in long theObjectID);
1366 Returns the %SObject of the pasted object.
1368 SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);