Version: 9.12.0
SALOMEDS::Driver Interface Reference

Driver interface More...

import"SALOMEDS.idl";

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 ()
 Gets the type of the data. More...
 
string IORToLocalPersistentID (in SObject theSObject, in string IORString, in boolean isMultiFile, in boolean isASCII)
 Transforms IOR of a given SObject into PersistentID. More...
 
string LocalPersistentIDToIOR (in SObject theSObject, in string aLocalPersistentID, in boolean isMultiFile, in boolean isASCII) raises (SALOME::SALOME_Exception)
 Transforms PersistentID into IOR of the object. More...
 
boolean CanPublishInStudy (in Object theIOR) raises (SALOME::SALOME_Exception)
 Publishing in the study. More...
 
SObject PublishInStudy (in SObject theSObject, in Object theObject, in string theName)
 Publishing in the study. More...
 
boolean CanCopy (in SObject theObject)
 Returns True, if the given SObject can be copied to the clipboard. More...
 
TMPFile CopyFrom (in SObject theObject, out long theObjectID)
 Returns the object ID and the TMPFile of the object from the given SObject. More...
 
boolean 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. More...
 
SObject PasteInto (in TMPFile theStream, in long theObjectID, in SObject theObject)
 Returns the SObject of the pasted object. More...
 

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 when loading/saving a study containing the data created by a definite component.
  • transforming of the transient references into persistent 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

◆ CanCopy()

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.

◆ CanPaste()

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.

◆ CanPublishInStudy()

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

◆ Close()

void SALOMEDS::Driver::Close ( in SComponent  aSComponent)

Closing of the study.

This method Close is called when closing a study.

Parameters
aSComponentThe according SComponent

◆ ComponentDataType()

string SALOMEDS::Driver::ComponentDataType ( )

Gets the type of the data.

Returns
The type of data produced by the Component in the study.

◆ CopyFrom()

TMPFile SALOMEDS::Driver::CopyFrom ( in SObject  theObject,
out long  theObjectID 
)

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

◆ IORToLocalPersistentID()

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

◆ Load()

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

Loading the data.

This method is called 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

Referenced by SALOME_DriverPy.SALOME_DriverPy_i::LoadASCII().

◆ LoadASCII()

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 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

◆ LocalPersistentIDToIOR()

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

◆ PasteInto()

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

Returns the SObject of the pasted object.

◆ PublishInStudy()

SObject SALOMEDS::Driver::PublishInStudy ( 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
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.

◆ Save()

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 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.

Referenced by SALOME_DriverPy.SALOME_DriverPy_i::SaveASCII().

◆ SaveASCII()

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 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.