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 reference
129 exception StudyInvalidReference {};
130 //! Invalid study context
131 exception StudyInvalidContext {};
132 //! Invalid study component
133 exception StudyInvalidComponent {};
134 //! Invalid directory of the %study exception
135 exception StudyInvalidDirectory {};
136 //! Exception pointing that this name of the study has already been used.
137 exception StudyNameAlreadyUsed {};
138 //! study object already exists
139 exception StudyObjectAlreadyExists {};
140 //! Invalid name of the %study exception
141 exception StudyNameError {};
142 //! Invalid study comment
143 exception StudyCommentError {};
145 /*! \brief The name of the %Study
147 This is equivalent to the methods setName() & getName()
149 attribute string Name; // equivalent to setName() & getName()
150 /*! \brief The ID of the %Study
152 This is equivalent to the methods setID() & getID()
154 attribute short StudyId;
155 //! Sequence containing %SObjects
156 typedef sequence<SObject> ListOfSObject;
157 //! Get the persistent reference to the %Study.
158 PersistentReference GetPersistentReference() raises(StudyInvalidReference);
159 //! Get a transient reference to the %Study.
160 SalomeReference GetTransientReference() raises(StudyInvalidReference);
162 /*! \brief indicate whether the %Study is empty
164 \return True if the %Study is empty
166 boolean IsEmpty() raises(StudyInvalidReference);
167 /*! \brief Find a %SComponent by its name.
169 \param aComponentName It's a string value in the Comment Attribute of the Component,
170 which is looked for, defining the data type of this Component.
172 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
175 SComponent FindComponent (in string aComponentName) raises(StudyInvalidReference);
177 /*! \brief Find a %SComponent by ID of the according %SObject
179 SComponent FindComponentID(in ID aComponentID) raises(StudyInvalidReference);
180 /*! \brief Find a %SObject by the Name Attribute of this %SObject
182 \param anObjectName String parameter defining the name of the object
183 \return The obtained %SObject
185 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
187 SObject FindObject (in string anObjectName) raises(StudyInvalidReference);
188 /*! \brief Find a %SObject by its ID
190 \param aObjectID This parameter defines the ID of the required object
191 \return The obtained %SObject
193 SObject FindObjectID (in ID aObjectID) raises(StudyInvalidReference);
194 /*! \brief Create a %SObject by its ID
196 \param aObjectID This parameter defines the ID of the required object
197 \return The created %SObject
199 SObject CreateObjectID (in ID aObjectID) raises(StudyInvalidReference);
200 /*! \brief Find a %SObject by IOR of the object belonging to this %SObject.
202 \param anObjectName This parameter defines the IOR of the object
203 \return The obtained %SObject
205 SObject FindObjectIOR (in ID aObjectIOR) raises(StudyInvalidReference);
206 /*! \brief Find in the study all %SObjects produced by a given %Component.
208 \param anObjectName The Name Attribute of the searched %SObjects should correspond to <VAR>anObjectName</VAR>.
209 \param aComponentName The name of the component, which objects are searched for.
211 ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName) raises(StudyInvalidReference);
212 /*! \brief Find a %SObject by the path to it.
214 \param thePath The path to the required %SObject.
215 \return The obtained %SObject.
217 SObject FindObjectByPath(in string thePath) raises(StudyInvalidReference);
218 /*! \brief Get the path to the %SObject.
220 string GetObjectPath(in Object theObject) raises(StudyInvalidReference);
222 /*! \brief Set the context of the %Study.
224 \param thePath String parameter defining the context of the study.
226 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
228 void SetContext(in string thePath) raises (StudyInvalidReference, StudyInvalidContext);
229 /*! \brief Get the context of the %Study.
231 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
233 string GetContext() raises (StudyInvalidReference, StudyInvalidContext);
234 /*! \brief Get a list of names of objects corresponding to the context.
236 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
238 ListOfStrings GetObjectNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
239 /*! \brief Get a list of names of directories and subdirectories corresponding to the context.
241 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
243 ListOfStrings GetDirectoryNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
244 /*! \brief Get a list of names of Files corresponding to the context.
246 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
248 ListOfStrings GetFileNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
249 /*! \brief Get a list of names of Components corresponding to the context.
251 \note If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
253 ListOfStrings GetComponentNames(in string theContext) raises(StudyInvalidReference);
254 /*! \brief Create a new iterator of child levels of the given %SObject.
256 \param aSO The given %SObject
257 \return A new iterator of child levels of the given %SObject.
259 ChildIterator NewChildIterator(in SObject aSO) raises(StudyInvalidReference);
261 /*! \brief Create a new iterator of the %SComponents.
263 \return A new iterator of the %SComponents.
265 SComponentIterator NewComponentIterator() raises(StudyInvalidReference);
267 /*! \brief Create a new %StudyBuilder to add or modify an object in the study.
269 \return A new %StudyBuilder.
271 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
273 StudyBuilder NewBuilder() raises(StudyInvalidReference);
274 /*! \brief Labels dependency
276 Updates the map with IOR attribute. It's an inner method used for optimization.
278 void UpdateIORLabelMap(in string anIOR, in string anEntry) raises(StudyInvalidReference);
280 /*! \brief Getting properties of the study
282 Returns the attribute, which contains the properties of this study.
284 <em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
287 AttributeStudyProperties GetProperties() raises(StudyInvalidReference);
288 /*! \brief Indicate whether the %study has been saved
290 attribute boolean IsSaved;
291 /*! \brief Indicate whether the %study has been modified and not saved.
293 Returns True if the %study has been modified and not saved.
295 boolean IsModified() raises(StudyInvalidReference);
297 /*! \brief Mark the %study as being modified and not saved.
299 void Modified() raises(StudyInvalidReference);
301 /*! \brief Indicate the file where the %study has been saved
303 attribute string URL;
305 /*! \brief List of %SObjects
307 Returns the list of %SObjects which refers to %anObject.
309 ListOfSObject FindDependances(in SObject anObject) raises(StudyInvalidReference);
311 /*! \brief The date of the last saving of the study
313 Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
315 string GetLastModificationDate() raises(StudyInvalidReference);
316 /*! \brief The list of modification dates of the study
318 Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
319 Note : the first modification begins the list.
321 ListOfDates GetModificationsDate() raises(StudyInvalidReference);
322 /*! \brief Object conversion.
324 Converts an object into IOR.
327 string ConvertObjectToIOR(in Object theObject);
328 /*! \brief Object conversion.
330 Converts IOR into an object.
333 Object ConvertIORToObject(in string theIOR);
335 /*! \brief Get a new %UseCaseBuilder.
337 UseCaseBuilder GetUseCaseBuilder() raises(StudyInvalidReference);
339 /*! \brief Close the components in the study, remove itself from the %StudyManager.
341 void Close() raises(StudyInvalidReference);
343 /*! \brief Enable (if isEnabled = True)/disable automatic addition of new %SObjects to the use case.
345 void EnableUseCaseAutoFilling(in boolean isEnabled) raises(StudyInvalidReference);
348 Functions for internal usage only
350 void AddPostponed(in string theIOR) raises(StudyInvalidReference);
352 void AddCreatedPostponed(in string theIOR) raises(StudyInvalidReference);
354 void RemovePostponed(in long theUndoLimit) raises(StudyInvalidReference);
356 void UndoPostponed(in long theWay) raises(StudyInvalidReference);
358 boolean DumpStudy(in string thePath,
359 in string theBaseName,
360 in boolean isPublished,
361 in boolean isMultiFile) raises(StudyInvalidReference);
363 /*! \brief Get an AttributeParameter used to store common parameters for given %theSavePoint.
365 \param theID identifies a common parameters set (Example: "Interface Applicative")
366 \param theSavePoint is number of a set of parameters as there can be several sets
368 AttributeParameter GetCommonParameters(in string theID, in long theSavePoint) raises(StudyInvalidReference);
370 /*! \brief Get an AttributeParameter used to store parameters for given %theModuleName.
372 \param theID identifies a common parameters set (Example: "Interface Applicative")
373 \param theModuleName is a name of the module (Example: "Geometry")
374 \param theSavePoint is number of a set of parameters as there can be several sets
376 AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint) raises(StudyInvalidReference);
379 /*! \brief Get a default Python script to restore visual parameters for given %theModuleName.
381 \param theModuleName is a name of the module (Example: "Geometry")
382 \param indent is a string to use for script indentation
384 string GetDefaultScript(in string theModuleName, in string indent) raises(StudyInvalidReference);
387 Private method, returns an implementation of this Study.
388 \param theHostname is a hostname of the caller
389 \param thePID is a process ID of the caller
390 \param isLocal is set True if the Study is launched locally with the caller
392 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
395 /*! \brief Mark this Study as being locked by the given locker.
397 The lock status can be checked by method IsStudyLocked
398 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
400 void SetStudyLock(in string theLockerID) raises(StudyInvalidReference);
402 /*! \brief Indicate if the Study is locked
404 Returns True if the Study was marked locked.
406 boolean IsStudyLocked() raises(StudyInvalidReference);
408 /*! \brief Mark this Study as being unlocked by the given locker.
410 The lock status can be checked by method IsStudyLocked
411 \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
413 void UnLockStudy(in string theLockerID) raises(StudyInvalidReference);
415 /*! \brief Get the list of IDs of the Study's lockers.
417 ListOfStrings GetLockerID() raises(StudyInvalidReference);
419 /*! \brief Create real variable with Name theVarName and value theValue
421 (or set if variable value into theValue already exists)
422 \param theVarName is a name of the variable
423 \param theVarName is a value of the variable.
425 void SetReal( in string theVarName, in double theValue ) raises(StudyInvalidReference);
427 /*! \brief Create integer variable with Name theVarName and value theValue
429 (or set if variable value into theValue already exists)
430 \param theVarName is a name of the variable
431 \param theVarName is a value of the variable.
433 void SetInteger( in string theVarName, in long theValue ) raises(StudyInvalidReference);
434 /*! \brief Create boolean variable with Name theVarName and value theValue
436 (or set if variable value into theValue already exists)
437 \param theVarName is a name of the variable
438 \param theVarName is a value of the variable.
440 void SetBoolean( in string theVarName, in boolean theValue ) raises(StudyInvalidReference);
442 /*! \brief Create string variable with Name theVarName and value theValue
444 (or set if variable value into theValue already exists)
445 \param theVarName is a name of the variable
446 \param theVarName is a value of the variable.
448 void SetString( in string theVarName, in string theValue ) raises(StudyInvalidReference);
450 /*! \brief Set current value as double for string variable
452 void SetStringAsDouble( in string theVarName, in double theValue ) raises(StudyInvalidReference);
454 /*! \brief Get value of a real variable
456 \param theVarName is a name of the variable.
458 double GetReal( in string theVarName ) raises(StudyInvalidReference);
460 /*! \brief Get value of an integer variable
462 \param theVarName is a name of the variable.
464 long GetInteger( in string theVarName ) raises(StudyInvalidReference);
466 /*! \brief Get value of a boolean variable
468 \param theVarName is a name of the variable.
470 boolean GetBoolean( in string theVarName ) raises(StudyInvalidReference);
472 /*! \brief Get value of a string variable
474 \param theVarName is a name of the variable.
476 string GetString( in string theVarName ) raises(StudyInvalidReference);
479 /*! \brief Indicate if a variable is real
481 Return true if variable is real otherwise return false.
482 \param theVarName is a name of the variable.
484 boolean IsReal( in string theVarName ) raises(StudyInvalidReference);
486 /*! \brief Indicate if a variable is integer
488 Return true if variable is integer otherwise return false.
489 \param theVarName is a name of the variable.
491 boolean IsInteger( in string theVarName ) raises(StudyInvalidReference);
493 /*! \brief Indicate if a variable is boolean
495 Return true if variable is boolean otherwise return false.
496 \param theVarName is a name of the variable.
498 boolean IsBoolean( in string theVarName ) raises(StudyInvalidReference);
500 /*! \brief Indicate if a variable is string
502 Return true if variable is string otherwise return false.
503 \param theVarName is a name of the variable.
505 boolean IsString( in string theVarName ) raises(StudyInvalidReference);
507 /*! \brief Indicate if a variable exists in the study
509 Return true if variable exists in the study,
510 otherwise return false.
511 \param theVarName is a name of the variable.
513 boolean IsVariable( in string theVarName ) raises(StudyInvalidReference);
515 /*! \brief Get names of all variables from the study.
517 ListOfStrings GetVariableNames() raises(StudyInvalidReference);
519 /*! \brief Remove a variable
521 Remove variable with the specified name from the study with substitution of its value.
523 \param theVarName Name of the variable.
524 \return Status of operation.
526 boolean RemoveVariable( in string theVarName ) raises(StudyInvalidReference);
528 /*! \brief Rename a variable
530 Rename variable with the specified name within the study.
532 \param theVarName Name of the variable.
533 \param theNewVarName New name for the variable.
534 \return Status of operation.
536 boolean RenameVariable( in string theVarName, in string theNewVarName ) raises(StudyInvalidReference);
538 /*! \brief Indicate whether variable is used
540 Check that variable is used in the study.
542 \param theVarName Name of the variable.
543 \return Variable usage.
545 boolean IsVariableUsed( in string theVarName ) raises(StudyInvalidReference);
547 /*! \brief Parse variables used for object creation
549 \param string with variables, separated by special symbol.
550 \return Variables list.
552 ListOfListOfStrings ParseVariables( in string theVars ) raises(StudyInvalidReference);
555 Attach an observer to the Study
557 \param theObserver observer being attached
558 \param modify when \c true, observer receives any object's modification events;
559 otherwise observer receives object's creation events only
561 void attach(in SALOMEDS::Observer theObserver, in boolean modify);
563 Detach an observer from the Study
565 \param theObserver observer to be detached
567 void detach(in SALOMEDS::Observer theObserver);
570 //===========================================================================
571 /*! \brief %SimanStudy Interface
573 The Siman (simulation management) study is an interface extension to the %Study
574 with functions for working with SIMAN server. Is allows to get data from SIMAN (check-out operation)
575 and to store it back (check-in operation).
576 This interface is correctly working if SALOME is compiled with SimanIO library, launched with siman
577 option and connection to SIMAN server is established and alive. Only one study per application,
578 checked out from the SIMAN is SimanStudy. For other studies all functionality is unaccessible.
584 //! No connection with SIMAN server
585 exception SimanStudyNoConnection {};
586 //! There is no SimanStudy with: study with checked out data.
587 exception SimanStudyNotExists {};
589 /*! \brief The ID of the study in SIMAN server
591 This is equivalent to the methods setStudyId() & getStudyId()
593 attribute string StudyId;
595 /*! \brief The ID of the scenario in SIMAN server
597 This is equivalent to the methods setScenarioId() & getScenarioId()
599 attribute string ScenarioId;
600 /*! \brief The ID of the user in SIMAN server
602 This is equivalent to the methods setUserId() & getUserId()
604 attribute string UserId;
606 /*! \brief Get data from SIMAN and put it to the given study
608 This method is called for just created study to make it referenced
609 by this Siman study. Also it fills this study by the checked out
610 data from SIMAN server.
611 Warning: StudyID, ScenarioID and User Id must be set before calling of this method!
613 \param theTarget referenced study for checking out
615 void CheckOut(in Study theTarget);
617 /*! \brief Get data from the source study and store in SIMAN
619 It works only with already checked out study.
620 \param theModuleName name of the module the check in must be perfrormed for. If empty, check in is performed for all modules.
622 void CheckIn(in string theModuleName);
624 /*! \brief Returns the %Study with checked out data
626 If study is null, there is no such study in this application instance, or Salome was
627 launched without siman option.
629 Study getReferencedStudy();
633 //==========================================================================
634 /*! \brief %Study Builder Interface
636 The purpose of the Builder is to add and/or remove objects and attributes.
637 A %StudyBuilder is linked to a %Study. A
638 command management is provided for the undo/redo functionalities.
640 <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
641 item's position in the tree-type structure of the browser. In general it has the following
642 form: <TT>0:2:1:1</TT>
644 //==========================================================================
646 interface StudyBuilder
648 /*! \brief %LockProtection Exception
650 This exception is raised while attempting to modify a locked %study.
652 exception LockProtection {};
653 /*! \brief Creation of a new %SComponent.
655 Creates a new %SComponent
656 \param ComponentDataType Data type of the %SComponent which will be created.
658 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
661 SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
662 /*! \brief Definition of the instance to the %SComponent
664 Defines the instance to the %SComponent.
666 void DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
668 /*! \brief Deletion of a %SComponent
670 Removes a %SComponent.
672 void RemoveComponent(in SComponent aComponent) raises(LockProtection);
674 /*! \brief Creation of a new %SObject
676 Creates a new %SObject under a definite father %SObject.
678 \param theFatherObject The father %SObject under which this one should be created.
681 <em>See \ref example18 for an example of this method usage in batchmode of %SALOME application.</em>
685 SObject NewObject (in SObject theFatherObject) raises(LockProtection);
687 /*! \brief Creation of a new %SObject with a definite %tag
689 Creates a new %SObject with a definite %tag.
691 \param atag Long value corresponding to the tag of the new %SObject.
695 SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
696 /*! \brief Deletion of the %SObject
698 Removes a %SObject from the %StudyBuilder.
700 \param anObject The %SObject to be deleted.
702 void RemoveObject (in SObject anObject) raises(LockProtection);
703 /*! \brief Deletion of the %SObject with all his child objects.
705 Removes the %SObject with all his child objects.
707 \param anObject The %SObject to be deleted with all child objects.
709 void RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
714 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
717 void LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
721 \param sco %SObject to be loaded.
723 void Load (in SObject sco);
725 /*! \brief Looking for or creating an attribute assigned to the %SObject
727 Allows to find or create an attribute of a specific type which is assigned to the object.
728 \param anObject The %SObject corresponding to the attribute which is looked for.
729 \param aTypeOfAttribute Type of the attribute.
731 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
734 GenericAttribute FindOrCreateAttribute(in SObject anObject,
735 in string aTypeOfAttribute) raises(LockProtection);
737 /*! \brief Looking for an attribute assigned to a %SObject
739 Allows to find an attribute of a specific type which is assigned to the object.
740 \param anObject The %SObject corresponding to the attribute which is looked for.
741 \param aTypeOfAttribute Type of the attribute.
742 \param anAttribute Where the attribute is placed if it's found.
743 \return True if it finds an attribute.
746 boolean FindAttribute(in SObject anObject,
747 out GenericAttribute anAttribute,
748 in string aTypeOfAttribute);
749 /*! \brief Deleting the attribute assigned to the %SObject
751 Removes the attribute of a specific type which is assigned to the object.
752 \param anObject The %SObject corresponding to the attribute.
753 \param aTypeOfAttribute Type of the attribute.
755 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
757 void RemoveAttribute(in SObject anObject,
758 in string aTypeOfAttribute) raises(LockProtection);
760 Adds a reference between %anObject and %theReferencedObject.
761 \param anObject The %SObject which will get a reference
762 \param theReferencedObject The %SObject having a reference
765 void Addreference(in SObject anObject,
766 in SObject theReferencedObject) ;
769 Removes a reference from %anObject to another object.
770 \param anObject The %SObject which contains a reference
773 void RemoveReference(in SObject anObject) ;
776 Adds a directory in the %Study.
777 \param theName String parameter defining the name of the directory.
779 <em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
782 void AddDirectory(in string theName) raises(LockProtection);
784 /*! \brief Identification of the %SObject's substructure.
786 Identification of the %SObject's substructure by GUID.
789 \param anObject The %SObject which will be identified
790 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
793 void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
795 Searches for a definite %SObject with a definite GUID and returns True if it finds it.
797 \param anObject A definite %SObject which will be identified
798 \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
800 boolean IsGUID(in SObject anObject, in string theGUID);
802 /*! \brief Creation of a new command
804 Creates a new command which can contain several different actions.
806 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
809 void NewCommand(); // command management
810 /*! \brief Execution of the command
812 Commits all actions declared within this command.
814 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
816 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
819 void CommitCommand() raises(LockProtection); // command management
821 Returns True if at this moment there is a command under execution.
823 boolean HasOpenCommand();
824 /*! \brief Cancelation of the command
826 Cancels all actions declared within the command.
828 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
830 void AbortCommand(); // command management
833 The number of actions which can be undone
835 attribute long UndoLimit;
836 /*! \brief Undo method
838 Cancels all actions of the last command.
840 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
842 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
845 void Undo() raises (LockProtection);
846 /*! \brief Redo method
848 Redoes all actions of the last command.
850 \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
852 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
855 void Redo() raises (LockProtection);
857 Returns True if at this moment there are any actions which can be canceled.
859 <em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
862 boolean GetAvailableUndos();
864 Returns True if at this moment there are any actions which can be redone.
866 <em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
869 boolean GetAvailableRedos();
871 Puts name attribute with the given string value to the given %SObject
873 \param theSO Existing SObject to set name attribute.
874 \param theValue The value to be set to the name attribute.
876 void SetName(in SObject theSO, in string theValue) raises (LockProtection);
879 Puts comment attribute with the given string value to the given %SObject
881 \param theSO Existing SObject to set comment attribute.
882 \param theValue The value to be set to the comment attribute.
884 void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
887 Puts IOR attribute with the given string value to the given %SObject
889 \param theSO Existing SObject to set IOR attribute.
890 \param theValue The value to be set to the IOR attribute.
892 void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
895 //==========================================================================
896 /*! \brief %Study Manager interface
898 The purpose of the Manager is to manipulate the %Studies. You will find in this
899 interface the methods to create, open,
900 close, and save a %Study. Since a %SALOME session is multi-document, you will
901 also find the methods allowing to navigate
902 through the collection of studies present in a session.
904 //==========================================================================
906 interface StudyManager
909 Determines whether the server has already been loaded or not.
916 Returns the PID of the server
921 Shutdown the StudyManager process.
923 oneway void ShutdownWithExit();
925 /*! \brief Creation of a new study
927 Creates a new study with a definite name.
929 \param study_name String parameter defining the name of the study
931 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
934 Study NewStudy(in string study_name) raises (SALOME::SALOME_Exception);
936 /*! \brief Open a study
938 Reads and activates the structure of the study %Objects.
939 \param aStudyUrl The path to the study
940 \warning This method doesn't activate the corba objects. Only a component can do it.
942 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
944 Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
946 /*! \brief Closing the study
950 void Close(in Study aStudy);
951 /*! \brief Saving the study in a HDF file (or files).
955 \param theMultiFile If this parameter is True the study will be saved in several files.
957 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
960 boolean Save(in Study aStudy, in boolean theMultiFile);
961 /*! \brief Saving a study in a ASCII file (or files).
963 Saves a study in an ASCII format file (or files).
964 \param theMultiFile If this parameter is True the study will be saved in several files.
966 boolean SaveASCII(in Study aStudy, in boolean theMultiFile);
967 /*! \brief Saving the study in a specified HDF file (or files).
969 Saves the study in a specified file (or files).
970 \param aUrl The path to the definite file in whcih the study will be saved
971 \param aStudy The study which will be saved
972 \param theMultiFile If this parameter is True the study will be saved in several files.
974 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
976 boolean SaveAs(in URL aUrl, // if the file already exists
978 in boolean theMultiFile); // overwrite (as option)
979 /*! \brief Saving the study in a specified ASCII file (or files).
981 Saves the study in a specified ASCII file (or files).
983 \param aUrl The path to the definite file in whcih the study will be saved
984 \param aStudy The study which will be saved
985 \param theMultiFile If this parameter is True the study will be saved in several files.
987 boolean SaveAsASCII(in URL aUrl, // if the file already exists
989 in boolean theMultiFile); // overwrite (as option)
992 /*! \brief List of open studies.
994 Gets the list of open studies
996 \return A list of open studies in the current session.
998 ListOfOpenStudies GetOpenStudies();
1000 /*! \brief Getting a particular %Study picked by name
1002 Activates a particular %Study
1003 among the session collection picking it by name.
1004 \param aStudyName The name of the study
1006 Study GetStudyByName (in string aStudyName);
1008 /*! \brief Getting a particular %Study picked by ID
1010 Activates a particular %Study
1011 among the session collection picking it by ID.
1012 \param aStudyID The ID of the study
1014 Study GetStudyByID (in short aStudyID);
1016 // copy/paste methods
1019 Returns True, if the given %SObject can be copied to the clipboard.
1021 boolean CanCopy(in SObject theObject);
1023 Returns True, if the given %SObject is copied to the clipboard.
1024 \param theObject The %SObject which will be copied
1026 boolean Copy(in SObject theObject);
1028 Returns True, if the object from the clipboard can be pasted to the given %SObject.
1029 \param theObject The %SObject stored in the clipboard.
1031 boolean CanPaste(in SObject theObject);
1033 Returns the %SObject in which the object from the clipboard was pasted to.
1034 \param theObject The %SObject which will be pasted
1035 \exception SALOMEDS::StudyBuilder::LockProtection This exception is raised, when trying to paste
1036 an object into a study, which is protected for modifications.
1038 SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
1040 /*! \brief Object conversion.
1042 Converts an object into IOR.
1045 string ConvertObjectToIOR(in Object theObject);
1046 /*! \brief Object conversion.
1048 Converts IOR into an object.
1051 Object ConvertIORToObject(in string theIOR);
1054 Private method, returns an implementation of this StudyManager.
1055 \param theHostname is a hostname of the caller
1056 \param thePID is a process ID of the caller
1057 \param isLocal is set True if the StudyManager is launched locally with the caller
1059 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1061 /*! \brief Returns the siman study based on the given study.
1063 Creates a new Siman study, or returns just a previously created.
1064 \return Siman study, or none if it is not siman mode
1066 SimanStudy GetSimanStudy();
1071 //==========================================================================
1072 /*! \brief %SObject interface
1074 The objects in the %study are built by the %StudyBuilder. The %SObject interface
1075 provides methods for elementary inquiries, like getting an object %ID or its attribuites.
1078 <BR><VAR>Tag</VAR> of an item in %SALOME application is an integer value uniquely defining an item
1079 in the tree-type data structure.
1080 <BR><VAR>ID</VAR> of an item is a description of item's position in the tree-type data structure.
1081 ID is a list of tags and it has the following form: <TT>0:2:1:1</TT>.
1083 //==========================================================================
1085 interface SObject : SALOME::GenericObj
1087 /*! Name of the %SObject
1089 attribute string Name; // equivalent to setName() & getName()
1091 /*! Returns true if the %SObject does not belong to any %Study
1095 /*! Gets an object %ID
1097 \return ID of the %SObject.
1100 /*! Acquisition of the father %Component of the %SObject
1102 \return The father %Component of the %SObject.
1104 SComponent GetFatherComponent();
1105 /*! Acquisition of the father %SObject of the %SObject
1107 \return the father %SObject of the given %SObject.
1109 SObject GetFather();
1110 /*! Gets the %tag of a %SObject
1112 \return the %tag of a %SObject.
1115 /*! Gets the depth of a %SObject
1117 \return the depth of a %SObject.
1120 /*! Looks for subobjects of a given %SObject.
1122 \param atag Tag of the given %SObject
1123 \return True if it finds a subobject of the %SObject with a definite tag as well as the required subobject.
1126 boolean FindSubObject (in long atag, out SObject obj);
1127 /*! Looks for attributes of a given %SObject
1129 \param aTypeOfAttribute String value defining the type of the required attribute of the given %SObject.
1130 \return True if it finds an attribute of a definite type of the given %SObject as well as the discovered attribute.
1132 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1134 boolean FindAttribute(out GenericAttribute anAttribute,
1135 in string aTypeOfAttribute);
1136 /*! Looks for a %SObject which the given %SObject refers to.
1138 \return The object which the given %SObject refers to as well as True if it finds
1141 boolean ReferencedObject(out SObject obj); // A REVOIR
1142 /*! Gets all attributes of a given %SObject
1144 \return The list of all attributes of the given %SObject.
1146 <em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
1149 ListOfAttributes GetAllAttributes();
1150 /*! Gets the study of a given %SObject.
1152 \return The study containing the given %SObject.
1156 /*! Gets the CORBA object by its own IOR attribute.
1157 Returns nil, if can't.
1159 \return The CORBA object of the %SObject.
1164 Returns the name attribute value of this SObject.
1165 Returns empty string if there is no name attribute.
1170 Returns the comment attribute value of this SObject.
1171 Returns empty string if there is no comment attribute.
1173 string GetComment();
1176 Returns the IOR attribute value of this SObject.
1177 Returns empty string if there is no IOR attribute.
1182 Set an attribute value (of type string)
1183 \param name the name of the attribute
1184 \param value the value of the attribute
1186 void SetAttrString(in string name, in string value);
1189 Private method, returns an implementation of this SObject.
1190 \param theHostname is a hostname of the caller
1191 \param thePID is a process ID of the caller
1192 \param isLocal is set True if the SObject is launched locally with the caller
1194 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1198 //==========================================================================
1199 /*! \brief %Generic attribute interface
1201 %Generic attribute is a base interface for all attributes which can be assigned to the SObjects created in the study.
1203 //==========================================================================
1204 interface GenericAttribute : SALOME::GenericObj
1206 /*! \brief Exception locking all changes
1208 This exception locks all modifications in attributes.
1210 exception LockProtection {};
1211 /*! \brief Method CheckLocked
1213 Checks whether the %Study is protected for modifications.
1215 \note <BR>This exception is raised only outside a transaction.
1217 void CheckLocked() raises (LockProtection);
1222 //! Get the class type
1223 string GetClassType();
1226 SObject GetSObject();
1228 //! Private method, returns an implementation of this GenericAttribute.
1230 \param theHostname is a hostname of the caller
1231 \param thePID is a process ID of the caller
1232 \param isLocal is set True if the GenericAttribute is launched locally with the caller
1234 long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
1239 //==========================================================================
1240 /*! \brief %SComponent interface
1242 The %SComponent interface establishes in the study a permanent assocition to the Components integrated into %SALOME platform.
1243 The %SComponent interface is a specialization of the %SObject interface.
1244 It inherits the most of its methods from the %SObject interface.
1246 //==========================================================================
1247 interface SComponent : SObject
1249 /*! \brief Gets the data type of the given %SComponent
1251 \return The data type of this %SComponent.
1253 string ComponentDataType();
1254 /*! \brief Gets the IOR of the given component
1256 \return True (if there is an instance of the given component) and its IOR.
1258 boolean ComponentIOR (out ID theID); //returns True if there is an instance
1259 //In this case ID identifies this one
1263 //==========================================================================
1264 /*! \brief %SComponentIterator interface
1266 This interface contains the methods allowing to iterate over all components in the list.
1267 The search is started from the first %SComponent in the list.
1269 //==========================================================================
1270 interface SComponentIterator : SALOME::GenericObj
1273 \brief Activates the %SComponentIterator.
1276 /*! \brief Method More
1278 \return True if there is one more %SComponent in the list.
1282 \brief Moves the iterator to the next %SComponent in the list.
1286 \brief Returns the %SComponent corresponding to the current %SComponent found by the iterator.
1288 <em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
1294 //==========================================================================
1295 /*! \brief %ChildIterator interface
1297 This interface contains methods which allow to iterate over all child
1300 //==========================================================================
1301 interface ChildIterator : SALOME::GenericObj
1305 \brief Activates the %ChildIterator.
1310 \brief Activates the %ChildIterator for all child levels.
1312 \param allLevels If this boolean parameter is True, the %ChildIterator will be activated for all child levels.
1314 void InitEx(in boolean allLevels);
1315 /*! \brief Method More
1317 \return True if there is one more %ChildIterator in the list.
1321 \brief Passes the iterator to the next level.
1325 \brief Returns the %SObject corresponding to the current object found by the iterator.
1330 //==========================================================================
1331 //==========================================================================
1332 /*! \brief Interface of the %UseCaseIterator.
1334 This interface contains a set of methods used for iteration over the objects in the use case.
1336 interface UseCaseIterator : SALOME::GenericObj
1339 Activates the %UseCaseIterator.
1340 \param allLevels If the value of this parameter is True the Iterator is activated for all subobjects.
1342 void Init(in boolean allLevels);
1345 \return True if the %UseCaseIterator finds one more object.
1349 Passes the iterator to the next object.
1353 Returns the %SObject corresponding to the current object found by the Iterator.
1358 //==========================================================================
1359 //==========================================================================
1360 /*! \brief Interface of the %UseCaseBuilder
1362 Use case in the study represents a user-managed subtree, containing all or some of the objects which exist in the study.
1363 The %UseCaseBuilder interface contains a set of methods used for management of the use case in the study.
1365 interface UseCaseBuilder : SALOME::GenericObj
1368 Adds to the use case an object as a child of the current object of the use case.
1370 \param theObject The added %SObject.
1371 \return True if this %SObject has been added in the use case.
1373 boolean Append(in SObject theObject);
1375 Removes an object from the use case.
1377 \param theObject The deleted %SObject
1378 \return True if this %SObject has been deleted from the use case.
1380 boolean Remove(in SObject theObject);
1382 Adds a child object <VAR>theObject</VAR> to the given father <VAR>theFather</VAR> object in the use case.
1384 boolean AppendTo(in SObject theFather, in SObject theObject);
1386 Inserts in the use case the object <VAR>theFirst</VAR> before the object <VAR>theNext</VAR>.
1388 boolean InsertBefore(in SObject theFirst, in SObject theNext);
1390 Sets the current object of the use case.
1392 boolean SetCurrentObject(in SObject theObject);
1394 Makes the root object to be the current object of the use case.
1396 boolean SetRootCurrent();
1398 Returns True if the given object <VAR>theObject</VAR> of the use case has child objects.
1400 boolean HasChildren(in SObject theObject);
1402 Returns True if children of the given object <VAR>theObject</VAR> of the use case tree were sorted successfully.
1404 boolean SortChildren(in SObject theObject, in boolean theAscendingOrder);
1406 Gets father object of the given object <VAR>theObject</VAR> in the use cases tree.
1408 SObject GetFather(in SObject theObject);
1410 Sets the name of the use case.
1412 boolean SetName(in string theName);
1414 Gets the name of the use case.
1418 Returns True if the given object <VAR>theObject</VAR> represents a use case.
1420 boolean IsUseCase(in SObject theObject);
1422 Returns True if the given object <VAR>theObject</VAR> is included in the use cases tree on any level.
1424 boolean IsUseCaseNode(in SObject theObject);
1426 Gets the current object of the use case.
1428 SObject GetCurrentObject();
1430 Creates a new use case in the use case browser.
1432 SObject AddUseCase(in string theName);
1434 Returns the %UseCaseIterator for the given object <VAR>theObject</VAR> in the use case.
1436 UseCaseIterator GetUseCaseIterator(in SObject theObject);
1438 //==========================================================================
1439 /*! \brief %Driver interface
1441 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
1442 can be called by any component and which provide the following functionality:
1444 <li> publishing in the study of the objects created by a definite component
1445 <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.
1446 <li> transforming of the transient references into persistant references (or vice versa) of the SObjects when saving (or loading) a study
1447 <li> copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study
1451 //==========================================================================
1455 /*! \brief Saving the data produced by a definite component.
1457 This method is called by the StudyManager when saving a study.
1458 \param theComponent %SComponent corresponding to this Component
1459 \param theURL The path to the file in which the data will be saved.
1460 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1461 \return A byte stream TMPFile that contains all saved data
1463 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1468 TMPFile Save(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1470 /*! \brief Saving the data in ASCII format produced by a definite component.
1472 This method is called by the StudyManager when saving a study in ASCII format.
1473 \param theComponent %SComponent corresponding to this Component
1474 \param theURL The path to the file in which the data will be saved.
1475 \param isMultiFile If the value of this boolean parameter is True, the data will be saved in several files.
1476 \return A byte stream TMPFile that will contain all saved data
1478 <em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
1481 TMPFile SaveASCII(in SComponent theComponent, in string theURL, in boolean isMultiFile);
1483 /*! \brief Loading the data.
1485 This method is called by the StudyManager when opening a study.
1486 \param theComponent %SComponent corresponding to this Component
1487 \param theStream The file which contains all data saved by the component on Save method
1488 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1492 boolean Load(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1494 /*! \brief Loading the data from files in ASCII format.
1496 This method is called by the StudyManager when opening a study.
1497 \param theComponent %SComponent corresponding to this Component
1498 \param theStream The file which contains all data saved by the component on Save method
1499 \param isMultiFile If the value of this boolean parameter is True, the data will be loaded from several files
1503 boolean LoadASCII(in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile);
1505 /*! \brief Closing of the study
1507 This method Close is called by the StudyManager when closing a study.
1508 \param aSComponent The according %SComponent
1511 void Close (in SComponent aSComponent);
1512 //void Close ( in string aIORSComponent);
1514 /*! Gets the type of the data
1516 \return The type of data produced by the Component in the study.
1519 string ComponentDataType();
1521 // Driver Transient -> persistent called for each object in study
1523 Transforms IOR of a given %SObject into PersistentID. It is called for each
1524 object in the %study.
1525 \note <br> In %SALOME the objects which are present in an active study are identified by an IOR, when this
1526 study is saved these references are transformed into persintent IDs.
1528 \param theSObject The given %SObject.
1529 \param IORString The IOR of the given %SObject.
1530 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1531 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1533 \return The persistent ID of the given %SObject
1536 string IORToLocalPersistentID (in SObject theSObject,
1537 in string IORString,
1538 in boolean isMultiFile,
1539 in boolean isASCII);
1541 Transforms PersistentID into IOR of the object. It is called for each
1542 object in the %study.
1544 \note <br> In %SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this
1545 study is open, these references are transformed into persintent IORs.
1547 \param theSObject The given %SObject.
1548 \param IORString The IOR of the given %SObject.
1549 \param isMultiFile If this parameter is True the study containing the given %SObject is stored in several files.
1550 \param isASCII If this parameter is True the study containing the given %SObject is stored in ASCII format.
1552 \return The IOR of the given %SObject
1555 string LocalPersistentIDToIOR (in SObject theSObject,
1556 in string aLocalPersistentID,
1557 in boolean isMultiFile,
1559 raises (SALOME::SALOME_Exception);
1561 // Publishing in the study
1562 /*! Publishing in the study
1564 \return True if the given %Component can publish a definite object with a given IOR in the %study.
1565 \param theIOR The IOR of a definite object
1567 boolean CanPublishInStudy(in Object theIOR) raises (SALOME::SALOME_Exception);
1568 /*! \brief Publishing in the study
1570 Publishes the given object in the %study, using the algorithm of this component.
1571 \param theStudy The %study in which the object is published
1572 \param theSObject If this parameter is null the object is published for the first time. Otherwise
1573 this parameter should contain a reference to the object published earlier
1574 \param theObject The object which is published
1575 \param theName The name of the published object. If this parameter is empty, the name is generated
1576 automatically by the component.
1578 \return The published %SObject.
1580 SObject PublishInStudy(in Study theStudy, in SObject theSObject, in Object theObject, in string theName);
1582 // copy/paste methods
1585 Returns True, if the given %SObject can be copied to the clipboard.
1587 \param theObject The given %SObject which should be copied.
1589 boolean CanCopy(in SObject theObject);
1591 Returns the object %ID and the %TMPFile of the object from the given %SObject.
1593 TMPFile CopyFrom(in SObject theObject, out long theObjectID);
1595 Returns True, if the component can paste the object with given %ID of the component with name <VAR>theComponentName</VAR>.
1597 boolean CanPaste(in string theComponentName, in long theObjectID);
1599 Returns the %SObject of the pasted object.
1601 SObject PasteInto(in TMPFile theStream, in long theObjectID, in SObject theObject);