1 // Copyright (C) 2007-2023 CEA, EDF, 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 Returns the folder of the python script which is currently dumped.
649 string GetDumpPath();
651 /*! \brief Get an AttributeParameter used to store common parameters for given %theSavePoint.
653 \param theID identifies a common parameters set (Example: "Interface Applicative")
654 \param theSavePoint is number of a set of parameters as there can be several sets
656 AttributeParameter GetCommonParameters(in string theID, in long theSavePoint) raises(StudyInvalidReference);
658 /*! \brief Get an AttributeParameter used to store parameters for given %theModuleName.
660 \param theID identifies a common parameters set (Example: "Interface Applicative")
661 \param theModuleName is a name of the module (Example: "Geometry")
662 \param theSavePoint is number of a set of parameters as there can be several sets
664 AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint) raises(StudyInvalidReference);
667 /*! \brief Get a default Python script to restore visual parameters for given %theModuleName.
669 \param theModuleName is a name of the module (Example: "Geometry")
670 \param indent is a string to use for script indentation
672 string GetDefaultScript(in string theModuleName, in string indent) raises(StudyInvalidReference);
675 Private method, returns an implementation of this Study.
676 \param theHostname is a hostname of the caller
677 \param thePID is a process ID of the caller
678 \param isLocal is set True if the Study is launched locally with the caller
680 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
683 /*! \brief Mark this Study as being locked by the given locker.
685 The lock status can be checked by method IsStudyLocked
686 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
688 void SetStudyLock(in string theLockerID) raises(StudyInvalidReference);
690 /*! \brief Indicate if the Study is locked
692 Returns True if the Study was marked locked.
694 boolean IsStudyLocked() raises(StudyInvalidReference);
696 /*! \brief Mark this Study as being unlocked by the given locker.
698 The lock status can be checked by method IsStudyLocked
699 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
701 void UnLockStudy(in string theLockerID) raises(StudyInvalidReference);
703 /*! \brief Get the list of IDs of the Study's lockers.
705 ListOfStrings GetLockerID() raises(StudyInvalidReference);
707 /*! \brief Create real variable with Name theVarName and value theValue
709 (or set if variable value into theValue already exists)
710 \param theVarName is a name of the variable
711 \param theVarName is a value of the variable.
713 void SetReal( in string theVarName, in double theValue ) raises(StudyInvalidReference);
715 /*! \brief Create integer variable with Name theVarName and value theValue
717 (or set if variable value into theValue already exists)
718 \param theVarName is a name of the variable
719 \param theVarName is a value of the variable.
721 void SetInteger( in string theVarName, in long theValue ) raises(StudyInvalidReference);
722 /*! \brief Create boolean variable with Name theVarName and value theValue
724 (or set if variable value into theValue already exists)
725 \param theVarName is a name of the variable
726 \param theVarName is a value of the variable.
728 void SetBoolean( in string theVarName, in boolean theValue ) raises(StudyInvalidReference);
730 /*! \brief Create string variable with Name theVarName and value theValue
732 (or set if variable value into theValue already exists)
733 \param theVarName is a name of the variable
734 \param theVarName is a value of the variable.
736 void SetString( in string theVarName, in string theValue ) raises(StudyInvalidReference);
738 /*! \brief Set current value as double for string variable
740 void SetStringAsDouble( in string theVarName, in double theValue ) raises(StudyInvalidReference);
742 /*! \brief Get value of a real variable
744 \param theVarName is a name of the variable.
746 double GetReal( in string theVarName ) raises(StudyInvalidReference);
748 /*! \brief Get value of an integer variable
750 \param theVarName is a name of the variable.
752 long GetInteger( in string theVarName ) raises(StudyInvalidReference);
754 /*! \brief Get value of a boolean variable
756 \param theVarName is a name of the variable.
758 boolean GetBoolean( in string theVarName ) raises(StudyInvalidReference);
760 /*! \brief Get value of a string variable
762 \param theVarName is a name of the variable.
764 string GetString( in string theVarName ) raises(StudyInvalidReference);
767 /*! \brief Indicate if a variable is real
769 Return true if variable is real otherwise return false.
770 \param theVarName is a name of the variable.
772 boolean IsReal( in string theVarName ) raises(StudyInvalidReference);
774 /*! \brief Indicate if a variable is integer
776 Return true if variable is integer otherwise return false.
777 \param theVarName is a name of the variable.
779 boolean IsInteger( in string theVarName ) raises(StudyInvalidReference);
781 /*! \brief Indicate if a variable is boolean
783 Return true if variable is boolean otherwise return false.
784 \param theVarName is a name of the variable.
786 boolean IsBoolean( in string theVarName ) raises(StudyInvalidReference);
788 /*! \brief Indicate if a variable is string
790 Return true if variable is string otherwise return false.
791 \param theVarName is a name of the variable.
793 boolean IsString( in string theVarName ) raises(StudyInvalidReference);
795 /*! \brief Indicate if a variable exists in the study
797 Return true if variable exists in the study,
798 otherwise return false.
799 \param theVarName is a name of the variable.
801 boolean IsVariable( in string theVarName ) raises(StudyInvalidReference);
803 /*! \brief Get names of all variables from the study.
805 ListOfStrings GetVariableNames() raises(StudyInvalidReference);
807 /*! \brief Remove a variable
809 Remove variable with the specified name from the study with substitution of its value.
811 \param theVarName Name of the variable.
812 \return Status of operation.
814 boolean RemoveVariable( in string theVarName ) raises(StudyInvalidReference);
816 /*! \brief Rename a variable
818 Rename variable with the specified name within the study.
820 \param theVarName Name of the variable.
821 \param theNewVarName New name for the variable.
822 \return Status of operation.
824 boolean RenameVariable( in string theVarName, in string theNewVarName ) raises(StudyInvalidReference);
826 /*! \brief Indicate whether variable is used
828 Check that variable is used in the study.
830 \param theVarName Name of the variable.
831 \return Variable usage.
833 boolean IsVariableUsed( in string theVarName ) raises(StudyInvalidReference);
835 /*! \brief Parse variables used for object creation
837 \param string with variables, separated by special symbol.
838 \return Variables list.
840 ListOfListOfStrings ParseVariables( in string theVars ) raises(StudyInvalidReference);
843 Attach an observer to the Study
845 \param theObserver observer being attached
846 \param modify when \c true, observer receives any object's modification events;
847 otherwise observer receives object's creation events only
849 void attach(in SALOMEDS::Observer theObserver, in boolean modify);
851 Detach an observer from the Study
853 \param theObserver observer to be detached
855 void detach(in SALOMEDS::Observer theObserver);
858 //==========================================================================
859 /*! \brief %SObject interface
861 The objects in the %study are built by the %StudyBuilder. The %SObject interface
862 provides methods for elementary inquiries, like getting an object %ID or its attribuites.
865 <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
866 in the tree-type data structure.
867 <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
868 ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
870 //==========================================================================
872 interface SObject : SALOME::GenericObj
874 /*! Name of the %SObject
876 attribute string Name; // equivalent to setName() & getName()
878 /*! Returns true if the %SObject does not belong to any %Study
882 /*! Gets an object %ID
883 \return ID of the %SObject.
887 /*! Acquisition of the father %Component of the %SObject
888 \return The father %Component of the %SObject.
890 SComponent GetFatherComponent();
892 /*! Acquisition of the father %SObject of the %SObject
893 \return the father %SObject of the given %SObject.
897 /*! Gets the %tag of a %SObject
898 \return the %tag of a %SObject.
902 /*! Returns a tag of the last child %SObject (if any) of this %SObject.
903 Returns zero if this %SObject has no children.
905 short GetLastChildTag();
907 /*! Gets the depth of a %SObject
908 \return the depth of a %SObject.
912 /*! Looks for subobjects of a given %SObject.
913 \param atag Tag of the given %SObject
914 \return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
916 boolean FindSubObject (in long atag, out SObject obj);
918 /*! Looks for attributes of a given %SObject
919 \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
920 \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
922 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
924 boolean FindAttribute(out GenericAttribute anAttribute,
925 in string aTypeOfAttribute);
927 /*! Looks for a %SObject which the given %SObject refers to.
928 \return The object which the given %SObject refers to as well as True if it finds
931 boolean ReferencedObject(out SObject obj); // A REVOIR
933 /*! Gets all attributes of a given %SObject
934 \return The list of all attributes of the given %SObject.
936 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
939 ListOfAttributes GetAllAttributes();
941 /*! Gets the CORBA object by its own IOR attribute.
942 Returns nil, if can't.
943 \return The CORBA object of the %SObject.
948 Returns the name attribute value of this SObject.
949 Returns empty string if there is no name attribute.
954 Returns the comment attribute value of this SObject.
955 Returns empty string if there is no comment attribute.
960 Returns the IOR attribute value of this SObject.
961 Returns empty string if there is no IOR attribute.
966 Set an attribute value (of type string)
967 \param name the name of the attribute
968 \param value the value of the attribute
970 void SetAttrString(in string name, in string value);
973 Private method, returns an implementation of this SObject.
974 \param theHostname is a hostname of the caller
975 \param thePID is a process ID of the caller
976 \param isLocal is set True if the SObject is launched locally with the caller
978 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
982 //==========================================================================
983 /*! \brief %Generic attribute interface
985 %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
987 //==========================================================================
988 interface GenericAttribute : SALOME::GenericObj
990 /*! \brief Exception locking all changes
992 This exception locks all modifications in attributes.
994 exception LockProtection {};
995 /*! \brief Method CheckLocked
997 Checks whether the %Study is protected for modifications.
999 \note <BR>This exception is raised only outside a transaction.
1001 void CheckLocked() raises (LockProtection);
1006 //! Get the class type
1007 string GetClassType();
1010 SObject GetSObject();
1012 //! Private method, returns an implementation of this GenericAttribute.
1014 \param theHostname is a hostname of the caller
1015 \param thePID is a process ID of the caller
1016 \param isLocal is set True if the GenericAttribute is launched locally with the caller
1018 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1023 //==========================================================================
1024 /*! \brief %SComponent interface
1026 The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
1027 The %SComponent interface is a specialization of the %SObject interface.
1028 It inherits the most of its methods from the %SObject interface.
1030 //==========================================================================
1031 interface SComponent : SObject
1033 /*! \brief Gets the data type of the given %SComponent
1035 \return The data type of this %SComponent.
1037 string ComponentDataType();
1038 /*! \brief Gets the IOR of the given component
1040 \return True (if there is an instance of the given component) and its IOR.
1042 boolean ComponentIOR (out ID theID); //returns True if there is an instance
1043 //In this case ID identifies this one
1047 //==========================================================================
1048 /*! \brief %SComponentIterator interface
1050 This interface contains the methods allowing to iterate over all components in the list.
1051 The search is started from the first %SComponent in the list.
1053 //==========================================================================
1054 interface SComponentIterator : SALOME::GenericObj
1057 \brief Activates the %SComponentIterator.
1060 /*! \brief Method More
1062 \return True if there is one more %SComponent in the list.
1066 \brief Moves the iterator to the next %SComponent in the list.
1070 \brief Returns the %SComponent corresponding to the current %SComponent found by the iterator.
1072 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1078 //==========================================================================
1079 /*! \brief %ChildIterator interface
1081 This interface contains methods which allow to iterate over all child
1084 //==========================================================================
1085 interface ChildIterator : SALOME::GenericObj
1089 \brief Activates the %ChildIterator.
1094 \brief Activates the %ChildIterator for all child levels.
1096 \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels.
1098 void InitEx(in boolean allLevels);
1099 /*! \brief Method More
1101 \return True if there is one more %ChildIterator in the list.
1105 \brief Passes the iterator to the next level.
1109 \brief Returns the %SObject corresponding to the current object found by the iterator.
1114 //==========================================================================
1115 //==========================================================================
1116 /*! \brief Interface of the %UseCaseIterator.
1118 This interface contains a set of methods used for iteration over the objects in the use case.
1120 interface UseCaseIterator : SALOME::GenericObj
1123 Activates the %UseCaseIterator.
1124 \param allLevels If the value of this parameter is True the Iterator is activated for all subobjects.
1126 void Init(in boolean allLevels);
1129 \return True if the %UseCaseIterator finds one more object.
1133 Passes the iterator to the next object.
1137 Returns the %SObject corresponding to the current object found by the Iterator.
1142 //==========================================================================
1143 //==========================================================================
1144 /*! \brief Interface of the %UseCaseBuilder
1146 Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
1147 The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
1149 interface UseCaseBuilder : SALOME::GenericObj
1152 Adds to the use case an object as a child of the current object of the use case.
1154 \param theObject The added %SObject.
1155 \return True if this %SObject has been added in the use case.
1157 boolean Append(in SObject theObject);
1159 Removes an object from the use case.
1161 \param theObject The deleted %SObject
1162 \return True if this %SObject has been deleted from the use case.
1164 boolean Remove(in SObject theObject);
1166 Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
1168 boolean AppendTo(in SObject theFather, in SObject theObject);
1170 Return index of a child among father children
1172 long GetIndexInFather(in SObject theFather, in SObject theObject);
1174 Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
1176 boolean InsertBefore(in SObject theFirst, in SObject theNext);
1178 Sets the current object of the use case.
1180 boolean SetCurrentObject(in SObject theObject);
1182 Makes the root object to be the current object of the use case.
1184 boolean SetRootCurrent();
1186 Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
1188 boolean HasChildren(in SObject theObject);
1190 Returns True if children of the given object <VAR>theObject</VAR> of the use case tree were sorted successfully.
1192 boolean SortChildren(in SObject theObject, in boolean theAscendingOrder);
1194 Gets father object of the given object <VAR>theObject</VAR> in the use cases tree.
1196 SObject GetFather(in SObject theObject);
1198 Sets the name of the use case.
1200 boolean SetName(in string theName);
1202 Gets the name of the use case.
1206 Returns True if the given object <VAR>theObject</VAR> represents a use case.
1208 boolean IsUseCase(in SObject theObject);
1210 Returns True if the given object <VAR>theObject</VAR> is included in the use cases tree on any level.
1212 boolean IsUseCaseNode(in SObject theObject);
1214 Gets the current object of the use case.
1216 SObject GetCurrentObject();
1218 Creates a new use case in the use case browser.
1220 SObject AddUseCase(in string theName);
1222 Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
1224 UseCaseIterator GetUseCaseIterator(in SObject theObject);
1226 //==========================================================================
1227 /*! \brief %Driver interface
1229 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
1230 can be called by any component and which provide the following functionality:
1232 <li> publishing in the study of the objects created by a definite component
1233 <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.
1234 <li> transforming of the transient references into persistent references (or vice versa) of the SObjects when saving (or loading) a study
1235 <li> copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study
1239 //==========================================================================
1243 /*! \brief Saving the data produced by a definite component.
1245 This method is called when saving a study.
1246 \param theComponent %SComponent corresponding to this Component
1247 \param theURL The path to the file in which the data will be saved.
1248 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1249 \return A byte stream TMPFile that contains all saved data
1251 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1256 TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1258 /*! \brief Saving the data in ASCII format produced by a definite component.
1260 This method is called when saving a study in ASCII format.
1261 \param theComponent %SComponent corresponding to this Component
1262 \param theURL The path to the file in which the data will be saved.
1263 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1264 \return A byte stream TMPFile that will contain all saved data
1266 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1269 TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1271 /*! \brief Loading the data.
1273 This method is called when opening a study.
1274 \param theComponent %SComponent corresponding to this Component
1275 \param theStream The file which contains all data saved by the component on Save method
1276 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1280 boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1282 /*! \brief Loading the data from files in ASCII format.
1284 This method is called when opening a study.
1285 \param theComponent %SComponent corresponding to this Component
1286 \param theStream The file which contains all data saved by the component on Save method
1287 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1291 boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1293 /*! \brief Closing of the study
1295 This method Close is called when closing a study.
1296 \param aSComponent The according %SComponent
1299 void Close (in SComponent aSComponent);
1300 //void Close ( in string aIORSComponent);
1302 /*! Gets the type of the data
1304 \return The type of data produced by the Component in the study.
1307 string ComponentDataType();
1309 // Driver Transient -> persistent called for each object in study
1311 Transforms IOR of a given %SObject into PersistentID. It is called for each
1312 object in the %study.
1313 \note <br> In %SALOME the objects which are present in an active study are identified by an IOR, when this
1314 study is saved these references are transformed into persintent IDs.
1316 \param theSObject The given %SObject.
1317 \param IORString The IOR of the given %SObject.
1318 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1319 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1321 \return The persistent ID of the given %SObject
1324 string IORToLocalPersistentID (in SObject theSObject,
1325 in string IORString,
1326 in boolean isMultiFile,
1327 in boolean isASCII);
1329 Transforms PersistentID into IOR of the object. It is called for each
1330 object in the %study.
1332 \note <br> In %SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this
1333 study is open, these references are transformed into persintent IORs.
1335 \param theSObject The given %SObject.
1336 \param IORString The IOR of the given %SObject.
1337 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1338 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1340 \return The IOR of the given %SObject
1343 string LocalPersistentIDToIOR (in SObject theSObject,
1344 in string aLocalPersistentID,
1345 in boolean isMultiFile,
1347 raises (SALOME::SALOME_Exception);
1349 // Publishing in the study
1350 /*! Publishing in the study
1352 \return True if the given %Component can publish a definite object with a given IOR in the %study.
1353 \param theIOR The IOR of a definite object
1355 boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1356 /*! \brief Publishing in the study
1358 Publishes the given object in the %study, using the algorithm of this component.
1359 \param theSObject If this parameter is null the object is published for the first time. Otherwise
1360 this parameter should contain a reference to the object published earlier
1361 \param theObject The object which is published
1362 \param theName The name of the published object. If this parameter is empty, the name is generated
1363 automatically by the component.
1365 \return The published %SObject.
1367 SObject PublishInStudy(in SObject theSObject, in Object theObject, in string theName);
1369 // copy/paste methods
1372 Returns True, if the given %SObject can be copied to the clipboard.
1374 \param theObject The given %SObject which should be copied.
1376 boolean CanCopy(in SObject theObject);
1378 Returns the object %ID and the %TMPFile of the object from the given %SObject.
1380 TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1382 Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1384 boolean CanPaste(in string theComponentName, in long theObjectID);
1386 Returns the %SObject of the pasted object.
1388 SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);