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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 // File : SALOMEDS.idl
23 // Author : Yves FRICAUD
27 \image html Application-About.png
31 \file SALOMEDS.idl This file contains a set of interfaces used for creation, managment
32 and modification of the %Study
35 #ifndef _SALOMEDS_IDL_
36 #define _SALOMEDS_IDL_
38 #include "SALOME_Exception.idl"
41 This package contains the interfaces used for creation, managment
42 and modification of the %Study
47 Name of the file in which the %Study is saved.
52 /*! Main identifier of an object in %SALOME application
56 /*! While saving the data, IOR is transformed into persistent reference
58 typedef string PersistentReference;
60 /*! IOR of the study in %SALOME application
62 typedef string SalomeReference;
64 /*! List of the names of studies which are currently open in this %SALOME session.
65 Since %SALOME is a multi-study application, it allows to open a lot of studies
66 during each working session.
68 typedef sequence<string> ListOfOpenStudies;
69 /*! List of file names
71 typedef sequence<string> ListOfFileNames;
72 /*! List of modification dates of the study
74 typedef sequence<string> ListOfDates ;
75 /*! An unbounded sequence of strings
77 typedef sequence<string> ListOfStrings ;
78 /*! A byte stream which is used for binary data transfer between components
80 typedef sequence<octet> TMPFile;
82 // Reference to other objects is treated with function AddReference
83 // and ReferencedObject
84 // All other type of attributes defined in AttributeType enum are
85 // treated with AddAdttribute and GetAttribute
86 // The difference is made because Reference attribute don't contain
87 // strings but reference to ID of other objects
89 interface GenericAttribute;
91 interface StudyManager;
92 interface StudyBuilder;
95 interface SComponentIterator;
96 interface ChildIterator;
98 interface AttributeStudyProperties;
99 interface UseCaseIterator;
100 interface UseCaseBuilder;
103 /*! List of attributes
105 typedef sequence<GenericAttribute> ListOfAttributes;
107 /*! Exception indicating that this feature hasn't been implemented.
109 exception NotImplemented {};
112 //===========================================================================
113 /*! \brief %Study Interface
115 The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
116 Most of the %Study operations are handled by the StudyManager and the StudyBuilder.
117 What is left in the %Study interface are elementary inquiries.
118 (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
119 and set methods.) A %Study is explored by a set of tools, mainly iterators
120 , which are described further. Nevertheless, the %Study
121 interface allows the search of an object by name or by ID.
123 <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
124 In general it's a string of names of directories divided by a slash '/'.
125 <BR><VAR>The Context</VAR> is the current directory of an object.</P>
130 exception StudyInvalidContext {};
131 exception StudyInvalidComponent {};
132 /*! Invalid directory of the %study exception
134 exception StudyInvalidDirectory {};
135 /*! Exception pointing that this name of the study has already been used.
137 exception StudyNameAlreadyUsed {};
138 exception StudyObjectAlreadyExists {};
139 /*! Invalid name of the %study exception
141 exception StudyNameError {};
142 exception StudyCommentError {};
143 /*! \brief The name of the %Study
145 This is equivalent to the methods setName() & getName()
147 attribute string Name; // equivalent to setName() & getName()
148 /*! \brief The ID of the %Study
150 This is equivalent to the methods setID() & getID()
152 attribute short StudyId;
153 /*! Sequence containing %SObjects
155 typedef sequence<SObject> ListOfSObject;
157 Gets the persistent reference to the %Study.
159 PersistentReference GetPersistentReference();
161 Gets a transient reference to the %Study.
163 SalomeReference GetTransientReference();
166 Returns True if the %Study is empty
170 Allows to find a %SComponent by its name.
171 \param aComponentName It's a string value in the Comment Attribute of the Component,
172 which is looked for, defining the data type of this Component.
174 <BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
176 SComponent FindComponent (in string aComponentName);
178 Allows to find a %SComponent by ID of the according %SObject
180 SComponent FindComponentID(in ID aComponentID);
182 Allows to find a %SObject by the Name Attribute of this %SObject
183 <BR><VAR>See also <A href=exemple/Example19.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
186 SObject FindObject (in string anObjectName);
188 Allows to find a %SObject by its ID
190 SObject FindObjectID (in ID aObjectID);
192 Allows to find a %SObject by IOR of the object belonging to this %SObject.
194 SObject FindObjectIOR (in ID aObjectIOR);
196 Returns a list of %SObjects belonging to this %Component. The Name Attribute
197 of these %SObjects should correspond to <VAR>anObjectName</VAR>.
199 ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName);
201 Allows to find a %SObject by the path to it.
203 SObject FindObjectByPath(in string thePath);
205 Returns the path to the %SObject.
207 string GetObjectPath(in Object theObject);
210 Sets the context of the %Study.
211 <BR><VAR>See also <A href=exemple/Example23.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
214 void SetContext(in string thePath);
216 Gets the context of the %Study
217 <BR><VAR>See also <A href=exemple/Example23.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
222 Returns a list of names of objects corresponding to the context.
223 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
225 ListOfStrings GetObjectNames(in string theContext);
227 Returns a list of names of directories and subdirectories corresponding to the context.
228 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
230 ListOfStrings GetDirectoryNames(in string theContext);
232 Returns a list of names of Files corresponding to the context.
233 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
235 ListOfStrings GetFileNames(in string theContext);
237 Returns a list of names of Components corresponding to the context.
238 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
240 ListOfStrings GetComponentNames(in string theContext);
241 /*! \brief Creation of a new iterator of child levels
243 Creates a new iterator of child levels of the %SObject
245 ChildIterator NewChildIterator(in SObject aSO);
246 /*! \brief Creation of a new iterator of the %SComponent
248 Creates a new iterator of the %SComponent.
250 SComponentIterator NewComponentIterator();
251 /*! \brief Creation of a %StudyBuilder
253 Creates a new %StudyBuilder to add or modify an object in the study.
254 <BR><VAR>See also <A href=exemple/Example20.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
257 StudyBuilder NewBuilder() ;
258 /*! \brief Labels dependency
260 Updates the map with IOR attribute. It's an inner method used for optimization.
262 void UpdateIORLabelMap(in string anIOR, in string anEntry);
264 /*! \brief Getting properties of the study
266 Returns the attriubte, which contains the properties of this study.
267 <BR><VAR>See also <A href=exemple/Example20.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
270 AttributeStudyProperties GetProperties();
272 Determines whether the %study has been saved
274 attribute boolean IsSaved;
276 Returns True if the %study has been modified and not saved.
278 boolean IsModified();
280 Determines the file where the %study has been saved
282 attribute string URL;
284 /*! \brief List of %SObjects
286 Returns the list of %SObjects which refers to %anObject.
288 ListOfSObject FindDependances(in SObject anObject);
290 /*! \brief The date of the last saving of the study
292 Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
294 string GetLastModificationDate();
295 /*! \brief The list of modification dates of the study
297 Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
298 Note : the first modification begins the list.
300 ListOfDates GetModificationsDate();
301 /*! \brief Object conversion.
303 Converts an object into IOR.
306 string ConvertObjectToIOR(in Object theObject);
307 /*! \brief Object conversion.
309 Converts IOR into an object.
312 Object ConvertIORToObject(in string theIOR);
314 Gets a new %UseCaseBuilder.
316 UseCaseBuilder GetUseCaseBuilder();
319 Closes the components in the study, removes itself from the %StudyManager.
324 Enables(if isEnabled = True)/disables automatic addition of new %SObjects to the use case.
326 void EnableUseCaseAutoFilling(in boolean isEnabled);
329 //==========================================================================
330 /*! \brief %Study Builder Interface
332 The purpose of the Builder is to add and/or remove objects and attributes.
333 A %StudyBuilder is linked to a %Study. A
334 command management is provided for the undo/redo functionalities.
336 <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
337 item's position in the tree-type structure of the browser. In general it has the following
338 form: <TT>0:2:1:1</TT>
340 //==========================================================================
342 interface StudyBuilder
344 /*! \brief %LockProtection Exception
346 This exception is raised while attempting to modify a locked %study.
348 exception LockProtection {};
349 /*! \brief Creation of a new %SComponent.
351 Creates a new %SComponent
352 \param ComponentDataType Data type of the %SComponent which will be created.
354 <BR><VAR>See also <A href=exemple/Example17.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
357 SComponent NewComponent(in string ComponentDataType);
358 /*! \brief Definition of the instance to the %SComponent
360 Defines the instance to the %SComponent.
362 void DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR);
363 /*! \brief Deletion of the %SComponent
365 Removes the %SComponent.
367 void RemoveComponent(in SComponent aComponent);
369 /*! \brief Creation of a new %SObject
371 Creates a new %SObject.
372 <BR><VAR>See also <A href=exemple/Example18.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
375 SObject NewObject (in SObject theFatherObject);
376 /*! \brief Creation of a new %SObject with a definite %tag
378 Creates a new %SObject with a definite %tag.
380 SObject NewObjectToTag (in SObject theFatherObject, in long atag);
381 /*! \brief Deletion of the %SObject
383 Removes a %SObject from the %StudyBuilder.
385 void RemoveObject (in SObject anObject);
386 /*! \brief Deletion of the %SObject with all his child objects.
388 Removes the %SObject with all his child objects.
390 void RemoveObjectWithChildren(in SObject anObject);
394 <BR><VAR>See also <A href=exemple/Example19.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
397 void LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
401 void Load (in SObject sco);
403 /*! \brief Looking for or creating an attribute assigned to the %SObject
405 Allows to find or create an attribute of a specific type which is assigned to the object.
406 \param anObject The %SObject corresponding to the attribute which is looked for.
407 \param aTypeOfAttribute Type of the attribute.
409 <BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
412 GenericAttribute FindOrCreateAttribute(in SObject anObject,
413 in string aTypeOfAttribute);
415 /*! \brief Looking for an attribute assigned to %SObject
417 Allows to find an attribute of a specific type which is assigned to the object.
418 \param anObject The %SObject corresponding to the attribute which is looked for.
419 \param aTypeOfAttribute Type of the attribute.
420 \param anAttribute Where the attribute is placed if it's found.
421 \return True if it finds an attribute.
424 boolean FindAttribute(in SObject anObject,
425 out GenericAttribute anAttribute,
426 in string aTypeOfAttribute);
427 /*! \brief Deleting the attribute assigned to the %SObject
429 Removes the attribute of a specific type which is assigned to the object.
430 \param anObject The %SObject corresponding to the attribute.
431 \param aTypeOfAttribute Type of the attribute.
433 <BR><VAR>See also <A href=exemple/Example17.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
435 void RemoveAttribute(in SObject anObject,
436 in string aTypeOfAttribute);
437 /*! \brief Addition of a reference
439 Adds a reference between %anObject and %theReferencedObject.
442 void Addreference(in SObject anObject,
443 in SObject theReferencedObject) ;
445 Adds a directory in the %Study.
446 <BR><VAR>See also <A href=exemple/Example23.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
449 void AddDirectory(in string theName);
451 /*! \brief Identification of the %SObject's substructure.
453 Identification of the %SObject's substructure by GUID.
454 It has the following format "00000000-0000-0000-0000-000000000000"
457 void SetGUID(in SObject anObject, in string theGUID);
460 Returns True if the %SObject has GUID.
462 boolean IsGUID(in SObject anObject, in string theGUID);
464 /*! \brief Creation of a new command
466 Creates a new command which can contain several different actions.
467 <BR><VAR>See also <A href=exemple/Example3.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
470 void NewCommand(); // command management
471 /*! \brief Execution of the command
473 Commits all actions declared within this command.
474 <BR><VAR>See also <A href=exemple/Example16.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
477 void CommitCommand() raises(LockProtection); // command management
479 Returns True if at this moment there is a command under execution.
481 boolean HasOpenCommand();
482 /*! \brief Cancelation of the command
484 Cancels all actions declared within the command.
485 <BR><VAR>See also <A href=exemple/Example17.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
487 void AbortCommand(); // command management
490 The number of actions which can be undone
492 attribute long UndoLimit;
493 /*! \brief Undo method
495 Cancels all actions of the last command.
496 <BR><VAR>See also <A href=exemple/Example16.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
499 void Undo() raises (LockProtection);
500 /*! \brief Redo method
502 Redoes all actions of the last command.
503 <BR><VAR>See also <A href=exemple/Example16.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
506 void Redo() raises (LockProtection);
508 Returns True if at this moment there are any actions which can be canceled.
509 <BR><VAR>See also <A href=exemple/Example16.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
512 boolean GetAvailableUndos();
514 Returns True if at this moment there are any actions which can be redone.
515 <BR><VAR>See also <A href=exemple/Example3.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
518 boolean GetAvailableRedos();
520 Sets the callback for addition of the given %SObject. Returns the previous callback.
522 Callback SetOnAddSObject(in Callback theCallback);
524 Sets the callback for removal of the given %SObject. Returns the previous callback.
526 Callback SetOnRemoveSObject(in Callback theCallback);
530 //==========================================================================
531 /*! \brief %Study Manager interface
533 The purpose of the Manager is to manipulate the %Studies. You will find in this
534 interface the methods to create, open,
535 close, and save a %Study. Since a %SALOME session is multi-document, you will
536 also find the methods allowing to navigate
537 through the collection of studies present in a session.
539 //==========================================================================
541 interface StudyManager
544 Determines whether the server has already been loaded or not.
548 /*! \brief Creation of a new %Study
550 Creates a new %Study with a definite name.
551 <BR><VAR>See also <A href=exemple/Example17.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
554 Study NewStudy(in string study_name);
556 /*! \brief Open a study
558 Reads and activates the structure of the study %Objects.
559 \warning This method doesn't activate the corba objects. Only a component can do it.
560 <BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
562 Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
564 /*! \brief Closing the study
568 void Close(in Study aStudy);
569 /*! \brief Saving the study in a HDF file (or files).
572 \param theMultiFile If this parameter is True the study will be saved in several files.
573 <BR><VAR>See also <A href=exemple/Example19.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
576 void Save(in Study aStudy, in boolean theMultiFile);
577 /*! \brief Saving the study in a ASCII file (or files).
579 Saves the study in a ASCII format.
580 \param theMultiFile If this parameter is True the study will be saved in several files.
582 void SaveASCII(in Study aStudy, in boolean theMultiFile);
583 /*! \brief Saving the study in a specified HDF file (or files).
585 Saves the study in a specified file (or files).
586 \param theMultiFile If this parameter is True the study will be saved in several files.
588 <BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
590 void SaveAs(in URL aUrl, // if the file already exists
592 in boolean theMultiFile); // overwrite (as option)
593 /*! \brief Saving the study in a specified ASCII file (or files).
595 Saves the study in a specified ASCII file (or files).
596 \param theMultiFile If this parameter is True the study will be saved in several files.
598 void SaveAsASCII(in URL aUrl, // if the file already exists
600 in boolean theMultiFile); // overwrite (as option)
603 /*! \brief List of open studies.
605 Returns the list of open studies in the current session.
607 ListOfOpenStudies GetOpenStudies();
609 /*! \brief Getting a particular %Study picked by name
611 Activates a particular %Study
612 amongst the session collection picking it by name.
614 Study GetStudyByName (in string aStudyName);
616 /*! \brief Getting a particular %Study picked by ID
618 Activates a particular %Study
619 amongst the session collection picking it by ID.
621 Study GetStudyByID (in short aStudyID);
623 // copy/paste methods
626 Returns True, if the given %SObject can be copied to the clipboard.
628 boolean CanCopy(in SObject theObject);
630 Returns True, if the given %SObject is copied to the clipboard.
632 boolean Copy(in SObject theObject);
634 Returns True, if the object from the clipboard can be pasted to the given %SObject.
636 boolean CanPaste(in SObject theObject);
638 Returns the %SObject in which the object from the clipboard was pasted to.
640 SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
644 //==========================================================================
645 /*! \brief %SObject interface
647 The objects in the %study are built by the %StudyBuilder. The %SObject interface
648 provides methods for elementary inquiries, like getting an object %ID or its attribuites.
650 <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
651 in the tree-type data structure.
652 <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
653 ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
655 //==========================================================================
659 /*! Name of the %SObject
661 attribute string Name; // equivalent to setName() & getName()
662 /*! \brief Getting an object %ID
664 Returns ID of the %SObject.
667 /*! \brief Acquisition of the father %Component of the %SObject
669 Returns the father %Component of the %SObject.
671 SComponent GetFatherComponent();
672 /*! \brief Acquisition of the father %SObject of the %SObject
674 Returns the father %SObject of the given %SObject.
677 /*! \brief %Tag of %SObject
679 Returns the %tag of the %SObject.
682 /*! \brief Looking for subobjects of an object.
684 Returns True if it finds a subobject of the %SObject with a definite tag.
687 boolean FindSubObject (in long atag, out SObject obj);
688 /*! \brief Looking for attributes of the %SObject
690 Returns True if it finds an attribute of a definite type of the %SObject.
691 <BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
693 boolean FindAttribute(out GenericAttribute anAttribute,
694 in string aTypeOfAttribute);
696 Returns the object which this %SObject refers to. It also returns True if it finds
699 boolean ReferencedObject(out SObject obj); // A REVOIR
700 /*! \brief Getting all attributes of the %SObject
702 Returns the list of all attributes of the %SObject.
703 <BR><VAR>See also <A href=exemple/Example17.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
706 ListOfAttributes GetAllAttributes();
707 /*! \brief Returning the study
709 Returns the study containing the given %SObject.
715 //==========================================================================
716 /*! \brief %Generic attribute interface
718 %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
720 //==========================================================================
721 interface GenericAttribute
723 /*! \brief Exception locking all changes
725 This exception locks all modifications in attributes.
727 exception LockProtection {};
728 /*! \brief Method CheckLocked
730 Checks whether the %Study is protected for modifications.
731 \note <BR>This exception is raised only outside the transaction.
733 void CheckLocked() raises (LockProtection);
738 //==========================================================================
739 /*! \brief %SComponent interface
741 The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
742 The %SComponent interface is a specialization of the %SObject interface.
743 It inherits the most of its methods from the %SObject interface.
745 //==========================================================================
746 interface SComponent : SObject
748 /*! \brief Data type of the %SComponent
750 Returns the data type of the %SComponent.
752 string ComponentDataType();
754 Returns IOR of the according component.
756 boolean ComponentIOR (out ID theID); //returns True if there is an instance
757 //In this case ID identifies this one
761 //==========================================================================
762 /*! \brief %SComponentIterator interface
764 This interface contains the methods allowing to iterate over all components in the list.
765 The search is started from the first %SComponent in the list.
767 //==========================================================================
768 interface SComponentIterator
770 /*! \brief Initialization of the Iterator
772 Activates the %SComponentIterator.
775 /*! \brief Method More
777 Returns True if there is one more %SComponent in the list.
780 /*! \brief Moving the iterator to the next %SComponent
782 Moves the iterator to the next %SComponent in the list.
786 Returns the %SComponent corresponding to the current %SComponent found by the iterator.
787 <BR><VAR>See also <A href=exemple/Example1.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
793 //==========================================================================
794 /*! \brief %ChildIterator interface
796 This interface contains methods which allow to iterate over all child
799 //==========================================================================
800 interface ChildIterator
802 /*! \brief Initialization of the Iterator.
804 Activates the %ChildIterator.
807 /*! \brief Initialization of the Iterator for all child levels.
809 Activates the %ChildIterator (if True) for all child levels.
811 void InitEx(in boolean allLevels);
812 /*! \brief Method More
814 Returns True if the %ChildIterator finds one more child level.
818 Passes the iterator to the next level.
822 Returns the %SObject corresponding to the current object found by the iterator.
827 //==========================================================================
828 //==========================================================================
829 /*! \brief Interface of the %UseCaseIterator.
831 This interface contains a set of methods used for iteration over the objects in the use case.
833 interface UseCaseIterator
835 /*! \brief Initialization of the Iterator.
837 Activates the %UseCaseIterator. If <VAR>allLevels</VAR> is True the Iterator is activated for all subobjects.
839 void Init(in boolean allLevels);
840 /*! \brief Method More
842 Returns True if the %UseCaseIterator finds one more object.
846 Passes the iterator to the next object.
850 Returns the %SObject corresponding to the current object found by the Iterator.
855 //==========================================================================
856 //==========================================================================
857 /*! \brief Interface of the %UseCaseBuilder
859 Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
860 The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
862 interface UseCaseBuilder
865 Adds to the use case an object <VAR>theObject</VAR> as a child of the current object of the use case.
867 boolean Append(in SObject theObject);
869 Removes an object <VAR>theObject</VAR> from the use case.
871 boolean Remove(in SObject theObject);
873 Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
875 boolean AppendTo(in SObject theFather, in SObject theObject);
877 Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
879 boolean InsertBefore(in SObject theFirst, in SObject theNext);
881 Sets the current object of the use case.
883 boolean SetCurrentObject(in SObject theObject);
885 Makes the root object to be the current object of the use case.
887 boolean SetRootCurrent();
889 Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
891 boolean HasChildren(in SObject theObject);
893 Sets the name of the use case.
895 boolean SetName(in string theName);
897 Gets the name of the use case.
901 Returns True if the given object <VAR>theObject</VAR> represents a use case.
903 boolean IsUseCase(in SObject theObject);
905 Gets the current object of the use case.
907 SObject GetCurrentObject();
909 Creates a new use case in the use case browser.
911 SObject AddUseCase(in string theName);
913 Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
915 UseCaseIterator GetUseCaseIterator(in SObject theObject);
917 //==========================================================================
918 //==========================================================================
919 /*! \brief The callback interface
921 The %StudyBuilder can be created with the method <VAR>NewBuilder</VAR>. While invocation of this method a new object of the class <VAR>Callback</VAR> is created
922 and this object is assigned to the newly created Builder as callback which should be called when adding and removing of the ojects.
927 Invokes the corresponding method <VAR>Append</VAR> of the %UseCaseBuilder.
929 void OnAddSObject(in SObject theObject);
931 Invokes the corresponding method <VAR>Remove</VAR> of the %UseCaseBuilder.
933 void OnRemoveSObject(in SObject theObject);
936 //==========================================================================
937 /*! \brief %Driver interface
939 This interface contains a set of methods used for the management
940 of the object produced in the %study by a component.
942 //==========================================================================
946 /*! \brief Saving the data.
948 This method is called by the StudyManager when saving a study.
949 \param theComponent %SComponent corresponding to this Component
950 \return A byte stream TMPFile that contains all saved data
952 <BR><VAR>See also <A href=exemple/Example19.html> an example </A> of this method usage in batchmode of %SALOME application.</VAR>
957 TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
959 TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
961 /*! \brief Loading the data.
963 This method is called by the StudyManager when opening a study.
964 \param theComponent %SComponent corresponding to this Component
965 \param theStream The file which contains all data saved by the component on Save method
968 boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
970 boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
972 /*! \brief Closing of the study
974 This method Close is called by the StudyManager when closing a study.
978 void Close (in SComponent aSComponent);
979 //void Close ( in string aIORSComponent);
981 /*! \brief The type of the data
983 Returns the type of data produced by the Component in the study.
986 string ComponentDataType();
988 // Driver Transient -> persistent called for each object in study
990 Transforms IOR into PersistentID of the object. It is called for each
991 object in the %study.
993 string IORToLocalPersistentID (in SObject theSObject,
995 in boolean isMultiFile,
998 Transforms PersistentID into IOR of the object. It is called for each
999 object in the %study.
1001 string LocalPersistentIDToIOR (in SObject theSObject,
1002 in string aLocalPersistentID,
1003 in boolean isMultiFile,
1005 raises (SALOME::SALOME_Exception);
1007 // Publishing in the study
1008 /*! \brief Publishing in the study
1010 Returns True if the given %Component can publish the %object in the %study.
1012 boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1013 /*! \brief Publishing in the study
1015 Publishes the given object in the %study, using the algorithm of this component.
1016 \param theStudy The %study in which the object is published
1017 \param theSObject If this parameter is null the object is published for the first time. Otherwise
1018 this parameter should contain a reference to the object published earlier
1019 \param theObject The object which is published
1020 \param theName The name of the published object. If this parameter is empty, the name is generated
1021 automatically by the component.
1023 SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
1025 // copy/paste methods
1028 Returns True, if the given %SObject can be copied to the clipboard.
1030 boolean CanCopy(in SObject theObject);
1032 Returns the object %ID and the %TMPFile of the object from the given %SObject.
1034 TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1036 Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1038 boolean CanPaste(in string theComponentName, in long theObjectID);
1040 Returns the %SObject of the pasted object.
1042 SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);