OCC.Core.CDF module

CDF module, see official documentation at https://www.opencascade.com/doc/occt-7.4.0/refman/html/package_cdf.html

class CDF_Application(*args, **kwargs)

Bases: OCC.Core.CDM.CDM_Application

  • Empty constructor

Return type

None* Copy constructor – does nothing

Parameters

& (Standard_Transient) –

Return type

None

CanClose()
Parameters

aDocument

type aDocument

CDM_Document

rtype

CDM_CanCloseStatus

CanRetrieve()
Parameters

aFolder

type aFolder

TCollection_ExtendedString

param aName

type aName

TCollection_ExtendedString

rtype

PCDM_ReaderStatus:param aFolder:

type aFolder

TCollection_ExtendedString

param aName

type aName

TCollection_ExtendedString

param aVersion

type aVersion

TCollection_ExtendedString

rtype

PCDM_ReaderStatus

Close()
  • removes the document of the current session directory and closes the document;
    param aDocument

    type aDocument

    CDM_Document

    rtype

    None

DefaultFolder()
Return type

Standard_ExtString

static DownCast(t)
Format()
  • try to retrieve a Format directly in the file or in application resource by using extension. returns True if found;
    param aFileName

    type aFileName

    TCollection_ExtendedString

    param theFormat

    type theFormat

    TCollection_ExtendedString

    rtype

    bool

GetRetrieveStatus()
  • Checks status after Retrieve
    rtype

    PCDM_ReaderStatus

static Load()
  • plugs an application. //! Open is used - for opening a Document that has been created in an application - for opening a Document from the database - for opening a Document from a file. The Open methods always add the document in the session directory and calls the virtual Activate method. The document is considered to be opened until Close is used. To be storable, a document must be opened by an application since the application resources are needed to store it.
    param aGUID

    type aGUID

    Standard_GUID

    rtype

    opencascade::handle<CDF_Application>

Open()
  • puts the document in the current session directory and calls the virtual method Activate on it.
    param aDocument

    type aDocument

    CDM_Document

    rtype

    None

ReadFromString(CDF_Application self, std::string src)
ReaderFromFormat()
  • Returns instance of read driver for specified format. //! Default implementation uses plugin mechanism to load reader dynamically. For this to work, application resources should define GUID of the plugin as value of [Format].RetrievalPlugin, and ‘Plugin’ resource should define name of plugin library to be loaded as value of [GUID].Location. Plugin library should provide method PLUGINFACTORY returning instance of the reader for the same GUID (see Plugin_Macro.hxx). //! In case if reader is not available, will raise Standard_NoSuchObject or other exception if raised by plugin loader.
    param aFormat

    type aFormat

    TCollection_ExtendedString

    rtype

    opencascade::handle<PCDM_Reader>

Retrieve()
  • This method retrieves a document from the database. If the Document references other documents which have been updated, the latest version of these documents will be used if {UseStorageConfiguration} is Standard_True. The content of {aFolder}, {aName} and {aVersion} depends on the Database Manager system. If the DBMS is only based on the OS, {aFolder} is a directory and {aName} is the name of a file. In this case the use of the syntax with {aVersion} has no sense. For example: //! opencascade::handle<CDM_Document> theDocument=myApplication->Retrieve(‘/home/cascade’,’box.dsg’); If the DBMS is EUCLID/Design Manager, {aFolder}, {aName} have the form they have in EUCLID/Design Manager. For example: //! opencascade::handle<CDM_Document> theDocument=myApplication->Retrieve(‘|user|cascade’,’box’); //! Since the version is not specified in this syntax, the latest wil be used. A link is kept with the database through an instance of CDM_MetaData
    param aFolder

    type aFolder

    TCollection_ExtendedString

    param aName

    type aName

    TCollection_ExtendedString

    param UseStorageConfiguration

    default value is Standard_True

    type UseStorageConfiguration

    bool

    rtype

    opencascade::handle<CDM_Document>* This method retrieves a document from the database. If the Document references other documents which have been updated, the latest version of these documents will be used if {UseStorageConfiguration} is Standard_True. – If the DBMS is only based on the OS, this syntax should not be used. //! If the DBMS is EUCLID/Design Manager, {aFolder}, {aName} and {aVersion} have the form they have in EUCLID/Design Manager. For example: //! opencascade::handle<CDM_Document> theDocument=myApplication->Retrieve(‘|user|cascade’,’box’,’2’); A link is kept with the database through an instance of CDM_MetaData

    param aFolder

    type aFolder

    TCollection_ExtendedString

    param aName

    type aName

    TCollection_ExtendedString

    param aVersion

    type aVersion

    TCollection_ExtendedString

    param UseStorageConfiguration

    default value is Standard_True

    type UseStorageConfiguration

    bool

    rtype

    opencascade::handle<CDM_Document>

SetDefaultFolder()
Parameters

aFolder

type aFolder

Standard_ExtString

rtype

bool

WriterFromFormat()
  • Returns instance of storage driver for specified format. //! Default implementation uses plugin mechanism to load driver dynamically. For this to work, application resources should define GUID of the plugin as value of [Format].StoragePlugin, and ‘Plugin’ resource should define name of plugin library to be loaded as value of [GUID].Location. Plugin library should provide method PLUGINFACTORY returning instance of the reader for the same GUID (see Plugin_Macro.hxx). //! In case if driver is not available, will raise Standard_NoSuchObject or other exception if raised by plugin loader.
    param aFormat

    type aFormat

    TCollection_ExtendedString

    rtype

    opencascade::handle<PCDM_StorageDriver>

property thisown

The membership flag

class CDF_Directory(*args)

Bases: OCC.Core.Standard.Standard_Transient

  • Creates an empty directory.
    rtype

    None

Add()
  • adds a document into the directory.
    param aDocument

    type aDocument

    CDM_Document

    rtype

    None

Contains()
  • Returns true if the document aDocument is in the directory
    param aDocument

    type aDocument

    CDM_Document

    rtype

    bool

static DownCast(t)
IsEmpty()
  • returns true if the directory is empty.
    rtype

    bool

Last()
  • returns the last document (if any) which has been added in the directory.
    rtype

    opencascade::handle<CDM_Document>

Length()
  • returns the number of documents of the directory.
    rtype

    int

Remove()
  • removes the document.
    param aDocument

    type aDocument

    CDM_Document

    rtype

    None

property thisown

The membership flag

class CDF_DirectoryIterator(*args)

Bases: object

  • creates an Iterator with the directory of the current CDF.
    rtype

    None:param aDirectory:

    type aDirectory

    CDF_Directory

    rtype

    None

Document()
  • Returns item value of current entry
    rtype

    opencascade::handle<CDM_Document>

MoreDocument()
  • Returns True if there are more entries to return
    rtype

    bool

NextDocument()
  • Go to the next entry (if there is not, Value will raise an exception)
    rtype

    None

property thisown

The membership flag

class CDF_FWOSDriver(*args)

Bases: OCC.Core.CDF.CDF_MetaDataDriver

  • initializes the MetaDatadriver with its specific name.
    rtype

    None

static DownCast(t)
property thisown

The membership flag

class CDF_MetaDataDriver(*args, **kwargs)

Bases: OCC.Core.Standard.Standard_Transient

  • Empty constructor

Return type

None* Copy constructor – does nothing

Parameters

& (Standard_Transient) –

Return type

None

BuildFileName()
Parameters

aDocument

type aDocument

CDM_Document

rtype

TCollection_ExtendedString

CreateDependsOn()
  • Creates a ‘Depends On’ relation between two Datas. By default does nothing
    param aFirstData

    type aFirstData

    CDM_MetaData

    param aSecondData

    type aSecondData

    CDM_MetaData

    rtype

    void

CreateMetaData()
  • should create meta-data corresponding to aData and maintaining a meta-link between these meta-data and aFileName CreateMetaData is called by CreateData If the metadata-driver has version capabilities, version must be set in the returned Data.
    param aDocument

    type aDocument

    CDM_Document

    param aFileName

    type aFileName

    TCollection_ExtendedString

    rtype

    opencascade::handle<CDM_MetaData>

CreateReference()
Parameters

aFrom

type aFrom

CDM_MetaData

param aTo

type aTo

CDM_MetaData

param aReferenceIdentifier

type aReferenceIdentifier

int

param aToDocumentVersion

type aToDocumentVersion

int

rtype

void

DefaultFolder()
Return type

TCollection_ExtendedString

static DownCast(t)
Find()
  • should indicate whether meta-data exist in the DBMS corresponding to the Data. aVersion may be NULL;
    param aFolder

    type aFolder

    TCollection_ExtendedString

    param aName

    type aName

    TCollection_ExtendedString

    param aVersion

    type aVersion

    TCollection_ExtendedString

    rtype

    bool* calls Find with an empty version

    param aFolder

    type aFolder

    TCollection_ExtendedString

    param aName

    type aName

    TCollection_ExtendedString

    rtype

    bool

FindFolder()
Parameters

aFolder

type aFolder

TCollection_ExtendedString

rtype

bool

HasReadPermission()
Parameters

aFolder

type aFolder

TCollection_ExtendedString

param aName

type aName

TCollection_ExtendedString

param aVersion

type aVersion

TCollection_ExtendedString

rtype

bool

HasVersion()
  • by default return Standard_True.
    param aFolder

    type aFolder

    TCollection_ExtendedString

    param aName

    type aName

    TCollection_ExtendedString

    rtype

    bool

HasVersionCapability()
  • returns true if the MetaDataDriver can manage different versions of a Data. By default, returns Standard_False.
    rtype

    bool

LastVersion()
  • by default returns aMetaDATA should return the MetaData stored in the DBMS with the meta-data corresponding to the path. If the MetaDataDriver has version management capabilities the version has to be set in the returned MetaData. MetaData is called by GetMetaData If the version is not included in the path , MetaData should return the last version of the metadata is deferred;
    param aMetaData

    type aMetaData

    CDM_MetaData

    rtype

    opencascade::handle<CDM_MetaData>

MetaData()
  • should return the MetaData stored in the DBMS with the meta-data corresponding to the Data. If the MetaDataDriver has version management capabilities the version has to be set in the returned MetaData. aVersion may be NULL MetaData is called by GetMetaData If the version is set to NULL, MetaData should return the last version of the metadata
    param aFolder

    type aFolder

    TCollection_ExtendedString

    param aName

    type aName

    TCollection_ExtendedString

    param aVersion

    type aVersion

    TCollection_ExtendedString

    rtype

    opencascade::handle<CDM_MetaData>* calls MetaData with an empty version

    param aFolder

    type aFolder

    TCollection_ExtendedString

    param aName

    type aName

    TCollection_ExtendedString

    rtype

    opencascade::handle<CDM_MetaData>

ReferenceIterator()
Return type

opencascade::handle<PCDM_ReferenceIterator>

SetName()
  • this methods is usefull if the name of an object – depends on the metadatadriver. For example a Driver – based on the operating system can choose to add the extension of file to create to the object.
    param aDocument

    type aDocument

    CDM_Document

    param aName

    type aName

    TCollection_ExtendedString

    rtype

    TCollection_ExtendedString

property thisown

The membership flag

class CDF_MetaDataDriverFactory(*args, **kwargs)

Bases: OCC.Core.Standard.Standard_Transient

  • Empty constructor

Return type

None* Copy constructor – does nothing

Parameters

& (Standard_Transient) –

Return type

None

Build()
Return type

opencascade::handle<CDF_MetaDataDriver>

static DownCast(t)
property thisown

The membership flag

class CDF_Session(*args)

Bases: OCC.Core.Standard.Standard_Transient

Return type

None

CurrentApplication()
Return type

opencascade::handle<CDF_Application>

static CurrentSession()
  • returns the only one instance of Session that has been created.
    rtype

    opencascade::handle<CDF_Session>

Directory()
  • returns the directory of the session;
    rtype

    opencascade::handle<CDF_Directory>

static DownCast(t)
static Exists()
  • returns true if a session has been created.
    rtype

    bool

HasCurrentApplication()
Return type

bool

LoadDriver()
Return type

None

MetaDataDriver()
Return type

opencascade::handle<CDF_MetaDataDriver>

SetCurrentApplication()
Parameters

anApplication

type anApplication

CDF_Application

rtype

None

UnsetCurrentApplication()
Return type

None

property thisown

The membership flag

class CDF_Store(*args)

Bases: object

  • creates a store list from the document of the current selection.
    param aDocument

    type aDocument

    CDM_Document

    rtype

    None

AssociatedStatusText()
Return type

Standard_ExtString

Comment()
Return type

Standard_ExtString

Component()
  • Returns item value of current entry
    rtype

    Standard_ExtString

CurrentIsConsistent()
Return type

bool

Description()
  • returns the description of the format of the main object.
    rtype

    Standard_ExtString

Folder()
  • returns the folder in which the current document will be stored.
    rtype

    Standard_ExtString

HasAPreviousVersion()
Return type

bool

HasSubComponents()
Return type

bool

InitComponent()
  • Allows to Start a new Iteration from beginning
    rtype

    None

IsConsistent()
Return type

bool

IsMainDocument()
  • returns true if the currentdocument is the main one, ie the document of the current selection.
    rtype

    bool

IsModified()
Return type

bool

IsStored()
  • returns true if the current document is already stored
    rtype

    bool

MetaDataPath()
  • returns the path of the previous store is the object is already stored, otherwise an empty string;
    rtype

    Standard_ExtString

MoreComponent()
  • Returns True if there are more entries to return
    rtype

    bool

Name()
  • returns the name under which the current document will be stored
    rtype

    Standard_ExtString

NextComponent()
  • Go to the next entry (if there is not, Value will raise an exception)
    rtype

    None

Path()
  • returns the complete path of the created meta-data.
    rtype

    Standard_ExtString

PreviousVersion()
Return type

Standard_ExtString

Realize()
Return type

None

RecheckName()
  • defines the name under which the document should be stored. uses for example after modification of the folder.
    rtype

    CDF_StoreSetNameStatus

SetComment()
Parameters

aComment

type aComment

Standard_ExtString

rtype

None

SetCurrent()
Return type

None:param aPresentation: :type aPresentation: Standard_ExtString :rtype: None

SetFolder()
  • defines the folder in which the document should be stored. returns Standard_True if the Folder exists, Standard_False otherwise.
    param aFolder

    type aFolder

    TCollection_ExtendedString

    rtype

    bool* defines the folder in which the document should be stored. returns Standard_True if the Folder exists, Standard_False otherwise.

    param aFolder

    type aFolder

    Standard_ExtString

    rtype

    bool

SetMain()
  • the two following methods can be used just after Realize or Import – method to know if thes methods worked correctly, and if not why.
    rtype

    None

SetName()
  • defines the name under which the document should be stored.
    param aName

    type aName

    Standard_ExtString

    rtype

    CDF_StoreSetNameStatus* defines the name under which the document should be stored.

    param aName

    type aName

    TCollection_ExtendedString

    rtype

    CDF_StoreSetNameStatus

SetPreviousVersion()
Parameters

aPreviousVersion

type aPreviousVersion

Standard_ExtString

rtype

bool

StoreStatus()
Return type

PCDM_StoreStatus

SubComponentStatus()
Parameters

aPresentation

type aPresentation

Standard_ExtString

rtype

CDF_SubComponentStatus

property thisown

The membership flag

class CDF_StoreList(*args)

Bases: OCC.Core.Standard.Standard_Transient

Parameters

aDocument

type aDocument

CDM_Document

rtype

None

static DownCast(t)
Init()
Return type

None

IsConsistent()
Return type

bool

More()
Return type

bool

Next()
Return type

None

Store()
  • stores each object of the storelist in the reverse order of which they had been added.
    param aMetaData

    type aMetaData

    CDM_MetaData

    param aStatusAssociatedText

    type aStatusAssociatedText

    TCollection_ExtendedString

    rtype

    PCDM_StoreStatus

Value()
Return type

opencascade::handle<CDM_Document>

property thisown

The membership flag

class SwigPyIterator(*args, **kwargs)

Bases: object

advance()
copy()
decr()
distance()
equal()
incr()
next()
previous()
property thisown

The membership flag

value()
class cdf

Bases: object

static GetLicense()
Parameters

anApplicationIdentifier

type anApplicationIdentifier

int

rtype

void

static IsAvailable()
Parameters

anApplicationIdentifier

type anApplicationIdentifier

int

rtype

bool

property thisown

The membership flag