1 // Copyright (C) 2007-2014 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.
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 /*! \brief List of the names of studies which are currently open in this %SALOME session.
60 Since %SALOME is a multi-study application, it allows to open a lot of studies
61 during each working session.
63 typedef sequence<string> ListOfOpenStudies;
64 //! List of file names
65 typedef sequence<string> ListOfFileNames;
66 //! List of modification dates of a study
67 typedef sequence<string> ListOfDates ;
68 //! An unbounded sequence of strings
69 typedef sequence<string> ListOfStrings ;
70 //! An unbounded sequence of sequence of strings
71 typedef sequence<ListOfStrings> ListOfListOfStrings ;
72 //! A byte stream which is used for binary data transfer between different components
73 typedef sequence<octet> TMPFile;
75 // Reference to other objects is treated with function AddReference
76 // and ReferencedObject
77 // All other type of attributes defined in AttributeType enum are
78 // treated with AddAdttribute and GetAttribute
79 // The difference is made because Reference attribute don't contain
80 // strings but reference to ID of other objects
82 interface GenericAttribute;
84 interface StudyManager;
85 interface StudyBuilder;
88 interface SComponentIterator;
89 interface ChildIterator;
91 interface AttributeStudyProperties;
92 interface AttributeParameter;
93 interface UseCaseIterator;
94 interface UseCaseBuilder;
98 oneway void notifyObserverID(in string theID, in long event);
102 //! List of attributes of %SObjects
103 typedef sequence<GenericAttribute> ListOfAttributes;
105 //! Exception indicating that this feature hasn't been implemented in %SALOME application.
106 exception NotImplemented {};
109 //===========================================================================
110 /*! \brief %Study Interface
112 The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
113 Most of the %Study operations are handled by the StudyManager and the StudyBuilder.
114 What is left in the %Study interface are elementary inquiries.
115 (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
116 and set methods.) A %Study is explored by a set of tools, mainly iterators
117 , which are described further. Nevertheless, the %Study
118 interface allows the search of an object by name or by ID.
120 <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
121 In general it's a string of names of directories divided by a slash '/'.
122 <BR><VAR>The Context</VAR> is the current directory of an object.</P>
128 //! Invalid study context
129 exception StudyInvalidContext {};
130 //! Invalid study component
131 exception StudyInvalidComponent {};
132 //! Invalid directory of the %study exception
133 exception StudyInvalidDirectory {};
134 //! Exception pointing that this name of the study has already been used.
135 exception StudyNameAlreadyUsed {};
136 //! study object already exists
137 exception StudyObjectAlreadyExists {};
138 //! Invalid name of the %study exception
139 exception StudyNameError {};
140 //! Invalid study comment
141 exception StudyCommentError {};
143 /*! \brief The name of the %Study
145 This is equivalent to the methods setName() & getName()
147 attribute string Name; // equivalent to setName() & getName()
148 /*! \brief The ID of the %Study
150 This is equivalent to the methods setID() & getID()
152 attribute short StudyId;
153 //! Sequence containing %SObjects
154 typedef sequence<SObject> ListOfSObject;
155 //! Get the persistent reference to the %Study.
156 PersistentReference GetPersistentReference();
157 //! Get a transient reference to the %Study.
158 SalomeReference GetTransientReference();
160 /*! \brief indicate whether the %Study is empty
162 \return True if the %Study is empty
165 /*! \brief Find a %SComponent by its name.
167 \param aComponentName It's a string value in the Comment Attribute of the Component,
168 which is looked for, defining the data type of this Component.
170 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
173 SComponent FindComponent (in string aComponentName);
175 /*! \brief Find a %SComponent by ID of the according %SObject
177 SComponent FindComponentID(in ID aComponentID);
178 /*! \brief Find a %SObject by the Name Attribute of this %SObject
180 \param anObjectName String parameter defining the name of the object
181 \return The obtained %SObject
183 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
185 SObject FindObject (in string anObjectName);
186 /*! \brief Find a %SObject by its ID
188 \param aObjectID This parameter defines the ID of the required object
189 \return The obtained %SObject
191 SObject FindObjectID (in ID aObjectID);
192 /*! \brief Create a %SObject by its ID
194 \param aObjectID This parameter defines the ID of the required object
195 \return The created %SObject
197 SObject CreateObjectID (in ID aObjectID);
198 /*! \brief Find a %SObject by IOR of the object belonging to this %SObject.
200 \param anObjectName This parameter defines the IOR of the object
201 \return The obtained %SObject
203 SObject FindObjectIOR (in ID aObjectIOR);
204 /*! \brief Find in the study all %SObjects produced by a given %Component.
206 \param anObjectName The Name Attribute of the searched %SObjects should correspond to <VAR>anObjectName</VAR>.
207 \param aComponentName The name of the component, which objects are searched for.
209 ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName);
210 /*! \brief Find a %SObject by the path to it.
212 \param thePath The path to the required %SObject.
213 \return The obtained %SObject.
215 SObject FindObjectByPath(in string thePath);
216 /*! \brief Get the path to the %SObject.
218 string GetObjectPath(in Object theObject);
220 /*! \brief Set the context of the %Study.
222 \param thePath String parameter defining the context of the study.
224 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
226 void SetContext(in string thePath);
227 /*! \brief Get the context of the %Study.
229 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
232 /*! \brief Get a list of names of objects corresponding to the context.
234 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
236 ListOfStrings GetObjectNames(in string theContext);
237 /*! \brief Get a list of names of directories and subdirectories corresponding to the context.
239 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
241 ListOfStrings GetDirectoryNames(in string theContext);
242 /*! \brief Get a list of names of Files corresponding to the context.
244 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
246 ListOfStrings GetFileNames(in string theContext);
247 /*! \brief Get a list of names of Components corresponding to the context.
249 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
251 ListOfStrings GetComponentNames(in string theContext);
252 /*! \brief Create a new iterator of child levels of the given %SObject.
254 \param aSO The given %SObject
255 \return A new iterator of child levels of the given %SObject.
257 ChildIterator NewChildIterator(in SObject aSO);
259 /*! \brief Create a new iterator of the %SComponents.
261 \return A new iterator of the %SComponents.
263 SComponentIterator NewComponentIterator();
265 /*! \brief Create a new %StudyBuilder to add or modify an object in the study.
267 \return A new %StudyBuilder.
269 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
271 StudyBuilder NewBuilder() ;
272 /*! \brief Labels dependency
274 Updates the map with IOR attribute. It's an inner method used for optimization.
276 void UpdateIORLabelMap(in string anIOR, in string anEntry);
278 /*! \brief Getting properties of the study
280 Returns the attribute, which contains the properties of this study.
282 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
285 AttributeStudyProperties GetProperties();
286 /*! \brief Indicate whether the %study has been saved
288 attribute boolean IsSaved;
289 /*! \brief Indicate whether the %study has been modified and not saved.
291 Returns True if the %study has been modified and not saved.
293 boolean IsModified();
295 /*! \brief Mark the %study as being modified and not saved.
299 /*! \brief Indicate the file where the %study has been saved
301 attribute string URL;
303 /*! \brief List of %SObjects
305 Returns the list of %SObjects which refers to %anObject.
307 ListOfSObject FindDependances(in SObject anObject);
309 /*! \brief The date of the last saving of the study
311 Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
313 string GetLastModificationDate();
314 /*! \brief The list of modification dates of the study
316 Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
317 Note : the first modification begins the list.
319 ListOfDates GetModificationsDate();
320 /*! \brief Object conversion.
322 Converts an object into IOR.
325 string ConvertObjectToIOR(in Object theObject);
326 /*! \brief Object conversion.
328 Converts IOR into an object.
331 Object ConvertIORToObject(in string theIOR);
333 /*! \brief Get a new %UseCaseBuilder.
335 UseCaseBuilder GetUseCaseBuilder();
337 /*! \brief Close the components in the study, remove itself from the %StudyManager.
341 /*! \brief Enable (if isEnabled = True)/disable automatic addition of new %SObjects to the use case.
343 void EnableUseCaseAutoFilling(in boolean isEnabled);
346 Functions for internal usage only
348 void AddPostponed(in string theIOR);
350 void AddCreatedPostponed(in string theIOR);
352 void RemovePostponed(in long theUndoLimit);
354 void UndoPostponed(in long theWay);
356 boolean DumpStudy(in string thePath,
357 in string theBaseName,
358 in boolean isPublished,
359 in boolean isMultiFile);
361 /*! \brief Get an AttributeParameter used to store common parameters for given %theSavePoint.
363 \param theID identifies a common parameters set (Example: "Interface Applicative")
364 \param theSavePoint is number of a set of parameters as there can be several sets
366 AttributeParameter GetCommonParameters(in string theID, in long theSavePoint);
368 /*! \brief Get an AttributeParameter used to store parameters for given %theModuleName.
370 \param theID identifies a common parameters set (Example: "Interface Applicative")
371 \param theModuleName is a name of the module (Example: "Geometry")
372 \param theSavePoint is number of a set of parameters as there can be several sets
374 AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint);
377 /*! \brief Get a default Python script to restore visual parameters for given %theModuleName.
379 \param theModuleName is a name of the module (Example: "Geometry")
380 \param indent is a string to use for script indentation
382 string GetDefaultScript(in string theModuleName, in string indent);
385 Private method, returns an implementation of this Study.
386 \param theHostname is a hostname of the caller
387 \param thePID is a process ID of the caller
388 \param isLocal is set True if the Study is launched locally with the caller
390 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
393 /*! \brief Mark this Study as being locked by the given locker.
395 The lock status can be checked by method IsStudyLocked
396 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
398 void SetStudyLock(in string theLockerID);
400 /*! \brief Indicate if the Study is locked
402 Returns True if the Study was marked locked.
404 boolean IsStudyLocked();
406 /*! \brief Mark this Study as being unlocked by the given locker.
408 The lock status can be checked by method IsStudyLocked
409 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
411 void UnLockStudy(in string theLockerID);
413 /*! \brief Get the list of IDs of the Study's lockers.
415 ListOfStrings GetLockerID();
417 /*! \brief Create real variable with Name theVarName and value theValue
419 (or set if variable value into theValue already exists)
420 \param theVarName is a name of the variable
421 \param theVarName is a value of the variable.
423 void SetReal( in string theVarName, in double theValue );
425 /*! \brief Create integer variable with Name theVarName and value theValue
427 (or set if variable value into theValue already exists)
428 \param theVarName is a name of the variable
429 \param theVarName is a value of the variable.
431 void SetInteger( in string theVarName, in long theValue );
432 /*! \brief Create boolean variable with Name theVarName and value theValue
434 (or set if variable value into theValue already exists)
435 \param theVarName is a name of the variable
436 \param theVarName is a value of the variable.
438 void SetBoolean( in string theVarName, in boolean theValue );
440 /*! \brief Create string variable with Name theVarName and value theValue
442 (or set if variable value into theValue already exists)
443 \param theVarName is a name of the variable
444 \param theVarName is a value of the variable.
446 void SetString( in string theVarName, in string theValue );
448 /*! \brief Set current value as double for string variable
450 void SetStringAsDouble( in string theVarName, in double theValue );
452 /*! \brief Get value of a real variable
454 \param theVarName is a name of the variable.
456 double GetReal( in string theVarName );
458 /*! \brief Get value of an integer variable
460 \param theVarName is a name of the variable.
462 long GetInteger( in string theVarName );
464 /*! \brief Get value of a boolean variable
466 \param theVarName is a name of the variable.
468 boolean GetBoolean( in string theVarName );
470 /*! \brief Get value of a string variable
472 \param theVarName is a name of the variable.
474 string GetString( in string theVarName );
477 /*! \brief Indicate if a variable is real
479 Return true if variable is real otherwise return false.
480 \param theVarName is a name of the variable.
482 boolean IsReal( in string theVarName );
484 /*! \brief Indicate if a variable is integer
486 Return true if variable is integer otherwise return false.
487 \param theVarName is a name of the variable.
489 boolean IsInteger( in string theVarName );
491 /*! \brief Indicate if a variable is boolean
493 Return true if variable is boolean otherwise return false.
494 \param theVarName is a name of the variable.
496 boolean IsBoolean( in string theVarName );
498 /*! \brief Indicate if a variable is string
500 Return true if variable is string otherwise return false.
501 \param theVarName is a name of the variable.
503 boolean IsString( in string theVarName );
505 /*! \brief Indicate if a variable exists in the study
507 Return true if variable exists in the study,
508 otherwise return false.
509 \param theVarName is a name of the variable.
511 boolean IsVariable( in string theVarName );
513 /*! \brief Get names of all variables from the study.
515 ListOfStrings GetVariableNames();
517 /*! \brief Remove a variable
519 Remove variable with the specified name from the study with substitution of its value.
521 \param theVarName Name of the variable.
522 \return Status of operation.
524 boolean RemoveVariable( in string theVarName );
526 /*! \brief Rename a variable
528 Rename variable with the specified name within the study.
530 \param theVarName Name of the variable.
531 \param theNewVarName New name for the variable.
532 \return Status of operation.
534 boolean RenameVariable( in string theVarName, in string theNewVarName );
536 /*! \brief Indicate whether variable is used
538 Check that variable is used in the study.
540 \param theVarName Name of the variable.
541 \return Variable usage.
543 boolean IsVariableUsed( in string theVarName );
545 /*! \brief Parse variables used for object creation
547 \param string with variables, separated by special symbol.
548 \return Variables list.
550 ListOfListOfStrings ParseVariables( in string theVars );
553 Attach an observer to the Study
555 \param theObserver observer being attached
556 \param modify when \c true, observer receives any object's modification events;
557 otherwise observer receives object's creation events only
559 void attach(in SALOMEDS::Observer theObserver, in boolean modify);
561 Detach an observer from the Study
563 \param theObserver observer to be detached
565 void detach(in SALOMEDS::Observer theObserver);
568 //===========================================================================
569 /*! \brief %SimanStudy Interface
571 The Siman (simulation management) study is an interface extension to the %Study
572 with functions for working with SIMAN server. Is allows to get data from SIMAN (check-out operation)
573 and to store it back (check-in operation).
574 This interface is correctly working if SALOME is compiled with SimanIO library, launched with siman
575 option and connection to SIMAN server is established and alive. Only one study per application,
576 checked out from the SIMAN is SimanStudy. For other studies all functionality is unaccessible.
582 //! No connection with SIMAN server
583 exception SimanStudyNoConnection {};
584 //! There is no SimanStudy with: study with checked out data.
585 exception SimanStudyNotExists {};
587 /*! \brief The ID of the study in SIMAN server
589 This is equivalent to the methods setStudyId() & getStudyId()
591 attribute string StudyId;
593 /*! \brief The ID of the scenario in SIMAN server
595 This is equivalent to the methods setScenarioId() & getScenarioId()
597 attribute string ScenarioId;
598 /*! \brief The ID of the user in SIMAN server
600 This is equivalent to the methods setUserId() & getUserId()
602 attribute string UserId;
604 /*! \brief Get data from SIMAN and put it to the given study
606 This method is called for just created study to make it referenced
607 by this Siman study. Also it fills this study by the checked out
608 data from SIMAN server.
609 Warning: StudyID, ScenarioID and User Id must be set before calling of this method!
611 \param theTarget referenced study for checking out
613 void CheckOut(in Study theTarget);
615 /*! \brief Get data from the source study and store in SIMAN
617 It works only with already checked out study.
618 \param theModuleName name of the module the check in must be perfrormed for. If empty, check in is performed for all modules.
620 void CheckIn(in string theModuleName);
622 /*! \brief Returns the %Study with checked out data
624 If study is null, there is no such study in this application instance, or Salome was
625 launched without siman option.
627 Study getReferencedStudy();
631 //==========================================================================
632 /*! \brief %Study Builder Interface
634 The purpose of the Builder is to add and/or remove objects and attributes.
635 A %StudyBuilder is linked to a %Study. A
636 command management is provided for the undo/redo functionalities.
638 <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
639 item's position in the tree-type structure of the browser. In general it has the following
640 form: <TT>0:2:1:1</TT>
642 //==========================================================================
644 interface StudyBuilder
646 /*! \brief %LockProtection Exception
648 This exception is raised while attempting to modify a locked %study.
650 exception LockProtection {};
651 /*! \brief Creation of a new %SComponent.
653 Creates a new %SComponent
654 \param ComponentDataType Data type of the %SComponent which will be created.
656 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
659 SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
660 /*! \brief Definition of the instance to the %SComponent
662 Defines the instance to the %SComponent.
664 void DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
666 /*! \brief Deletion of a %SComponent
668 Removes a %SComponent.
670 void RemoveComponent(in SComponent aComponent) raises(LockProtection);
672 /*! \brief Creation of a new %SObject
674 Creates a new %SObject under a definite father %SObject.
676 \param theFatherObject The father %SObject under which this one should be created.
679 <em>See \ref example18 for an example of this method usage in batchmode of %SALOME application.</em>
683 SObject NewObject (in SObject theFatherObject) raises(LockProtection);
685 /*! \brief Creation of a new %SObject with a definite %tag
687 Creates a new %SObject with a definite %tag.
689 \param atag Long value corresponding to the tag of the new %SObject.
693 SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
694 /*! \brief Deletion of the %SObject
696 Removes a %SObject from the %StudyBuilder.
698 \param anObject The %SObject to be deleted.
700 void RemoveObject (in SObject anObject) raises(LockProtection);
701 /*! \brief Deletion of the %SObject with all his child objects.
703 Removes the %SObject with all his child objects.
705 \param anObject The %SObject to be deleted with all child objects.
707 void RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
712 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
715 void LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
719 \param sco %SObject to be loaded.
721 void Load (in SObject sco);
723 /*! \brief Looking for or creating an attribute assigned to the %SObject
725 Allows to find or create an attribute of a specific type which is assigned to the object.
726 \param anObject The %SObject corresponding to the attribute which is looked for.
727 \param aTypeOfAttribute Type of the attribute.
729 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
732 GenericAttribute FindOrCreateAttribute(in SObject anObject,
733 in string aTypeOfAttribute) raises(LockProtection);
735 /*! \brief Looking for an attribute assigned to a %SObject
737 Allows to find an attribute of a specific type which is assigned to the object.
738 \param anObject The %SObject corresponding to the attribute which is looked for.
739 \param aTypeOfAttribute Type of the attribute.
740 \param anAttribute Where the attribute is placed if it's found.
741 \return True if it finds an attribute.
744 boolean FindAttribute(in SObject anObject,
745 out GenericAttribute anAttribute,
746 in string aTypeOfAttribute);
747 /*! \brief Deleting the attribute assigned to the %SObject
749 Removes the attribute of a specific type which is assigned to the object.
750 \param anObject The %SObject corresponding to the attribute.
751 \param aTypeOfAttribute Type of the attribute.
753 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
755 void RemoveAttribute(in SObject anObject,
756 in string aTypeOfAttribute) raises(LockProtection);
758 Adds a reference between %anObject and %theReferencedObject.
759 \param anObject The %SObject which will get a reference
760 \param theReferencedObject The %SObject having a reference
763 void Addreference(in SObject anObject,
764 in SObject theReferencedObject) ;
767 Removes a reference from %anObject to another object.
768 \param anObject The %SObject which contains a reference
771 void RemoveReference(in SObject anObject) ;
774 Adds a directory in the %Study.
775 \param theName String parameter defining the name of the directory.
777 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
780 void AddDirectory(in string theName) raises(LockProtection);
782 /*! \brief Identification of the %SObject's substructure.
784 Identification of the %SObject's substructure by GUID.
787 \param anObject The %SObject which will be identified
788 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
791 void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
793 Searches for a definite %SObject with a definite GUID and returns True if it finds it.
795 \param anObject A definite %SObject which will be identified
796 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
798 boolean IsGUID(in SObject anObject, in string theGUID);
800 /*! \brief Creation of a new command
802 Creates a new command which can contain several different actions.
804 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
807 void NewCommand(); // command management
808 /*! \brief Execution of the command
810 Commits all actions declared within this command.
812 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
814 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
817 void CommitCommand() raises(LockProtection); // command management
819 Returns True if at this moment there is a command under execution.
821 boolean HasOpenCommand();
822 /*! \brief Cancelation of the command
824 Cancels all actions declared within the command.
826 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
828 void AbortCommand(); // command management
831 The number of actions which can be undone
833 attribute long UndoLimit;
834 /*! \brief Undo method
836 Cancels all actions of the last command.
838 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
840 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
843 void Undo() raises (LockProtection);
844 /*! \brief Redo method
846 Redoes all actions of the last command.
848 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
850 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
853 void Redo() raises (LockProtection);
855 Returns True if at this moment there are any actions which can be canceled.
857 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
860 boolean GetAvailableUndos();
862 Returns True if at this moment there are any actions which can be redone.
864 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
867 boolean GetAvailableRedos();
869 Puts name attribute with the given string value to the given %SObject
871 \param theSO Existing SObject to set name attribute.
872 \param theValue The value to be set to the name attribute.
874 void SetName(in SObject theSO, in string theValue) raises (LockProtection);
877 Puts comment attribute with the given string value to the given %SObject
879 \param theSO Existing SObject to set comment attribute.
880 \param theValue The value to be set to the comment attribute.
882 void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
885 Puts IOR attribute with the given string value to the given %SObject
887 \param theSO Existing SObject to set IOR attribute.
888 \param theValue The value to be set to the IOR attribute.
890 void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
893 //==========================================================================
894 /*! \brief %Study Manager interface
896 The purpose of the Manager is to manipulate the %Studies. You will find in this
897 interface the methods to create, open,
898 close, and save a %Study. Since a %SALOME session is multi-document, you will
899 also find the methods allowing to navigate
900 through the collection of studies present in a session.
902 //==========================================================================
904 interface StudyManager
907 Determines whether the server has already been loaded or not.
914 Returns the PID of the server
919 Shutdown the StudyManager process.
921 oneway void ShutdownWithExit();
923 /*! \brief Creation of a new study
925 Creates a new study with a definite name.
927 \param study_name String parameter defining the name of the study
929 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
932 Study NewStudy(in string study_name) raises (SALOME::SALOME_Exception);
934 /*! \brief Open a study
936 Reads and activates the structure of the study %Objects.
937 \param aStudyUrl The path to the study
938 \warning This method doesn't activate the corba objects. Only a component can do it.
940 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
942 Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
944 /*! \brief Closing the study
948 void Close(in Study aStudy);
949 /*! \brief Saving the study in a HDF file (or files).
953 \param theMultiFile If this parameter is True the study will be saved in several files.
955 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
958 boolean Save(in Study aStudy, in boolean theMultiFile);
959 /*! \brief Saving a study in a ASCII file (or files).
961 Saves a study in an ASCII format file (or files).
962 \param theMultiFile If this parameter is True the study will be saved in several files.
964 boolean SaveASCII(in Study aStudy, in boolean theMultiFile);
965 /*! \brief Saving the study in a specified HDF file (or files).
967 Saves the study in a specified file (or files).
968 \param aUrl The path to the definite file in whcih the study will be saved
969 \param aStudy The study which will be saved
970 \param theMultiFile If this parameter is True the study will be saved in several files.
972 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
974 boolean SaveAs(in URL aUrl, // if the file already exists
976 in boolean theMultiFile); // overwrite (as option)
977 /*! \brief Saving the study in a specified ASCII file (or files).
979 Saves the study in a specified ASCII file (or files).
981 \param aUrl The path to the definite file in whcih the study will be saved
982 \param aStudy The study which will be saved
983 \param theMultiFile If this parameter is True the study will be saved in several files.
985 boolean SaveAsASCII(in URL aUrl, // if the file already exists
987 in boolean theMultiFile); // overwrite (as option)
990 /*! \brief List of open studies.
992 Gets the list of open studies
994 \return A list of open studies in the current session.
996 ListOfOpenStudies GetOpenStudies();
998 /*! \brief Getting a particular %Study picked by name
1000 Activates a particular %Study
1001 among the session collection picking it by name.
1002 \param aStudyName The name of the study
1004 Study GetStudyByName (in string aStudyName);
1006 /*! \brief Getting a particular %Study picked by ID
1008 Activates a particular %Study
1009 among the session collection picking it by ID.
1010 \param aStudyID The ID of the study
1012 Study GetStudyByID (in short aStudyID);
1014 // copy/paste methods
1017 Returns True, if the given %SObject can be copied to the clipboard.
1019 boolean CanCopy(in SObject theObject);
1021 Returns True, if the given %SObject is copied to the clipboard.
1022 \param theObject The %SObject which will be copied
1024 boolean Copy(in SObject theObject);
1026 Returns True, if the object from the clipboard can be pasted to the given %SObject.
1027 \param theObject The %SObject stored in the clipboard.
1029 boolean CanPaste(in SObject theObject);
1031 Returns the %SObject in which the object from the clipboard was pasted to.
1032 \param theObject The %SObject which will be pasted
1033 \exception SALOMEDS::StudyBuilder::LockProtection This exception is raised, when trying to paste
1034 an object into a study, which is protected for modifications.
1036 SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
1038 /*! \brief Object conversion.
1040 Converts an object into IOR.
1043 string ConvertObjectToIOR(in Object theObject);
1044 /*! \brief Object conversion.
1046 Converts IOR into an object.
1049 Object ConvertIORToObject(in string theIOR);
1052 Private method, returns an implementation of this StudyManager.
1053 \param theHostname is a hostname of the caller
1054 \param thePID is a process ID of the caller
1055 \param isLocal is set True if the StudyManager is launched locally with the caller
1057 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1059 /*! \brief Returns the siman study based on the given study.
1061 Creates a new Siman study, or returns just a previously created.
1062 \return Siman study, or none if it is not siman mode
1064 SimanStudy GetSimanStudy();
1069 //==========================================================================
1070 /*! \brief %SObject interface
1072 The objects in the %study are built by the %StudyBuilder. The %SObject interface
1073 provides methods for elementary inquiries, like getting an object %ID or its attribuites.
1076 <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
1077 in the tree-type data structure.
1078 <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
1079 ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
1081 //==========================================================================
1083 interface SObject : SALOME::GenericObj
1085 /*! Name of the %SObject
1087 attribute string Name; // equivalent to setName() & getName()
1089 /*! Returns true if the %SObject does not belong to any %Study
1093 /*! Gets an object %ID
1095 \return ID of the %SObject.
1098 /*! Acquisition of the father %Component of the %SObject
1100 \return The father %Component of the %SObject.
1102 SComponent GetFatherComponent();
1103 /*! Acquisition of the father %SObject of the %SObject
1105 \return the father %SObject of the given %SObject.
1107 SObject GetFather();
1108 /*! Gets the %tag of a %SObject
1110 \return the %tag of a %SObject.
1113 /*! Gets the depth of a %SObject
1115 \return the depth of a %SObject.
1118 /*! Looks for subobjects of a given %SObject.
1120 \param atag Tag of the given %SObject
1121 \return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
1124 boolean FindSubObject (in long atag, out SObject obj);
1125 /*! Looks for attributes of a given %SObject
1127 \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
1128 \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
1130 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1132 boolean FindAttribute(out GenericAttribute anAttribute,
1133 in string aTypeOfAttribute);
1134 /*! Looks for a %SObject which the given %SObject refers to.
1136 \return The object which the given %SObject refers to as well as True if it finds
1139 boolean ReferencedObject(out SObject obj); // A REVOIR
1140 /*! Gets all attributes of a given %SObject
1142 \return The list of all attributes of the given %SObject.
1144 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
1147 ListOfAttributes GetAllAttributes();
1148 /*! Gets the study of a given %SObject.
1150 \return The study containing the given %SObject.
1154 /*! Gets the CORBA object by its own IOR attribute.
1155 Returns nil, if can't.
1157 \return The CORBA object of the %SObject.
1162 Returns the name attribute value of this SObject.
1163 Returns empty string if there is no name attribute.
1168 Returns the comment attribute value of this SObject.
1169 Returns empty string if there is no comment attribute.
1171 string GetComment();
1174 Returns the IOR attribute value of this SObject.
1175 Returns empty string if there is no IOR attribute.
1180 Set an attribute value (of type string)
1181 \param name the name of the attribute
1182 \param value the value of the attribute
1184 void SetAttrString(in string name, in string value);
1187 Private method, returns an implementation of this SObject.
1188 \param theHostname is a hostname of the caller
1189 \param thePID is a process ID of the caller
1190 \param isLocal is set True if the SObject is launched locally with the caller
1192 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1196 //==========================================================================
1197 /*! \brief %Generic attribute interface
1199 %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
1201 //==========================================================================
1202 interface GenericAttribute : SALOME::GenericObj
1204 /*! \brief Exception locking all changes
1206 This exception locks all modifications in attributes.
1208 exception LockProtection {};
1209 /*! \brief Method CheckLocked
1211 Checks whether the %Study is protected for modifications.
1213 \note <BR>This exception is raised only outside a transaction.
1215 void CheckLocked() raises (LockProtection);
1220 //! Get the class type
1221 string GetClassType();
1224 SObject GetSObject();
1226 //! Private method, returns an implementation of this GenericAttribute.
1228 \param theHostname is a hostname of the caller
1229 \param thePID is a process ID of the caller
1230 \param isLocal is set True if the GenericAttribute is launched locally with the caller
1232 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1237 //==========================================================================
1238 /*! \brief %SComponent interface
1240 The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
1241 The %SComponent interface is a specialization of the %SObject interface.
1242 It inherits the most of its methods from the %SObject interface.
1244 //==========================================================================
1245 interface SComponent : SObject
1247 /*! \brief Gets the data type of the given %SComponent
1249 \return The data type of this %SComponent.
1251 string ComponentDataType();
1252 /*! \brief Gets the IOR of the given component
1254 \return True (if there is an instance of the given component) and its IOR.
1256 boolean ComponentIOR (out ID theID); //returns True if there is an instance
1257 //In this case ID identifies this one
1261 //==========================================================================
1262 /*! \brief %SComponentIterator interface
1264 This interface contains the methods allowing to iterate over all components in the list.
1265 The search is started from the first %SComponent in the list.
1267 //==========================================================================
1268 interface SComponentIterator : SALOME::GenericObj
1271 \brief Activates the %SComponentIterator.
1274 /*! \brief Method More
1276 \return True if there is one more %SComponent in the list.
1280 \brief Moves the iterator to the next %SComponent in the list.
1284 \brief Returns the %SComponent corresponding to the current %SComponent found by the iterator.
1286 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1292 //==========================================================================
1293 /*! \brief %ChildIterator interface
1295 This interface contains methods which allow to iterate over all child
1298 //==========================================================================
1299 interface ChildIterator : SALOME::GenericObj
1303 \brief Activates the %ChildIterator.
1308 \brief Activates the %ChildIterator for all child levels.
1310 \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels.
1312 void InitEx(in boolean allLevels);
1313 /*! \brief Method More
1315 \return True if there is one more %ChildIterator in the list.
1319 \brief Passes the iterator to the next level.
1323 \brief Returns the %SObject corresponding to the current object found by the iterator.
1328 //==========================================================================
1329 //==========================================================================
1330 /*! \brief Interface of the %UseCaseIterator.
1332 This interface contains a set of methods used for iteration over the objects in the use case.
1334 interface UseCaseIterator : SALOME::GenericObj
1337 Activates the %UseCaseIterator.
1338 \param allLevels If the value of this parameter is True the Iterator is activated for all subobjects.
1340 void Init(in boolean allLevels);
1343 \return True if the %UseCaseIterator finds one more object.
1347 Passes the iterator to the next object.
1351 Returns the %SObject corresponding to the current object found by the Iterator.
1356 //==========================================================================
1357 //==========================================================================
1358 /*! \brief Interface of the %UseCaseBuilder
1360 Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
1361 The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
1363 interface UseCaseBuilder : SALOME::GenericObj
1366 Adds to the use case an object as a child of the current object of the use case.
1368 \param theObject The added %SObject.
1369 \return True if this %SObject has been added in the use case.
1371 boolean Append(in SObject theObject);
1373 Removes an object from the use case.
1375 \param theObject The deleted %SObject
1376 \return True if this %SObject has been deleted from the use case.
1378 boolean Remove(in SObject theObject);
1380 Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
1382 boolean AppendTo(in SObject theFather, in SObject theObject);
1384 Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
1386 boolean InsertBefore(in SObject theFirst, in SObject theNext);
1388 Sets the current object of the use case.
1390 boolean SetCurrentObject(in SObject theObject);
1392 Makes the root object to be the current object of the use case.
1394 boolean SetRootCurrent();
1396 Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
1398 boolean HasChildren(in SObject theObject);
1400 Returns True if children of the given object <VAR>theObject</VAR> of the use case tree were sorted successfully.
1402 boolean SortChildren(in SObject theObject, in boolean theAscendingOrder);
1404 Gets father object of the given object <VAR>theObject</VAR> in the use cases tree.
1406 SObject GetFather(in SObject theObject);
1408 Sets the name of the use case.
1410 boolean SetName(in string theName);
1412 Gets the name of the use case.
1416 Returns True if the given object <VAR>theObject</VAR> represents a use case.
1418 boolean IsUseCase(in SObject theObject);
1420 Returns True if the given object <VAR>theObject</VAR> is included in the use cases tree on any level.
1422 boolean IsUseCaseNode(in SObject theObject);
1424 Gets the current object of the use case.
1426 SObject GetCurrentObject();
1428 Creates a new use case in the use case browser.
1430 SObject AddUseCase(in string theName);
1432 Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
1434 UseCaseIterator GetUseCaseIterator(in SObject theObject);
1436 //==========================================================================
1437 /*! \brief %Driver interface
1439 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
1440 can be called by any component and which provide the following functionality:
1442 <li> publishing in the study of the objects created by a definite component
1443 <li> saving/loading of the data created by a definite component. These methods are called by the StudyManager when loading/saving a study containing the data created by a definite component.
1444 <li> transforming of the transient references into persistant references (or vice versa) of the SObjects when saving (or loading) a study
1445 <li> copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study
1449 //==========================================================================
1453 /*! \brief Saving the data produced by a definite component.
1455 This method is called by the StudyManager when saving a study.
1456 \param theComponent %SComponent corresponding to this Component
1457 \param theURL The path to the file in which the data will be saved.
1458 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1459 \return A byte stream TMPFile that contains all saved data
1461 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1466 TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1468 /*! \brief Saving the data in ASCII format produced by a definite component.
1470 This method is called by the StudyManager when saving a study in ASCII format.
1471 \param theComponent %SComponent corresponding to this Component
1472 \param theURL The path to the file in which the data will be saved.
1473 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1474 \return A byte stream TMPFile that will contain all saved data
1476 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1479 TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1481 /*! \brief Loading the data.
1483 This method is called by the StudyManager when opening a study.
1484 \param theComponent %SComponent corresponding to this Component
1485 \param theStream The file which contains all data saved by the component on Save method
1486 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1490 boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1492 /*! \brief Loading the data from files in ASCII format.
1494 This method is called by the StudyManager when opening a study.
1495 \param theComponent %SComponent corresponding to this Component
1496 \param theStream The file which contains all data saved by the component on Save method
1497 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1501 boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1503 /*! \brief Closing of the study
1505 This method Close is called by the StudyManager when closing a study.
1506 \param aSComponent The according %SComponent
1509 void Close (in SComponent aSComponent);
1510 //void Close ( in string aIORSComponent);
1512 /*! Gets the type of the data
1514 \return The type of data produced by the Component in the study.
1517 string ComponentDataType();
1519 // Driver Transient -> persistent called for each object in study
1521 Transforms IOR of a given %SObject into PersistentID. It is called for each
1522 object in the %study.
1523 \note <br> In %SALOME the objects which are present in an active study are identified by an IOR, when this
1524 study is saved these references are transformed into persintent IDs.
1526 \param theSObject The given %SObject.
1527 \param IORString The IOR of the given %SObject.
1528 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1529 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1531 \return The persistent ID of the given %SObject
1534 string IORToLocalPersistentID (in SObject theSObject,
1535 in string IORString,
1536 in boolean isMultiFile,
1537 in boolean isASCII);
1539 Transforms PersistentID into IOR of the object. It is called for each
1540 object in the %study.
1542 \note <br> In %SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this
1543 study is open, these references are transformed into persintent IORs.
1545 \param theSObject The given %SObject.
1546 \param IORString The IOR of the given %SObject.
1547 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1548 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1550 \return The IOR of the given %SObject
1553 string LocalPersistentIDToIOR (in SObject theSObject,
1554 in string aLocalPersistentID,
1555 in boolean isMultiFile,
1557 raises (SALOME::SALOME_Exception);
1559 // Publishing in the study
1560 /*! Publishing in the study
1562 \return True if the given %Component can publish a definite object with a given IOR in the %study.
1563 \param theIOR The IOR of a definite object
1565 boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1566 /*! \brief Publishing in the study
1568 Publishes the given object in the %study, using the algorithm of this component.
1569 \param theStudy The %study in which the object is published
1570 \param theSObject If this parameter is null the object is published for the first time. Otherwise
1571 this parameter should contain a reference to the object published earlier
1572 \param theObject The object which is published
1573 \param theName The name of the published object. If this parameter is empty, the name is generated
1574 automatically by the component.
1576 \return The published %SObject.
1578 SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
1580 // copy/paste methods
1583 Returns True, if the given %SObject can be copied to the clipboard.
1585 \param theObject The given %SObject which should be copied.
1587 boolean CanCopy(in SObject theObject);
1589 Returns the object %ID and the %TMPFile of the object from the given %SObject.
1591 TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1593 Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1595 boolean CanPaste(in string theComponentName, in long theObjectID);
1597 Returns the %SObject of the pasted object.
1599 SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);