1 // Copyright (C) 2007-2016 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 string 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 modification dates of a study
59 typedef sequence<string> ListOfDates ;
60 //! An unbounded sequence of strings
61 typedef sequence<string> ListOfStrings ;
62 //! An unbounded sequence of sequence of strings
63 typedef sequence<ListOfStrings> ListOfListOfStrings ;
64 //! A byte stream which is used for binary data transfer between different components
65 typedef sequence<octet> TMPFile;
67 // Reference to other objects is treated with function AddReference
68 // and ReferencedObject
69 // All other type of attributes defined in AttributeType enum are
70 // treated with AddAdttribute and GetAttribute
71 // The difference is made because Reference attribute don't contain
72 // strings but reference to ID of other objects
74 interface GenericAttribute;
76 interface StudyBuilder;
79 interface SComponentIterator;
80 interface ChildIterator;
82 interface AttributeStudyProperties;
83 interface AttributeParameter;
84 interface UseCaseIterator;
85 interface UseCaseBuilder;
89 oneway void notifyObserverID(in string theID, in long event);
93 //! List of attributes of %SObjects
94 typedef sequence<GenericAttribute> ListOfAttributes;
96 //! Exception indicating that this feature hasn't been implemented in %SALOME application.
97 exception NotImplemented {};
99 //==========================================================================
100 /*! \brief %Study Builder Interface
102 The purpose of the Builder is to add and/or remove objects and attributes.
103 A %StudyBuilder is linked to a %Study. A
104 command management is provided for the undo/redo functionalities.
106 <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
107 item's position in the tree-type structure of the browser. In general it has the following
108 form: <TT>0:2:1:1</TT>
110 //==========================================================================
112 interface StudyBuilder
114 /*! \brief %LockProtection Exception
116 This exception is raised while attempting to modify a locked %study.
118 exception LockProtection {};
119 /*! \brief Creation of a new %SComponent.
121 Creates a new %SComponent
122 \param ComponentDataType Data type of the %SComponent which will be created.
124 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
127 SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
128 /*! \brief Definition of the instance to the %SComponent
130 Defines the instance to the %SComponent.
132 void DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
134 /*! \brief Deletion of a %SComponent
136 Removes a %SComponent.
138 void RemoveComponent(in SComponent aComponent) raises(LockProtection);
140 /*! \brief Creation of a new %SObject
142 Creates a new %SObject under a definite father %SObject.
144 \param theFatherObject The father %SObject under which this one should be created.
147 <em>See \ref example18 for an example of this method usage in batchmode of %SALOME application.</em>
151 SObject NewObject (in SObject theFatherObject) raises(LockProtection);
153 /*! \brief Creation of a new %SObject with a definite %tag
155 Creates a new %SObject with a definite %tag.
157 \param atag Long value corresponding to the tag of the new %SObject.
161 SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
162 /*! \brief Deletion of the %SObject
164 Removes a %SObject from the %StudyBuilder.
166 \param anObject The %SObject to be deleted.
168 void RemoveObject (in SObject anObject) raises(LockProtection);
169 /*! \brief Deletion of the %SObject with all his child objects.
171 Removes the %SObject with all his child objects.
173 \param anObject The %SObject to be deleted with all child objects.
175 void RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
180 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
183 void LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
187 \param sco %SObject to be loaded.
189 void Load (in SObject sco);
191 /*! \brief Looking for or creating an attribute assigned to the %SObject
193 Allows to find or create an attribute of a specific type which is assigned to the object.
194 \param anObject The %SObject corresponding to the attribute which is looked for.
195 \param aTypeOfAttribute Type of the attribute.
197 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
200 GenericAttribute FindOrCreateAttribute(in SObject anObject,
201 in string aTypeOfAttribute) raises(LockProtection);
203 /*! \brief Looking for an attribute assigned to a %SObject
205 Allows to find an attribute of a specific type which is assigned to the object.
206 \param anObject The %SObject corresponding to the attribute which is looked for.
207 \param aTypeOfAttribute Type of the attribute.
208 \param anAttribute Where the attribute is placed if it's found.
209 \return True if it finds an attribute.
212 boolean FindAttribute(in SObject anObject,
213 out GenericAttribute anAttribute,
214 in string aTypeOfAttribute);
215 /*! \brief Deleting the attribute assigned to the %SObject
217 Removes the attribute of a specific type which is assigned to the object.
218 \param anObject The %SObject corresponding to the attribute.
219 \param aTypeOfAttribute Type of the attribute.
221 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
223 void RemoveAttribute(in SObject anObject,
224 in string aTypeOfAttribute) raises(LockProtection);
226 Adds a reference between %anObject and %theReferencedObject.
227 \param anObject The %SObject which will get a reference
228 \param theReferencedObject The %SObject having a reference
231 void Addreference(in SObject anObject,
232 in SObject theReferencedObject) ;
235 Removes a reference from %anObject to another object.
236 \param anObject The %SObject which contains a reference
239 void RemoveReference(in SObject anObject) ;
241 /*! \brief Identification of the %SObject's substructure.
243 Identification of the %SObject's substructure by GUID.
246 \param anObject The %SObject which will be identified
247 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
250 void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
252 Searches for a definite %SObject with a definite GUID and returns True if it finds it.
254 \param anObject A definite %SObject which will be identified
255 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
257 boolean IsGUID(in SObject anObject, in string theGUID);
259 /*! \brief Creation of a new command
261 Creates a new command which can contain several different actions.
263 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
266 void NewCommand(); // command management
267 /*! \brief Execution of the command
269 Commits all actions declared within this command.
271 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
273 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
276 void CommitCommand() raises(LockProtection); // command management
278 Returns True if at this moment there is a command under execution.
280 boolean HasOpenCommand();
281 /*! \brief Cancelation of the command
283 Cancels all actions declared within the command.
285 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
287 void AbortCommand(); // command management
290 The number of actions which can be undone
292 attribute long UndoLimit;
293 /*! \brief Undo method
295 Cancels all actions of the last command.
297 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
299 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
302 void Undo() raises (LockProtection);
303 /*! \brief Redo method
305 Redoes all actions of the last command.
307 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
309 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
312 void Redo() raises (LockProtection);
314 Returns True if at this moment there are any actions which can be canceled.
316 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
319 boolean GetAvailableUndos();
321 Returns True if at this moment there are any actions which can be redone.
323 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
326 boolean GetAvailableRedos();
328 Puts name attribute with the given string value to the given %SObject
330 \param theSO Existing SObject to set name attribute.
331 \param theValue The value to be set to the name attribute.
333 void SetName(in SObject theSO, in string theValue) raises (LockProtection);
336 Puts comment attribute with the given string value to the given %SObject
338 \param theSO Existing SObject to set comment attribute.
339 \param theValue The value to be set to the comment attribute.
341 void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
344 Puts IOR attribute with the given string value to the given %SObject
346 \param theSO Existing SObject to set IOR attribute.
347 \param theValue The value to be set to the IOR attribute.
349 void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
352 //===========================================================================
353 /*! \brief %Study Interface
355 The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
356 Most of the %Study operations are handled by the StudyBuilder.
357 What is left in the %Study interface are elementary inquiries.
358 (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
359 and set methods.) A %Study is explored by a set of tools, mainly iterators
360 , which are described further. Nevertheless, the %Study
361 interface allows the search of an object by name or by ID.
363 <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
364 In general it's a string of names of directories divided by a slash '/'.
365 <BR><VAR>The Context</VAR> is the current directory of an object.</P>
371 //! Invalid study reference
372 exception StudyInvalidReference {};
373 //! Invalid study component
374 exception StudyInvalidComponent {};
375 //! Invalid directory of the %study exception
376 exception StudyInvalidDirectory {};
377 //! Exception pointing that this name of the study has already been used.
378 exception StudyNameAlreadyUsed {};
379 //! study object already exists
380 exception StudyObjectAlreadyExists {};
381 //! Invalid name of the %study exception
382 exception StudyNameError {};
383 //! Invalid study comment
384 exception StudyCommentError {};
387 Determines whether the server has already been loaded or not.
392 Returns the PID of the server
397 Shutdown the Study process.
399 oneway void ShutdownWithExit();
401 /*! \brief The name of the %Study
403 This is equivalent to the methods setName() & getName()
405 readonly attribute string Name; // equivalent to getName()
407 //! Sequence containing %SObjects
408 typedef sequence<SObject> ListOfSObject;
409 //! Get the persistent reference to the %Study.
410 PersistentReference GetPersistentReference() raises(StudyInvalidReference);
411 //! Get a transient reference to the %Study.
412 SalomeReference GetTransientReference() raises(StudyInvalidReference);
414 /*! \brief indicate whether the %Study is empty
416 \return True if the %Study is empty
418 boolean IsEmpty() raises(StudyInvalidReference);
419 /*! \brief Find a %SComponent by its name.
421 \param aComponentName It's a string value in the Comment Attribute of the Component,
422 which is looked for, defining the data type of this Component.
424 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
427 SComponent FindComponent (in string aComponentName) raises(StudyInvalidReference);
429 /*! \brief Find a %SComponent by ID of the according %SObject
431 SComponent FindComponentID(in ID aComponentID) raises(StudyInvalidReference);
432 /*! \brief Find a %SObject by the Name Attribute of this %SObject
434 \param anObjectName String parameter defining the name of the object
435 \return The obtained %SObject
437 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
439 SObject FindObject (in string anObjectName) raises(StudyInvalidReference);
440 /*! \brief Find a %SObject by its ID
442 \param aObjectID This parameter defines the ID of the required object
443 \return The obtained %SObject
445 SObject FindObjectID (in ID aObjectID) raises(StudyInvalidReference);
446 /*! \brief Create a %SObject by its ID
448 \param aObjectID This parameter defines the ID of the required object
449 \return The created %SObject
451 SObject CreateObjectID (in ID aObjectID) raises(StudyInvalidReference);
452 /*! \brief Find a %SObject by IOR of the object belonging to this %SObject.
454 \param anObjectName This parameter defines the IOR of the object
455 \return The obtained %SObject
457 SObject FindObjectIOR (in ID aObjectIOR) raises(StudyInvalidReference);
458 /*! \brief Find in the study all %SObjects produced by a given %Component.
460 \param anObjectName The Name Attribute of the searched %SObjects should correspond to <VAR>anObjectName</VAR>.
461 \param aComponentName The name of the component, which objects are searched for.
463 ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName) raises(StudyInvalidReference);
464 /*! \brief Find a %SObject by the path to it.
466 \param thePath The path to the required %SObject.
467 \return The obtained %SObject.
469 SObject FindObjectByPath(in string thePath) raises(StudyInvalidReference);
470 /*! \brief Get the path to the %SObject.
472 string GetObjectPath(in Object theObject) raises(StudyInvalidReference);
474 /*! \brief Create a new iterator of child levels of the given %SObject.
476 \param aSO The given %SObject
477 \return A new iterator of child levels of the given %SObject.
479 ChildIterator NewChildIterator(in SObject aSO) raises(StudyInvalidReference);
481 /*! \brief Create a new iterator of the %SComponents.
483 \return A new iterator of the %SComponents.
485 SComponentIterator NewComponentIterator() raises(StudyInvalidReference);
487 /*! \brief Create a new %StudyBuilder to add or modify an object in the study.
489 \return A new %StudyBuilder.
491 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
493 StudyBuilder NewBuilder() raises(StudyInvalidReference);
494 /*! \brief Labels dependency
496 Updates the map with IOR attribute. It's an inner method used for optimization.
498 void UpdateIORLabelMap(in string anIOR, in string anEntry) raises(StudyInvalidReference);
500 /*! \brief Getting properties of the study
502 Returns the attribute, which contains the properties of this study.
504 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
507 AttributeStudyProperties GetProperties() raises(StudyInvalidReference);
508 /*! \brief Indicate whether the %study has been saved
510 attribute boolean IsSaved;
511 /*! \brief Indicate whether the %study has been modified and not saved.
513 Returns True if the %study has been modified and not saved.
515 boolean IsModified() raises(StudyInvalidReference);
517 /*! \brief Mark the %study as being modified and not saved.
519 void Modified() raises(StudyInvalidReference);
521 /*! \brief Indicate the file where the %study has been saved
523 attribute string URL;
525 /*! \brief List of %SObjects
527 Returns the list of %SObjects which refers to %anObject.
529 ListOfSObject FindDependances(in SObject anObject) raises(StudyInvalidReference);
531 /*! \brief The date of the last saving of the study
533 Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
535 string GetLastModificationDate() raises(StudyInvalidReference);
536 /*! \brief The list of modification dates of the study
538 Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
539 Note : the first modification begins the list.
541 ListOfDates GetModificationsDate() raises(StudyInvalidReference);
542 /*! \brief Object conversion.
544 Converts an object into IOR.
547 string ConvertObjectToIOR(in Object theObject);
548 /*! \brief Object conversion.
550 Converts IOR into an object.
553 Object ConvertIORToObject(in string theIOR);
555 /*! \brief Get a new %UseCaseBuilder.
557 UseCaseBuilder GetUseCaseBuilder() raises(StudyInvalidReference);
559 /*! \brief Clear a study object
561 void Clear() raises(StudyInvalidReference);
563 /*! \brief Initialization a study object
565 void Init() raises(StudyInvalidReference);
567 /*! \brief Open a study by url
569 Reads and activates the structure of the study %Objects.
570 \param aStudyUrl The path to the study
572 boolean Open (in URLPath aStudyUrl) raises (SALOME::SALOME_Exception);
574 /*! \brief Saving the study in a file (or files).
577 \param theMultiFile If this parameter is True the study will be saved in several files.
578 \param theASCII If this parameter is True the study will be saved in ASCII format, otherwise in HDF format.
580 boolean Save(in boolean theMultiFile, in boolean theASCII) raises(StudyInvalidReference);
582 /*! \brief Saving the study in a specified file (or files).
584 Saves the study in a specified file (or files).
585 \param aUrl The path to the definite file in whcih the study will be saved
586 \param theMultiFile If this parameter is True the study will be saved in several files.
587 \param theASCII If this parameter is True the study will be saved in ASCII format, otherwise in HDF format.
589 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
591 boolean SaveAs(in URLPath aUrl, // if the file already exists
592 in boolean theMultiFile, // overwrite (as option)
594 raises(StudyInvalidReference);
596 Returns True, if the given %SObject can be copied to the clipboard.
598 boolean CanCopy(in SObject theObject) raises(StudyInvalidReference);
600 Returns True, if the given %SObject is copied to the clipboard.
601 \param theObject The %SObject which will be copied
603 boolean Copy(in SObject theObject) raises(StudyInvalidReference);
605 Returns True, if the object from the clipboard can be pasted to the given %SObject.
606 \param theObject The %SObject stored in the clipboard.
608 boolean CanPaste(in SObject theObject) raises(StudyInvalidReference);
610 Returns the %SObject in which the object from the clipboard was pasted to.
611 \param theObject The %SObject which will be pasted
612 \exception SALOMEDS::StudyBuilder::LockProtection This exception is raised, when trying to paste
613 an object into a study, which is protected for modifications.
615 SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
617 /*! \brief Enable (if isEnabled = True)/disable automatic addition of new %SObjects to the use case.
619 void EnableUseCaseAutoFilling(in boolean isEnabled) raises(StudyInvalidReference);
622 Functions for internal usage only
624 void AddPostponed(in string theIOR) raises(StudyInvalidReference);
626 void AddCreatedPostponed(in string theIOR) raises(StudyInvalidReference);
628 void RemovePostponed(in long theUndoLimit) raises(StudyInvalidReference);
630 void UndoPostponed(in long theWay) raises(StudyInvalidReference);
632 boolean DumpStudy(in string thePath,
633 in string theBaseName,
634 in boolean isPublished,
635 in boolean isMultiFile) raises(StudyInvalidReference);
637 /*! \brief Get an AttributeParameter used to store common parameters for given %theSavePoint.
639 \param theID identifies a common parameters set (Example: "Interface Applicative")
640 \param theSavePoint is number of a set of parameters as there can be several sets
642 AttributeParameter GetCommonParameters(in string theID, in long theSavePoint) raises(StudyInvalidReference);
644 /*! \brief Get an AttributeParameter used to store parameters for given %theModuleName.
646 \param theID identifies a common parameters set (Example: "Interface Applicative")
647 \param theModuleName is a name of the module (Example: "Geometry")
648 \param theSavePoint is number of a set of parameters as there can be several sets
650 AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint) raises(StudyInvalidReference);
653 /*! \brief Get a default Python script to restore visual parameters for given %theModuleName.
655 \param theModuleName is a name of the module (Example: "Geometry")
656 \param indent is a string to use for script indentation
658 string GetDefaultScript(in string theModuleName, in string indent) raises(StudyInvalidReference);
661 Private method, returns an implementation of this Study.
662 \param theHostname is a hostname of the caller
663 \param thePID is a process ID of the caller
664 \param isLocal is set True if the Study is launched locally with the caller
666 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
669 /*! \brief Mark this Study as being locked by the given locker.
671 The lock status can be checked by method IsStudyLocked
672 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
674 void SetStudyLock(in string theLockerID) raises(StudyInvalidReference);
676 /*! \brief Indicate if the Study is locked
678 Returns True if the Study was marked locked.
680 boolean IsStudyLocked() raises(StudyInvalidReference);
682 /*! \brief Mark this Study as being unlocked by the given locker.
684 The lock status can be checked by method IsStudyLocked
685 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
687 void UnLockStudy(in string theLockerID) raises(StudyInvalidReference);
689 /*! \brief Get the list of IDs of the Study's lockers.
691 ListOfStrings GetLockerID() raises(StudyInvalidReference);
693 /*! \brief Create real variable with Name theVarName and value theValue
695 (or set if variable value into theValue already exists)
696 \param theVarName is a name of the variable
697 \param theVarName is a value of the variable.
699 void SetReal( in string theVarName, in double theValue ) raises(StudyInvalidReference);
701 /*! \brief Create integer variable with Name theVarName and value theValue
703 (or set if variable value into theValue already exists)
704 \param theVarName is a name of the variable
705 \param theVarName is a value of the variable.
707 void SetInteger( in string theVarName, in long theValue ) raises(StudyInvalidReference);
708 /*! \brief Create boolean variable with Name theVarName and value theValue
710 (or set if variable value into theValue already exists)
711 \param theVarName is a name of the variable
712 \param theVarName is a value of the variable.
714 void SetBoolean( in string theVarName, in boolean theValue ) raises(StudyInvalidReference);
716 /*! \brief Create string variable with Name theVarName and value theValue
718 (or set if variable value into theValue already exists)
719 \param theVarName is a name of the variable
720 \param theVarName is a value of the variable.
722 void SetString( in string theVarName, in string theValue ) raises(StudyInvalidReference);
724 /*! \brief Set current value as double for string variable
726 void SetStringAsDouble( in string theVarName, in double theValue ) raises(StudyInvalidReference);
728 /*! \brief Get value of a real variable
730 \param theVarName is a name of the variable.
732 double GetReal( in string theVarName ) raises(StudyInvalidReference);
734 /*! \brief Get value of an integer variable
736 \param theVarName is a name of the variable.
738 long GetInteger( in string theVarName ) raises(StudyInvalidReference);
740 /*! \brief Get value of a boolean variable
742 \param theVarName is a name of the variable.
744 boolean GetBoolean( in string theVarName ) raises(StudyInvalidReference);
746 /*! \brief Get value of a string variable
748 \param theVarName is a name of the variable.
750 string GetString( in string theVarName ) raises(StudyInvalidReference);
753 /*! \brief Indicate if a variable is real
755 Return true if variable is real otherwise return false.
756 \param theVarName is a name of the variable.
758 boolean IsReal( in string theVarName ) raises(StudyInvalidReference);
760 /*! \brief Indicate if a variable is integer
762 Return true if variable is integer otherwise return false.
763 \param theVarName is a name of the variable.
765 boolean IsInteger( in string theVarName ) raises(StudyInvalidReference);
767 /*! \brief Indicate if a variable is boolean
769 Return true if variable is boolean otherwise return false.
770 \param theVarName is a name of the variable.
772 boolean IsBoolean( in string theVarName ) raises(StudyInvalidReference);
774 /*! \brief Indicate if a variable is string
776 Return true if variable is string otherwise return false.
777 \param theVarName is a name of the variable.
779 boolean IsString( in string theVarName ) raises(StudyInvalidReference);
781 /*! \brief Indicate if a variable exists in the study
783 Return true if variable exists in the study,
784 otherwise return false.
785 \param theVarName is a name of the variable.
787 boolean IsVariable( in string theVarName ) raises(StudyInvalidReference);
789 /*! \brief Get names of all variables from the study.
791 ListOfStrings GetVariableNames() raises(StudyInvalidReference);
793 /*! \brief Remove a variable
795 Remove variable with the specified name from the study with substitution of its value.
797 \param theVarName Name of the variable.
798 \return Status of operation.
800 boolean RemoveVariable( in string theVarName ) raises(StudyInvalidReference);
802 /*! \brief Rename a variable
804 Rename variable with the specified name within the study.
806 \param theVarName Name of the variable.
807 \param theNewVarName New name for the variable.
808 \return Status of operation.
810 boolean RenameVariable( in string theVarName, in string theNewVarName ) raises(StudyInvalidReference);
812 /*! \brief Indicate whether variable is used
814 Check that variable is used in the study.
816 \param theVarName Name of the variable.
817 \return Variable usage.
819 boolean IsVariableUsed( in string theVarName ) raises(StudyInvalidReference);
821 /*! \brief Parse variables used for object creation
823 \param string with variables, separated by special symbol.
824 \return Variables list.
826 ListOfListOfStrings ParseVariables( in string theVars ) raises(StudyInvalidReference);
829 Attach an observer to the Study
831 \param theObserver observer being attached
832 \param modify when \c true, observer receives any object's modification events;
833 otherwise observer receives object's creation events only
835 void attach(in SALOMEDS::Observer theObserver, in boolean modify);
837 Detach an observer from the Study
839 \param theObserver observer to be detached
841 void detach(in SALOMEDS::Observer theObserver);
844 //==========================================================================
845 /*! \brief %SObject interface
847 The objects in the %study are built by the %StudyBuilder. The %SObject interface
848 provides methods for elementary inquiries, like getting an object %ID or its attribuites.
851 <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
852 in the tree-type data structure.
853 <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
854 ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
856 //==========================================================================
858 interface SObject : SALOME::GenericObj
860 /*! Name of the %SObject
862 attribute string Name; // equivalent to setName() & getName()
864 /*! Returns true if the %SObject does not belong to any %Study
868 /*! Gets an object %ID
869 \return ID of the %SObject.
873 /*! Acquisition of the father %Component of the %SObject
874 \return The father %Component of the %SObject.
876 SComponent GetFatherComponent();
878 /*! Acquisition of the father %SObject of the %SObject
879 \return the father %SObject of the given %SObject.
883 /*! Gets the %tag of a %SObject
884 \return the %tag of a %SObject.
888 /*! Returns a tag of the last child %SObject (if any) of this %SObject.
889 Returns zero if this %SObject has no children.
891 short GetLastChildTag();
893 /*! Gets the depth of a %SObject
894 \return the depth of a %SObject.
898 /*! Looks for subobjects of a given %SObject.
899 \param atag Tag of the given %SObject
900 \return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
902 boolean FindSubObject (in long atag, out SObject obj);
904 /*! Looks for attributes of a given %SObject
905 \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
906 \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
908 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
910 boolean FindAttribute(out GenericAttribute anAttribute,
911 in string aTypeOfAttribute);
913 /*! Looks for a %SObject which the given %SObject refers to.
914 \return The object which the given %SObject refers to as well as True if it finds
917 boolean ReferencedObject(out SObject obj); // A REVOIR
919 /*! Gets all attributes of a given %SObject
920 \return The list of all attributes of the given %SObject.
922 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
925 ListOfAttributes GetAllAttributes();
927 /*! Gets the study of a given %SObject.
928 \return The study containing the given %SObject.
932 /*! Gets the CORBA object by its own IOR attribute.
933 Returns nil, if can't.
934 \return The CORBA object of the %SObject.
939 Returns the name attribute value of this SObject.
940 Returns empty string if there is no name attribute.
945 Returns the comment attribute value of this SObject.
946 Returns empty string if there is no comment attribute.
951 Returns the IOR attribute value of this SObject.
952 Returns empty string if there is no IOR attribute.
957 Set an attribute value (of type string)
958 \param name the name of the attribute
959 \param value the value of the attribute
961 void SetAttrString(in string name, in string value);
964 Private method, returns an implementation of this SObject.
965 \param theHostname is a hostname of the caller
966 \param thePID is a process ID of the caller
967 \param isLocal is set True if the SObject is launched locally with the caller
969 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
973 //==========================================================================
974 /*! \brief %Generic attribute interface
976 %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
978 //==========================================================================
979 interface GenericAttribute : SALOME::GenericObj
981 /*! \brief Exception locking all changes
983 This exception locks all modifications in attributes.
985 exception LockProtection {};
986 /*! \brief Method CheckLocked
988 Checks whether the %Study is protected for modifications.
990 \note <BR>This exception is raised only outside a transaction.
992 void CheckLocked() raises (LockProtection);
997 //! Get the class type
998 string GetClassType();
1001 SObject GetSObject();
1003 //! Private method, returns an implementation of this GenericAttribute.
1005 \param theHostname is a hostname of the caller
1006 \param thePID is a process ID of the caller
1007 \param isLocal is set True if the GenericAttribute is launched locally with the caller
1009 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1014 //==========================================================================
1015 /*! \brief %SComponent interface
1017 The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
1018 The %SComponent interface is a specialization of the %SObject interface.
1019 It inherits the most of its methods from the %SObject interface.
1021 //==========================================================================
1022 interface SComponent : SObject
1024 /*! \brief Gets the data type of the given %SComponent
1026 \return The data type of this %SComponent.
1028 string ComponentDataType();
1029 /*! \brief Gets the IOR of the given component
1031 \return True (if there is an instance of the given component) and its IOR.
1033 boolean ComponentIOR (out ID theID); //returns True if there is an instance
1034 //In this case ID identifies this one
1038 //==========================================================================
1039 /*! \brief %SComponentIterator interface
1041 This interface contains the methods allowing to iterate over all components in the list.
1042 The search is started from the first %SComponent in the list.
1044 //==========================================================================
1045 interface SComponentIterator : SALOME::GenericObj
1048 \brief Activates the %SComponentIterator.
1051 /*! \brief Method More
1053 \return True if there is one more %SComponent in the list.
1057 \brief Moves the iterator to the next %SComponent in the list.
1061 \brief Returns the %SComponent corresponding to the current %SComponent found by the iterator.
1063 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1069 //==========================================================================
1070 /*! \brief %ChildIterator interface
1072 This interface contains methods which allow to iterate over all child
1075 //==========================================================================
1076 interface ChildIterator : SALOME::GenericObj
1080 \brief Activates the %ChildIterator.
1085 \brief Activates the %ChildIterator for all child levels.
1087 \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels.
1089 void InitEx(in boolean allLevels);
1090 /*! \brief Method More
1092 \return True if there is one more %ChildIterator in the list.
1096 \brief Passes the iterator to the next level.
1100 \brief Returns the %SObject corresponding to the current object found by the iterator.
1105 //==========================================================================
1106 //==========================================================================
1107 /*! \brief Interface of the %UseCaseIterator.
1109 This interface contains a set of methods used for iteration over the objects in the use case.
1111 interface UseCaseIterator : SALOME::GenericObj
1114 Activates the %UseCaseIterator.
1115 \param allLevels If the value of this parameter is True the Iterator is activated for all subobjects.
1117 void Init(in boolean allLevels);
1120 \return True if the %UseCaseIterator finds one more object.
1124 Passes the iterator to the next object.
1128 Returns the %SObject corresponding to the current object found by the Iterator.
1133 //==========================================================================
1134 //==========================================================================
1135 /*! \brief Interface of the %UseCaseBuilder
1137 Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
1138 The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
1140 interface UseCaseBuilder : SALOME::GenericObj
1143 Adds to the use case an object as a child of the current object of the use case.
1145 \param theObject The added %SObject.
1146 \return True if this %SObject has been added in the use case.
1148 boolean Append(in SObject theObject);
1150 Removes an object from the use case.
1152 \param theObject The deleted %SObject
1153 \return True if this %SObject has been deleted from the use case.
1155 boolean Remove(in SObject theObject);
1157 Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
1159 boolean AppendTo(in SObject theFather, in SObject theObject);
1161 Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
1163 boolean InsertBefore(in SObject theFirst, in SObject theNext);
1165 Sets the current object of the use case.
1167 boolean SetCurrentObject(in SObject theObject);
1169 Makes the root object to be the current object of the use case.
1171 boolean SetRootCurrent();
1173 Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
1175 boolean HasChildren(in SObject theObject);
1177 Returns True if children of the given object <VAR>theObject</VAR> of the use case tree were sorted successfully.
1179 boolean SortChildren(in SObject theObject, in boolean theAscendingOrder);
1181 Gets father object of the given object <VAR>theObject</VAR> in the use cases tree.
1183 SObject GetFather(in SObject theObject);
1185 Sets the name of the use case.
1187 boolean SetName(in string theName);
1189 Gets the name of the use case.
1193 Returns True if the given object <VAR>theObject</VAR> represents a use case.
1195 boolean IsUseCase(in SObject theObject);
1197 Returns True if the given object <VAR>theObject</VAR> is included in the use cases tree on any level.
1199 boolean IsUseCaseNode(in SObject theObject);
1201 Gets the current object of the use case.
1203 SObject GetCurrentObject();
1205 Creates a new use case in the use case browser.
1207 SObject AddUseCase(in string theName);
1209 Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
1211 UseCaseIterator GetUseCaseIterator(in SObject theObject);
1213 //==========================================================================
1214 /*! \brief %Driver interface
1216 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
1217 can be called by any component and which provide the following functionality:
1219 <li> publishing in the study of the objects created by a definite component
1220 <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.
1221 <li> transforming of the transient references into persistant references (or vice versa) of the SObjects when saving (or loading) a study
1222 <li> copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study
1226 //==========================================================================
1230 /*! \brief Saving the data produced by a definite component.
1232 This method is called when saving a study.
1233 \param theComponent %SComponent corresponding to this Component
1234 \param theURL The path to the file in which the data will be saved.
1235 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1236 \return A byte stream TMPFile that contains all saved data
1238 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1243 TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1245 /*! \brief Saving the data in ASCII format produced by a definite component.
1247 This method is called when saving a study in ASCII format.
1248 \param theComponent %SComponent corresponding to this Component
1249 \param theURL The path to the file in which the data will be saved.
1250 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1251 \return A byte stream TMPFile that will contain all saved data
1253 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1256 TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1258 /*! \brief Loading the data.
1260 This method is called when opening a study.
1261 \param theComponent %SComponent corresponding to this Component
1262 \param theStream The file which contains all data saved by the component on Save method
1263 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1267 boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1269 /*! \brief Loading the data from files in ASCII format.
1271 This method is called when opening a study.
1272 \param theComponent %SComponent corresponding to this Component
1273 \param theStream The file which contains all data saved by the component on Save method
1274 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1278 boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1280 /*! \brief Closing of the study
1282 This method Close is called when closing a study.
1283 \param aSComponent The according %SComponent
1286 void Close (in SComponent aSComponent);
1287 //void Close ( in string aIORSComponent);
1289 /*! Gets the type of the data
1291 \return The type of data produced by the Component in the study.
1294 string ComponentDataType();
1296 // Driver Transient -> persistent called for each object in study
1298 Transforms IOR of a given %SObject into PersistentID. It is called for each
1299 object in the %study.
1300 \note <br> In %SALOME the objects which are present in an active study are identified by an IOR, when this
1301 study is saved these references are transformed into persintent IDs.
1303 \param theSObject The given %SObject.
1304 \param IORString The IOR of the given %SObject.
1305 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1306 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1308 \return The persistent ID of the given %SObject
1311 string IORToLocalPersistentID (in SObject theSObject,
1312 in string IORString,
1313 in boolean isMultiFile,
1314 in boolean isASCII);
1316 Transforms PersistentID into IOR of the object. It is called for each
1317 object in the %study.
1319 \note <br> In %SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this
1320 study is open, these references are transformed into persintent IORs.
1322 \param theSObject The given %SObject.
1323 \param IORString The IOR of the given %SObject.
1324 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1325 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1327 \return The IOR of the given %SObject
1330 string LocalPersistentIDToIOR (in SObject theSObject,
1331 in string aLocalPersistentID,
1332 in boolean isMultiFile,
1334 raises (SALOME::SALOME_Exception);
1336 // Publishing in the study
1337 /*! Publishing in the study
1339 \return True if the given %Component can publish a definite object with a given IOR in the %study.
1340 \param theIOR The IOR of a definite object
1342 boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1343 /*! \brief Publishing in the study
1345 Publishes the given object in the %study, using the algorithm of this component.
1346 \param theSObject If this parameter is null the object is published for the first time. Otherwise
1347 this parameter should contain a reference to the object published earlier
1348 \param theObject The object which is published
1349 \param theName The name of the published object. If this parameter is empty, the name is generated
1350 automatically by the component.
1352 \return The published %SObject.
1354 SObject PublishInStudy(in SObject theSObject, in Object theObject, in string theName);
1356 // copy/paste methods
1359 Returns True, if the given %SObject can be copied to the clipboard.
1361 \param theObject The given %SObject which should be copied.
1363 boolean CanCopy(in SObject theObject);
1365 Returns the object %ID and the %TMPFile of the object from the given %SObject.
1367 TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1369 Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1371 boolean CanPaste(in string theComponentName, in long theObjectID);
1373 Returns the %SObject of the pasted object.
1375 SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);