Version: 8.3.0
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
SALOMEDS::Driver Interface Reference

Driver interface More...

Public Member Functions

TMPFile Save (in SComponent theComponent, in string theURL, in boolean isMultiFile)
 Saving the data produced by a definite component. More...
 
TMPFile SaveASCII (in SComponent theComponent, in string theURL, in boolean isMultiFile)
 Saving the data in ASCII format produced by a definite component. More...
 
boolean Load (in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile)
 Loading the data. More...
 
boolean LoadASCII (in SComponent theComponent, in TMPFile theStream, in string theURL, in boolean isMultiFile)
 Loading the data from files in ASCII format. More...
 
void Close (in SComponent aSComponent)
 Closing of the study. More...
 
string ComponentDataType ()
 
string IORToLocalPersistentID (in SObject theSObject, in string IORString, in boolean isMultiFile, in boolean isASCII)
 
string LocalPersistentIDToIOR (in SObject theSObject, in string aLocalPersistentID, in boolean isMultiFile, in boolean isASCII) raises (SALOME::SALOME_Exception)
 
boolean CanPublishInStudy (in Object theIOR) raises (SALOME::SALOME_Exception)
 
SObject PublishInStudy (in Study theStudy, in SObject theSObject, in Object theObject, in string theName)
 Publishing in the study. More...
 
boolean CanCopy (in SObject theObject)
 
TMPFile CopyFrom (in SObject theObject, out long theObjectID)
 
boolean CanPaste (in string theComponentName, in long theObjectID)
 
SObject PasteInto (in TMPFile theStream, in long theObjectID, in SObject theObject)
 

Detailed Description

Driver interface

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 can be called by any component and which provide the following functionality:

  • publishing in the study of the objects created by a definite component
  • 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.
  • transforming of the transient references into persistant references (or vice versa) of the SObjects when saving (or loading) a study
  • copy/paste common functionality. These methods can be called by any component in order to copy/paste its object created in the study

Member Function Documentation

TMPFile SALOMEDS::Driver::Save ( in SComponent  theComponent,
in string  theURL,
in boolean  isMultiFile 
)

Saving the data produced by a definite component.

    This method is called by the StudyManager when saving a study.
Parameters
theComponentSComponent corresponding to this Component
theURLThe path to the file in which the data will be saved.
isMultiFileIf the value of this boolean parameter is True, the data will be saved in several files.
Returns
A byte stream TMPFile that contains all saved data

See example19 for an example of this method usage in batchmode of SALOME application.

TMPFile SALOMEDS::Driver::SaveASCII ( in SComponent  theComponent,
in string  theURL,
in boolean  isMultiFile 
)

Saving the data in ASCII format produced by a definite component.

    This method is called by the StudyManager when saving a study in ASCII format.
Parameters
theComponentSComponent corresponding to this Component
theURLThe path to the file in which the data will be saved.
isMultiFileIf the value of this boolean parameter is True, the data will be saved in several files.
Returns
A byte stream TMPFile that will contain all saved data

See example19 for an example of this method usage in batchmode of SALOME application.

boolean SALOMEDS::Driver::Load ( in SComponent  theComponent,
in TMPFile  theStream,
in string  theURL,
in boolean  isMultiFile 
)

Loading the data.

  This method is called by the StudyManager when opening a study.
Parameters
theComponentSComponent corresponding to this Component
theStreamThe file which contains all data saved by the component on Save method
isMultiFileIf the value of this boolean parameter is True, the data will be loaded from several files
boolean SALOMEDS::Driver::LoadASCII ( in SComponent  theComponent,
in TMPFile  theStream,
in string  theURL,
in boolean  isMultiFile 
)

Loading the data from files in ASCII format.

  This method is called by the StudyManager when opening a study.
Parameters
theComponentSComponent corresponding to this Component
theStreamThe file which contains all data saved by the component on Save method
isMultiFileIf the value of this boolean parameter is True, the data will be loaded from several files
void SALOMEDS::Driver::Close ( in SComponent  aSComponent)

Closing of the study.

 This method Close is called by the StudyManager when closing a study.
Parameters
aSComponentThe according SComponent
string SALOMEDS::Driver::ComponentDataType ( )

Gets the type of the data

Returns
The type of data produced by the Component in the study.
string SALOMEDS::Driver::IORToLocalPersistentID ( in SObject  theSObject,
in string  IORString,
in boolean  isMultiFile,
in boolean  isASCII 
)

Transforms IOR of a given SObject into PersistentID. It is called for each object in the study.

Note

In SALOME the objects which are present in an active study are identified by an IOR, when this study is saved these references are transformed into persintent IDs.
Parameters
theSObjectThe given SObject.
IORStringThe IOR of the given SObject.
isMultiFileIf this parameter is True the study containing the given SObject is stored in several files.
isASCIIIf this parameter is True the study containing the given SObject is stored in ASCII format.
Returns
The persistent ID of the given SObject
string SALOMEDS::Driver::LocalPersistentIDToIOR ( in SObject  theSObject,
in string  aLocalPersistentID,
in boolean  isMultiFile,
in boolean  isASCII 
) raises (SALOME::SALOME_Exception)

Transforms PersistentID into IOR of the object. It is called for each object in the study.

Note

In SALOME the objects which are present in an saved study (file) are identified by a persistent ID, when this study is open, these references are transformed into persintent IORs.
Parameters
theSObjectThe given SObject.
IORStringThe IOR of the given SObject.
isMultiFileIf this parameter is True the study containing the given SObject is stored in several files.
isASCIIIf this parameter is True the study containing the given SObject is stored in ASCII format.
Returns
The IOR of the given SObject
boolean SALOMEDS::Driver::CanPublishInStudy ( in Object  theIOR) raises (SALOME::SALOME_Exception)

Publishing in the study

Returns
True if the given Component can publish a definite object with a given IOR in the study.
Parameters
theIORThe IOR of a definite object
SObject SALOMEDS::Driver::PublishInStudy ( in Study  theStudy,
in SObject  theSObject,
in Object  theObject,
in string  theName 
)

Publishing in the study.

Publishes the given object in the study, using the algorithm of this component.

Parameters
theStudyThe study in which the object is published
theSObjectIf this parameter is null the object is published for the first time. Otherwise this parameter should contain a reference to the object published earlier
theObjectThe object which is published
theNameThe name of the published object. If this parameter is empty, the name is generated automatically by the component.
Returns
The published SObject.
boolean SALOMEDS::Driver::CanCopy ( in SObject  theObject)

Returns True, if the given SObject can be copied to the clipboard.

Parameters
theObjectThe given SObject which should be copied.
TMPFile SALOMEDS::Driver::CopyFrom ( in SObject  theObject,
out long  theObjectID 
)

Returns the object ID and the TMPFile of the object from the given SObject.

boolean SALOMEDS::Driver::CanPaste ( in string  theComponentName,
in long  theObjectID 
)

Returns True, if the component can paste the object with given ID of the component with name theComponentName.

SObject SALOMEDS::Driver::PasteInto ( in TMPFile  theStream,
in long  theObjectID,
in SObject  theObject 
)

Returns the SObject of the pasted object.