1 // Copyright (C) 2007-2019 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, or (at your option) any later version.
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
26 /*! \file SALOMEDS.idl \brief This file contains a set of interfaces used for creation, management
27 and modification of the %Study
30 #ifndef _SALOMEDS_IDL_
31 #define _SALOMEDS_IDL_
33 #include "SALOME_Exception.idl"
34 #include "SALOME_GenericObj.idl"
37 This package contains the interfaces used for creation, management
38 and modification of the %Study
42 /*! \brief Name of the file in which the %Study is saved.
44 typedef wstring URLPath;
46 /*! \brief Main identifier of an object in %SALOME application
50 /*! \brief While saving the data, IOR is transformed into persistent reference
52 typedef string PersistentReference;
54 /*! \brief IOR of the study in %SALOME application
56 typedef string SalomeReference;
58 //! List of file names
59 typedef sequence<string> ListOfFileNames;
60 //! List of modification dates of a study
61 typedef sequence<string> ListOfDates ;
62 //! An unbounded sequence of strings
63 typedef sequence<string> ListOfStrings ;
64 //! An unbounded sequence of sequence of strings
65 typedef sequence<ListOfStrings> ListOfListOfStrings ;
66 //! A byte stream which is used for binary data transfer between different components
67 typedef sequence<octet> TMPFile;
69 // Reference to other objects is treated with function AddReference
70 // and ReferencedObject
71 // All other type of attributes defined in AttributeType enum are
72 // treated with AddAdttribute and GetAttribute
73 // The difference is made because Reference attribute don't contain
74 // strings but reference to ID of other objects
76 interface GenericAttribute;
78 interface StudyBuilder;
81 interface SComponentIterator;
82 interface ChildIterator;
84 interface AttributeStudyProperties;
85 interface AttributeParameter;
86 interface UseCaseIterator;
87 interface UseCaseBuilder;
91 oneway void notifyObserverID(in string theID, in long event);
95 //! List of attributes of %SObjects
96 typedef sequence<GenericAttribute> ListOfAttributes;
98 //! Exception indicating that this feature hasn't been implemented in %SALOME application.
99 exception NotImplemented {};
101 //==========================================================================
102 /*! \brief %Study Builder Interface
104 The purpose of the Builder is to add and/or remove objects and attributes.
105 A %StudyBuilder is linked to a %Study. A
106 command management is provided for the undo/redo functionalities.
108 <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
109 item's position in the tree-type structure of the browser. In general it has the following
110 form: <TT>0:2:1:1</TT>
112 //==========================================================================
114 interface StudyBuilder
116 /*! \brief %LockProtection Exception
118 This exception is raised while attempting to modify a locked %study.
120 exception LockProtection {};
121 /*! \brief Creation of a new %SComponent.
123 Creates a new %SComponent
124 \param ComponentDataType Data type of the %SComponent which will be created.
126 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
129 SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
131 /*! \brief Definition of the instance to the %SComponent
133 Defines the instance to the %SComponent.
135 void DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
137 /*! \brief Deletion of a %SComponent
139 Removes a %SComponent.
141 void RemoveComponent(in SComponent aComponent) raises(LockProtection);
143 /*! \brief Creation of a new %SObject
145 Creates a new %SObject under a definite father %SObject.
147 \param theFatherObject The father %SObject under which this one should be created.
150 <em>See \ref example18 for an example of this method usage in batchmode of %SALOME application.</em>
154 SObject NewObject (in SObject theFatherObject) raises(LockProtection);
156 /*! \brief Creation of a new %SObject with a definite %tag
158 Creates a new %SObject with a definite %tag.
160 \param atag Long value corresponding to the tag of the new %SObject.
164 SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
165 /*! \brief Deletion of the %SObject
167 Removes a %SObject from the %StudyBuilder.
169 \param anObject The %SObject to be deleted.
171 void RemoveObject (in SObject anObject) raises(LockProtection);
172 /*! \brief Deletion of the %SObject with all his child objects.
174 Removes the %SObject with all his child objects.
176 \param anObject The %SObject to be deleted with all child objects.
178 void RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
183 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
186 void LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
190 \param sco %SObject to be loaded.
192 void Load (in SObject sco);
194 /*! \brief Looking for or creating an attribute assigned to the %SObject
196 Allows to find or create an attribute of a specific type which is assigned to the object.
197 \param anObject The %SObject corresponding to the attribute which is looked for.
198 \param aTypeOfAttribute Type of the attribute.
200 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
203 GenericAttribute FindOrCreateAttribute(in SObject anObject,
204 in string aTypeOfAttribute) raises(LockProtection);
206 /*! \brief Looking for an attribute assigned to a %SObject
208 Allows to find an attribute of a specific type which is assigned to the object.
209 \param anObject The %SObject corresponding to the attribute which is looked for.
210 \param aTypeOfAttribute Type of the attribute.
211 \param anAttribute Where the attribute is placed if it's found.
212 \return True if it finds an attribute.
215 boolean FindAttribute(in SObject anObject,
216 out GenericAttribute anAttribute,
217 in string aTypeOfAttribute);
218 /*! \brief Deleting the attribute assigned to the %SObject
220 Removes the attribute of a specific type which is assigned to the object.
221 \param anObject The %SObject corresponding to the attribute.
222 \param aTypeOfAttribute Type of the attribute.
224 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
226 void RemoveAttribute(in SObject anObject,
227 in string aTypeOfAttribute) raises(LockProtection);
229 Adds a reference between %anObject and %theReferencedObject.
230 \param anObject The %SObject which will get a reference
231 \param theReferencedObject The %SObject having a reference
234 void Addreference(in SObject anObject,
235 in SObject theReferencedObject) ;
238 Removes a reference from %anObject to another object.
239 \param anObject The %SObject which contains a reference
242 void RemoveReference(in SObject anObject) ;
244 /*! \brief Identification of the %SObject's substructure.
246 Identification of the %SObject's substructure by GUID.
249 \param anObject The %SObject which will be identified
250 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
252 void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
254 Searches for a definite %SObject with a definite GUID and returns True if it finds it.
256 \param anObject A definite %SObject which will be identified
257 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
259 boolean IsGUID(in SObject anObject, in string theGUID);
261 /*! \brief Creation of a new command
263 Creates a new command which can contain several different actions.
265 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
268 void NewCommand(); // command management
269 /*! \brief Execution of the command
271 Commits all actions declared within this command.
273 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
275 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
278 void CommitCommand() raises(LockProtection); // command management
280 Returns True if at this moment there is a command under execution.
282 boolean HasOpenCommand();
283 /*! \brief Cancellation of the command
285 Cancels all actions declared within the command.
287 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
289 void AbortCommand(); // command management
292 The number of actions which can be undone
294 attribute long UndoLimit;
295 /*! \brief Undo method
297 Cancels all actions of the last command.
299 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
301 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
304 void Undo() raises (LockProtection);
305 /*! \brief Redo method
307 Redoes all actions of the last command.
309 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
311 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
314 void Redo() raises (LockProtection);
316 Returns True if at this moment there are any actions which can be canceled.
318 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
321 boolean GetAvailableUndos();
323 Returns True if at this moment there are any actions which can be redone.
325 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
328 boolean GetAvailableRedos();
330 Puts name attribute with the given string value to the given %SObject
332 \param theSO Existing SObject to set name attribute.
333 \param theValue The value to be set to the name attribute.
335 void SetName(in SObject theSO, in string theValue) raises (LockProtection);
338 Puts comment attribute with the given string value to the given %SObject
340 \param theSO Existing SObject to set comment attribute.
341 \param theValue The value to be set to the comment attribute.
343 void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
346 Puts IOR attribute with the given string value to the given %SObject
348 \param theSO Existing SObject to set IOR attribute.
349 \param theValue The value to be set to the IOR attribute.
351 void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
354 //===========================================================================
355 /*! \brief %Study Interface
357 The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
358 Most of the %Study operations are handled by the StudyBuilder.
359 What is left in the %Study interface are elementary inquiries.
360 (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
361 and set methods.) A %Study is explored by a set of tools, mainly iterators
362 , which are described further. Nevertheless, the %Study
363 interface allows the search of an object by name or by ID.
365 <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
366 In general it's a string of names of directories divided by a slash '/'.
367 <BR><VAR>The Context</VAR> is the current directory of an object.</P>
373 //! Invalid study reference
374 exception StudyInvalidReference {};
375 //! Invalid study component
376 exception StudyInvalidComponent {};
377 //! Invalid directory of the %study exception
378 exception StudyInvalidDirectory {};
379 //! Exception pointing that this name of the study has already been used.
380 exception StudyNameAlreadyUsed {};
381 //! study object already exists
382 exception StudyObjectAlreadyExists {};
383 //! Invalid name of the %study exception
384 exception StudyNameError {};
385 //! Invalid study comment
386 exception StudyCommentError {};
389 Determines whether the server has already been loaded or not.
394 Returns the PID of the server
399 Shutdown the Study process.
401 oneway void ShutdownWithExit();
403 /*! \brief The name of the %Study
405 This is equivalent to the methods setName() & getName()
407 attribute wstring Name; // equivalent to getName()
409 /*! \brief Indicate the file where the %study has been saved
412 //! Sequence containing %SObjects
413 typedef sequence<SObject> ListOfSObject;
414 //! Get the persistent reference to the %Study.
415 PersistentReference GetPersistentReference() raises(StudyInvalidReference);
417 /*! \brief indicate whether the %Study is empty
419 \return True if the %Study is empty
421 boolean IsEmpty() raises(StudyInvalidReference);
422 /*! \brief Find a %SComponent by its name.
424 \param aComponentName It's a string value in the Comment Attribute of the Component,
425 which is looked for, defining the data type of this Component.
427 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
430 SComponent FindComponent (in string aComponentName) raises(StudyInvalidReference);
432 /*! \brief Find a %SComponent by ID of the according %SObject
434 SComponent FindComponentID(in ID aComponentID) raises(StudyInvalidReference);
435 /*! \brief Find a %SObject by the Name Attribute of this %SObject
437 \param anObjectName String parameter defining the name of the object
438 \return The obtained %SObject
440 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
442 SObject FindObject (in string anObjectName) raises(StudyInvalidReference);
443 /*! \brief Find a %SObject by its ID
445 \param aObjectID This parameter defines the ID of the required object
446 \return The obtained %SObject
448 SObject FindObjectID (in ID aObjectID) raises(StudyInvalidReference);
449 /*! \brief Create a %SObject by its ID
451 \param aObjectID This parameter defines the ID of the required object
452 \return The created %SObject
454 SObject CreateObjectID (in ID aObjectID) raises(StudyInvalidReference);
455 /*! \brief Find a %SObject by IOR of the object belonging to this %SObject.
457 \param anObjectName This parameter defines the IOR of the object
458 \return The obtained %SObject
460 SObject FindObjectIOR (in ID aObjectIOR) raises(StudyInvalidReference);
461 /*! \brief Find in the study all %SObjects produced by a given %Component.
463 \param anObjectName The Name Attribute of the searched %SObjects should correspond to <VAR>anObjectName</VAR>.
464 \param aComponentName The name of the component, which objects are searched for.
466 ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName) raises(StudyInvalidReference);
467 /*! \brief Find a %SObject by the path to it.
469 \param thePath The path to the required %SObject.
470 \return The obtained %SObject.
472 SObject FindObjectByPath(in string thePath) raises(StudyInvalidReference);
473 /*! \brief Get the path to the %SObject.
475 string GetObjectPath(in Object theObject) raises(StudyInvalidReference);
477 /*! \brief Create a new iterator of child levels of the given %SObject.
479 \param aSO The given %SObject
480 \return A new iterator of child levels of the given %SObject.
482 ChildIterator NewChildIterator(in SObject aSO) raises(StudyInvalidReference);
484 /*! \brief Create a new iterator of the %SComponents.
486 \return A new iterator of the %SComponents.
488 SComponentIterator NewComponentIterator() raises(StudyInvalidReference);
490 /*! \brief Create a new %StudyBuilder to add or modify an object in the study.
492 \return A new %StudyBuilder.
494 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
496 StudyBuilder NewBuilder() raises(StudyInvalidReference);
497 /*! \brief Labels dependency
499 Updates the map with IOR attribute. It's an inner method used for optimization.
501 void UpdateIORLabelMap(in string anIOR, in string anEntry) raises(StudyInvalidReference);
503 /*! \brief Getting properties of the study
505 Returns the attribute, which contains the properties of this study.
507 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
510 AttributeStudyProperties GetProperties() raises(StudyInvalidReference);
511 /*! \brief Indicate whether the %study has been saved
513 attribute boolean IsSaved;
514 /*! \brief Indicate whether the %study has been modified and not saved.
516 Returns True if the %study has been modified and not saved.
518 boolean IsModified() raises(StudyInvalidReference);
520 /*! \brief Mark the %study as being modified and not saved.
522 void Modified() raises(StudyInvalidReference);
524 /*! \brief Indicate the file where the %study has been saved
526 attribute wstring URL;
528 /*! \brief List of %SObjects
530 Returns the list of %SObjects which refers to %anObject.
532 ListOfSObject FindDependances(in SObject anObject) raises(StudyInvalidReference);
534 /*! \brief The date of the last saving of the study
536 Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
538 string GetLastModificationDate() raises(StudyInvalidReference);
539 /*! \brief The list of modification dates of the study
541 Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
542 Note : the first modification begins the list.
544 ListOfDates GetModificationsDate() raises(StudyInvalidReference);
545 /*! \brief Object conversion.
547 Converts an object into IOR.
550 string ConvertObjectToIOR(in Object theObject);
551 /*! \brief Object conversion.
553 Converts IOR into an object.
556 Object ConvertIORToObject(in string theIOR);
558 /*! \brief Get a new %UseCaseBuilder.
560 UseCaseBuilder GetUseCaseBuilder() raises(StudyInvalidReference);
562 /*! \brief Clear a study object
564 void Clear() raises(StudyInvalidReference);
566 /*! \brief Initialization a study object
568 void Init() raises(StudyInvalidReference);
570 /*! \brief Open a study by url
572 Reads and activates the structure of the study %Objects.
573 \param aStudyUrl The path to the study
575 boolean Open (in URLPath aStudyUrl) raises (SALOME::SALOME_Exception);
577 /*! \brief Check if study can be opened
579 Tries to open and read given url.
580 \param aStudyUrl The path to the study
582 boolean CanOpen (in URLPath aStudyUrl);
584 /*! \brief Saving the study in a file (or files).
587 \param theMultiFile If this parameter is True the study will be saved in several files.
588 \param theASCII If this parameter is True the study will be saved in ASCII format, otherwise in HDF format.
590 boolean Save(in boolean theMultiFile, in boolean theASCII) raises(StudyInvalidReference);
592 /*! \brief Saving the study in a specified file (or files).
594 Saves the study in a specified file (or files).
595 \param aUrl The path to the definite file in which the study will be saved
596 \param theMultiFile If this parameter is True the study will be saved in several files.
597 \param theASCII If this parameter is True the study will be saved in ASCII format, otherwise in HDF format.
599 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
601 boolean SaveAs(in URLPath aUrl, // if the file already exists
602 in boolean theMultiFile, // overwrite (as option)
604 raises(StudyInvalidReference);
606 Returns True, if the given %SObject can be copied to the clipboard.
608 boolean CanCopy(in SObject theObject) raises(StudyInvalidReference);
610 Returns True, if the given %SObject is copied to the clipboard.
611 \param theObject The %SObject which will be copied
613 boolean Copy(in SObject theObject) raises(StudyInvalidReference);
615 Returns True, if the object from the clipboard can be pasted to the given %SObject.
616 \param theObject The %SObject stored in the clipboard.
618 boolean CanPaste(in SObject theObject) raises(StudyInvalidReference);
620 Returns the %SObject in which the object from the clipboard was pasted to.
621 \param theObject The %SObject which will be pasted
622 \exception SALOMEDS::StudyBuilder::LockProtection This exception is raised, when trying to paste
623 an object into a study, which is protected for modifications.
625 SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
627 /*! \brief Enable (if isEnabled = True)/disable automatic addition of new %SObjects to the use case.
629 void EnableUseCaseAutoFilling(in boolean isEnabled) raises(StudyInvalidReference);
632 Functions for internal usage only
634 void AddPostponed(in string theIOR) raises(StudyInvalidReference);
636 void AddCreatedPostponed(in string theIOR) raises(StudyInvalidReference);
638 void RemovePostponed(in long theUndoLimit) raises(StudyInvalidReference);
640 void UndoPostponed(in long theWay) raises(StudyInvalidReference);
642 boolean DumpStudy(in string thePath,
643 in string theBaseName,
644 in boolean isPublished,
645 in boolean isMultiFile) raises(StudyInvalidReference);
647 /*! \brief Get an AttributeParameter used to store common parameters for given %theSavePoint.
649 \param theID identifies a common parameters set (Example: "Interface Applicative")
650 \param theSavePoint is number of a set of parameters as there can be several sets
652 AttributeParameter GetCommonParameters(in string theID, in long theSavePoint) raises(StudyInvalidReference);
654 /*! \brief Get an AttributeParameter used to store parameters for given %theModuleName.
656 \param theID identifies a common parameters set (Example: "Interface Applicative")
657 \param theModuleName is a name of the module (Example: "Geometry")
658 \param theSavePoint is number of a set of parameters as there can be several sets
660 AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint) raises(StudyInvalidReference);
663 /*! \brief Get a default Python script to restore visual parameters for given %theModuleName.
665 \param theModuleName is a name of the module (Example: "Geometry")
666 \param indent is a string to use for script indentation
668 string GetDefaultScript(in string theModuleName, in string indent) raises(StudyInvalidReference);
671 Private method, returns an implementation of this Study.
672 \param theHostname is a hostname of the caller
673 \param thePID is a process ID of the caller
674 \param isLocal is set True if the Study is launched locally with the caller
676 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
679 /*! \brief Mark this Study as being locked by the given locker.
681 The lock status can be checked by method IsStudyLocked
682 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
684 void SetStudyLock(in string theLockerID) raises(StudyInvalidReference);
686 /*! \brief Indicate if the Study is locked
688 Returns True if the Study was marked locked.
690 boolean IsStudyLocked() raises(StudyInvalidReference);
692 /*! \brief Mark this Study as being unlocked by the given locker.
694 The lock status can be checked by method IsStudyLocked
695 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
697 void UnLockStudy(in string theLockerID) raises(StudyInvalidReference);
699 /*! \brief Get the list of IDs of the Study's lockers.
701 ListOfStrings GetLockerID() raises(StudyInvalidReference);
703 /*! \brief Create real variable with Name theVarName and value theValue
705 (or set if variable value into theValue already exists)
706 \param theVarName is a name of the variable
707 \param theVarName is a value of the variable.
709 void SetReal( in string theVarName, in double theValue ) raises(StudyInvalidReference);
711 /*! \brief Create integer variable with Name theVarName and value theValue
713 (or set if variable value into theValue already exists)
714 \param theVarName is a name of the variable
715 \param theVarName is a value of the variable.
717 void SetInteger( in string theVarName, in long theValue ) raises(StudyInvalidReference);
718 /*! \brief Create boolean variable with Name theVarName and value theValue
720 (or set if variable value into theValue already exists)
721 \param theVarName is a name of the variable
722 \param theVarName is a value of the variable.
724 void SetBoolean( in string theVarName, in boolean theValue ) raises(StudyInvalidReference);
726 /*! \brief Create string variable with Name theVarName and value theValue
728 (or set if variable value into theValue already exists)
729 \param theVarName is a name of the variable
730 \param theVarName is a value of the variable.
732 void SetString( in string theVarName, in string theValue ) raises(StudyInvalidReference);
734 /*! \brief Set current value as double for string variable
736 void SetStringAsDouble( in string theVarName, in double theValue ) raises(StudyInvalidReference);
738 /*! \brief Get value of a real variable
740 \param theVarName is a name of the variable.
742 double GetReal( in string theVarName ) raises(StudyInvalidReference);
744 /*! \brief Get value of an integer variable
746 \param theVarName is a name of the variable.
748 long GetInteger( in string theVarName ) raises(StudyInvalidReference);
750 /*! \brief Get value of a boolean variable
752 \param theVarName is a name of the variable.
754 boolean GetBoolean( in string theVarName ) raises(StudyInvalidReference);
756 /*! \brief Get value of a string variable
758 \param theVarName is a name of the variable.
760 string GetString( in string theVarName ) raises(StudyInvalidReference);
763 /*! \brief Indicate if a variable is real
765 Return true if variable is real otherwise return false.
766 \param theVarName is a name of the variable.
768 boolean IsReal( in string theVarName ) raises(StudyInvalidReference);
770 /*! \brief Indicate if a variable is integer
772 Return true if variable is integer otherwise return false.
773 \param theVarName is a name of the variable.
775 boolean IsInteger( in string theVarName ) raises(StudyInvalidReference);
777 /*! \brief Indicate if a variable is boolean
779 Return true if variable is boolean otherwise return false.
780 \param theVarName is a name of the variable.
782 boolean IsBoolean( in string theVarName ) raises(StudyInvalidReference);
784 /*! \brief Indicate if a variable is string
786 Return true if variable is string otherwise return false.
787 \param theVarName is a name of the variable.
789 boolean IsString( in string theVarName ) raises(StudyInvalidReference);
791 /*! \brief Indicate if a variable exists in the study
793 Return true if variable exists in the study,
794 otherwise return false.
795 \param theVarName is a name of the variable.
797 boolean IsVariable( in string theVarName ) raises(StudyInvalidReference);
799 /*! \brief Get names of all variables from the study.
801 ListOfStrings GetVariableNames() raises(StudyInvalidReference);
803 /*! \brief Remove a variable
805 Remove variable with the specified name from the study with substitution of its value.
807 \param theVarName Name of the variable.
808 \return Status of operation.
810 boolean RemoveVariable( in string theVarName ) raises(StudyInvalidReference);
812 /*! \brief Rename a variable
814 Rename variable with the specified name within the study.
816 \param theVarName Name of the variable.
817 \param theNewVarName New name for the variable.
818 \return Status of operation.
820 boolean RenameVariable( in string theVarName, in string theNewVarName ) raises(StudyInvalidReference);
822 /*! \brief Indicate whether variable is used
824 Check that variable is used in the study.
826 \param theVarName Name of the variable.
827 \return Variable usage.
829 boolean IsVariableUsed( in string theVarName ) raises(StudyInvalidReference);
831 /*! \brief Parse variables used for object creation
833 \param string with variables, separated by special symbol.
834 \return Variables list.
836 ListOfListOfStrings ParseVariables( in string theVars ) raises(StudyInvalidReference);
839 Attach an observer to the Study
841 \param theObserver observer being attached
842 \param modify when \c true, observer receives any object's modification events;
843 otherwise observer receives object's creation events only
845 void attach(in SALOMEDS::Observer theObserver, in boolean modify);
847 Detach an observer from the Study
849 \param theObserver observer to be detached
851 void detach(in SALOMEDS::Observer theObserver);
854 //==========================================================================
855 /*! \brief %SObject interface
857 The objects in the %study are built by the %StudyBuilder. The %SObject interface
858 provides methods for elementary inquiries, like getting an object %ID or its attribuites.
861 <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
862 in the tree-type data structure.
863 <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
864 ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
866 //==========================================================================
868 interface SObject : SALOME::GenericObj
870 /*! Name of the %SObject
872 attribute string Name; // equivalent to setName() & getName()
874 /*! Returns true if the %SObject does not belong to any %Study
878 /*! Gets an object %ID
879 \return ID of the %SObject.
883 /*! Acquisition of the father %Component of the %SObject
884 \return The father %Component of the %SObject.
886 SComponent GetFatherComponent();
888 /*! Acquisition of the father %SObject of the %SObject
889 \return the father %SObject of the given %SObject.
893 /*! Gets the %tag of a %SObject
894 \return the %tag of a %SObject.
898 /*! Returns a tag of the last child %SObject (if any) of this %SObject.
899 Returns zero if this %SObject has no children.
901 short GetLastChildTag();
903 /*! Gets the depth of a %SObject
904 \return the depth of a %SObject.
908 /*! Looks for subobjects of a given %SObject.
909 \param atag Tag of the given %SObject
910 \return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
912 boolean FindSubObject (in long atag, out SObject obj);
914 /*! Looks for attributes of a given %SObject
915 \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
916 \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
918 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
920 boolean FindAttribute(out GenericAttribute anAttribute,
921 in string aTypeOfAttribute);
923 /*! Looks for a %SObject which the given %SObject refers to.
924 \return The object which the given %SObject refers to as well as True if it finds
927 boolean ReferencedObject(out SObject obj); // A REVOIR
929 /*! Gets all attributes of a given %SObject
930 \return The list of all attributes of the given %SObject.
932 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
935 ListOfAttributes GetAllAttributes();
937 /*! Gets the CORBA object by its own IOR attribute.
938 Returns nil, if can't.
939 \return The CORBA object of the %SObject.
944 Returns the name attribute value of this SObject.
945 Returns empty string if there is no name attribute.
950 Returns the comment attribute value of this SObject.
951 Returns empty string if there is no comment attribute.
956 Returns the IOR attribute value of this SObject.
957 Returns empty string if there is no IOR attribute.
962 Set an attribute value (of type string)
963 \param name the name of the attribute
964 \param value the value of the attribute
966 void SetAttrString(in string name, in string value);
969 Private method, returns an implementation of this SObject.
970 \param theHostname is a hostname of the caller
971 \param thePID is a process ID of the caller
972 \param isLocal is set True if the SObject is launched locally with the caller
974 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
978 //==========================================================================
979 /*! \brief %Generic attribute interface
981 %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
983 //==========================================================================
984 interface GenericAttribute : SALOME::GenericObj
986 /*! \brief Exception locking all changes
988 This exception locks all modifications in attributes.
990 exception LockProtection {};
991 /*! \brief Method CheckLocked
993 Checks whether the %Study is protected for modifications.
995 \note <BR>This exception is raised only outside a transaction.
997 void CheckLocked() raises (LockProtection);
1002 //! Get the class type
1003 string GetClassType();
1006 SObject GetSObject();
1008 //! Private method, returns an implementation of this GenericAttribute.
1010 \param theHostname is a hostname of the caller
1011 \param thePID is a process ID of the caller
1012 \param isLocal is set True if the GenericAttribute is launched locally with the caller
1014 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1019 //==========================================================================
1020 /*! \brief %SComponent interface
1022 The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
1023 The %SComponent interface is a specialization of the %SObject interface.
1024 It inherits the most of its methods from the %SObject interface.
1026 //==========================================================================
1027 interface SComponent : SObject
1029 /*! \brief Gets the data type of the given %SComponent
1031 \return The data type of this %SComponent.
1033 string ComponentDataType();
1034 /*! \brief Gets the IOR of the given component
1036 \return True (if there is an instance of the given component) and its IOR.
1038 boolean ComponentIOR (out ID theID); //returns True if there is an instance
1039 //In this case ID identifies this one
1043 //==========================================================================
1044 /*! \brief %SComponentIterator interface
1046 This interface contains the methods allowing to iterate over all components in the list.
1047 The search is started from the first %SComponent in the list.
1049 //==========================================================================
1050 interface SComponentIterator : SALOME::GenericObj
1053 \brief Activates the %SComponentIterator.
1056 /*! \brief Method More
1058 \return True if there is one more %SComponent in the list.
1062 \brief Moves the iterator to the next %SComponent in the list.
1066 \brief Returns the %SComponent corresponding to the current %SComponent found by the iterator.
1068 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1074 //==========================================================================
1075 /*! \brief %ChildIterator interface
1077 This interface contains methods which allow to iterate over all child
1080 //==========================================================================
1081 interface ChildIterator : SALOME::GenericObj
1085 \brief Activates the %ChildIterator.
1090 \brief Activates the %ChildIterator for all child levels.
1092 \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels.
1094 void InitEx(in boolean allLevels);
1095 /*! \brief Method More
1097 \return True if there is one more %ChildIterator in the list.
1101 \brief Passes the iterator to the next level.
1105 \brief Returns the %SObject corresponding to the current object found by the iterator.
1110 //==========================================================================
1111 //==========================================================================
1112 /*! \brief Interface of the %UseCaseIterator.
1114 This interface contains a set of methods used for iteration over the objects in the use case.
1116 interface UseCaseIterator : SALOME::GenericObj
1119 Activates the %UseCaseIterator.
1120 \param allLevels If the value of this parameter is True the Iterator is activated for all subobjects.
1122 void Init(in boolean allLevels);
1125 \return True if the %UseCaseIterator finds one more object.
1129 Passes the iterator to the next object.
1133 Returns the %SObject corresponding to the current object found by the Iterator.
1138 //==========================================================================
1139 //==========================================================================
1140 /*! \brief Interface of the %UseCaseBuilder
1142 Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
1143 The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
1145 interface UseCaseBuilder : SALOME::GenericObj
1148 Adds to the use case an object as a child of the current object of the use case.
1150 \param theObject The added %SObject.
1151 \return True if this %SObject has been added in the use case.
1153 boolean Append(in SObject theObject);
1155 Removes an object from the use case.
1157 \param theObject The deleted %SObject
1158 \return True if this %SObject has been deleted from the use case.
1160 boolean Remove(in SObject theObject);
1162 Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
1164 boolean AppendTo(in SObject theFather, in SObject theObject);
1166 Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
1168 boolean InsertBefore(in SObject theFirst, in SObject theNext);
1170 Sets the current object of the use case.
1172 boolean SetCurrentObject(in SObject theObject);
1174 Makes the root object to be the current object of the use case.
1176 boolean SetRootCurrent();
1178 Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
1180 boolean HasChildren(in SObject theObject);
1182 Returns True if children of the given object <VAR>theObject</VAR> of the use case tree were sorted successfully.
1184 boolean SortChildren(in SObject theObject, in boolean theAscendingOrder);
1186 Gets father object of the given object <VAR>theObject</VAR> in the use cases tree.
1188 SObject GetFather(in SObject theObject);
1190 Sets the name of the use case.
1192 boolean SetName(in string theName);
1194 Gets the name of the use case.
1198 Returns True if the given object <VAR>theObject</VAR> represents a use case.
1200 boolean IsUseCase(in SObject theObject);
1202 Returns True if the given object <VAR>theObject</VAR> is included in the use cases tree on any level.
1204 boolean IsUseCaseNode(in SObject theObject);
1206 Gets the current object of the use case.
1208 SObject GetCurrentObject();
1210 Creates a new use case in the use case browser.
1212 SObject AddUseCase(in string theName);
1214 Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
1216 UseCaseIterator GetUseCaseIterator(in SObject theObject);
1218 //==========================================================================
1219 /*! \brief %Driver interface
1221 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
1222 can be called by any component and which provide the following functionality:
1224 <li> publishing in the study of the objects created by a definite component
1225 <li> saving/loading of the data created by a definite component. These methods are called when loading/saving a study containing the data created by a definite component.
1226 <li> transforming of the transient references into persistent references (or vice versa) of the SObjects when saving (or loading) a study
1227 <li> copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study
1231 //==========================================================================
1235 /*! \brief Saving the data produced by a definite component.
1237 This method is called when saving a study.
1238 \param theComponent %SComponent corresponding to this Component
1239 \param theURL The path to the file in which the data will be saved.
1240 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1241 \return A byte stream TMPFile that contains all saved data
1243 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1248 TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1250 /*! \brief Saving the data in ASCII format produced by a definite component.
1252 This method is called when saving a study in ASCII format.
1253 \param theComponent %SComponent corresponding to this Component
1254 \param theURL The path to the file in which the data will be saved.
1255 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1256 \return A byte stream TMPFile that will contain all saved data
1258 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1261 TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1263 /*! \brief Loading the data.
1265 This method is called when opening a study.
1266 \param theComponent %SComponent corresponding to this Component
1267 \param theStream The file which contains all data saved by the component on Save method
1268 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1272 boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1274 /*! \brief Loading the data from files in ASCII format.
1276 This method is called when opening a study.
1277 \param theComponent %SComponent corresponding to this Component
1278 \param theStream The file which contains all data saved by the component on Save method
1279 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1283 boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1285 /*! \brief Closing of the study
1287 This method Close is called when closing a study.
1288 \param aSComponent The according %SComponent
1291 void Close (in SComponent aSComponent);
1292 //void Close ( in string aIORSComponent);
1294 /*! Gets the type of the data
1296 \return The type of data produced by the Component in the study.
1299 string ComponentDataType();
1301 // Driver Transient -> persistent called for each object in study
1303 Transforms IOR of a given %SObject into PersistentID. It is called for each
1304 object in the %study.
1305 \note <br> In %SALOME the objects which are present in an active study are identified by an IOR, when this
1306 study is saved these references are transformed into persintent IDs.
1308 \param theSObject The given %SObject.
1309 \param IORString The IOR of the given %SObject.
1310 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1311 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1313 \return The persistent ID of the given %SObject
1316 string IORToLocalPersistentID (in SObject theSObject,
1317 in string IORString,
1318 in boolean isMultiFile,
1319 in boolean isASCII);
1321 Transforms PersistentID into IOR of the object. It is called for each
1322 object in the %study.
1324 \note <br> In %SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this
1325 study is open, these references are transformed into persintent IORs.
1327 \param theSObject The given %SObject.
1328 \param IORString The IOR of the given %SObject.
1329 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1330 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1332 \return The IOR of the given %SObject
1335 string LocalPersistentIDToIOR (in SObject theSObject,
1336 in string aLocalPersistentID,
1337 in boolean isMultiFile,
1339 raises (SALOME::SALOME_Exception);
1341 // Publishing in the study
1342 /*! Publishing in the study
1344 \return True if the given %Component can publish a definite object with a given IOR in the %study.
1345 \param theIOR The IOR of a definite object
1347 boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1348 /*! \brief Publishing in the study
1350 Publishes the given object in the %study, using the algorithm of this component.
1351 \param theSObject If this parameter is null the object is published for the first time. Otherwise
1352 this parameter should contain a reference to the object published earlier
1353 \param theObject The object which is published
1354 \param theName The name of the published object. If this parameter is empty, the name is generated
1355 automatically by the component.
1357 \return The published %SObject.
1359 SObject PublishInStudy(in SObject theSObject, in Object theObject, in string theName);
1361 // copy/paste methods
1364 Returns True, if the given %SObject can be copied to the clipboard.
1366 \param theObject The given %SObject which should be copied.
1368 boolean CanCopy(in SObject theObject);
1370 Returns the object %ID and the %TMPFile of the object from the given %SObject.
1372 TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1374 Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1376 boolean CanPaste(in string theComponentName, in long theObjectID);
1378 Returns the %SObject of the pasted object.
1380 SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);