OpenCascade.js
API ReferenceApplicationFrameworkTKCDF

CDM

OCCT package CDM: CDM_Application, CDM_CanCloseStatus, CDM_Document, CDM_MetaData, and 2 more bound classes.

CDM_Application

Static methods(2)

Instance methods(7)

CDM_Document

An applicative document is an instance of a class inheriting CDM_Document. These documents have the following properties:

  • they can have references to other documents.
  • the modifications of a document are propagated to the referencing documents.
  • a document can be stored in different formats, with or without a persistent model.
  • the drivers for storing and retrieving documents are plugged in when necessary.
  • a document has a modification counter. This counter is incremented when the document is modified. When a document is stored, the current counter value is memorized as the last storage version of the document. A document is considered to be modified when the counter value is different from the storage version. Once the document is saved the storage version and the counter value are identical. The document is now not considered to be modified.
  • a reference is a link between two documents. A reference has two components: the "From Document" and the "To Document". When a reference is created, an identifier of the reference is generated. This identifier is unique in the scope of the From Document and is conserved during storage and retrieval. This means that the referenced document will be always accessible through this identifier.
  • a reference memorizes the counter value of the To Document when the reference is created. The From Document is considered to be up to date relative to the To Document when the reference counter value is equal to the To Document counter value.
  • retrieval of a document having references does not imply the retrieving of the referenced documents.

Static methods(2)

Instance methods(69)

  • Update(ErrorString: TCollection_ExtendedString): boolean

    This method Update will be called to signal the end of the modified references list. The document should be recomputed and UpdateFromDocuments should be called. Update should returns True in case of success, false otherwise. In case of Failure, additional information can be given in ErrorString.

    Parameters (1)
    • ErrorString
      Mutated in place; read the updated value from this argument after the call.
  • Update(): void

    the following method should be used instead:
    Update(me:mutable; ErrorString: out ExtendedString from TCollection) returns Boolean from Standard

  • The Storage Format is the key which is used to determine in the application resources the storage driver plugin, the file extension and other data used to store the document.

  • by default empties the extensions.

    Parameters (1)
    • Extensions
      Mutated in place; read the updated value from this argument after the call.
  • GetAlternativeDocument(aFormat: TCollection_ExtendedString): { returnValue: boolean; anAlternativeDocument: CDM_Document; [Symbol.dispose](): void }

    This method can be redefined to extract another document in a different format. For example, to extract a Shape from an applicative document.

    Parameters (1)
    • aFormat
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • anAlternativeDocument: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • CreateReference(anOtherDocument: CDM_Document): number

    Creates a reference from this document to {anOtherDocument}. Returns a reference identifier. This reference identifier is unique in the document and will not be used for the next references, even after the storing of the document. If there is already a reference between the two documents, the reference is not created, but its reference identifier is returned.

    Parameters (1)
    • anOtherDocument
  • CreateReference(aMetaData: CDM_MetaData, aReferenceIdentifier: number, anApplication: CDM_Application, aToDocumentVersion: number, UseStorageConfiguration: boolean): void
    Parameters (5)
    • aMetaData
    • aReferenceIdentifier
    • anApplication
    • aToDocumentVersion
    • UseStorageConfiguration
  • CreateReference(aMetaData: CDM_MetaData, anApplication: CDM_Application, aDocumentVersion: number, UseStorageConfiguration: boolean): number
    Parameters (4)
    • aMetaData
    • anApplication
    • aDocumentVersion
    • UseStorageConfiguration
  • RemoveReference(aReferenceIdentifier: number): void

    Removes the reference between the From Document and the To Document identified by a reference identifier.

    Parameters (1)
    • aReferenceIdentifier
  • Removes all references having this document for From Document.

  • Document(aReferenceIdentifier: number): CDM_Document

    Returns the To Document of the reference identified by aReferenceIdentifier. If the ToDocument is stored and has not yet been retrieved, this method will retrieve it.

    Parameters (1)
    • aReferenceIdentifier
  • IsInSession(aReferenceIdentifier: number): boolean

    returns True if the To Document of the reference identified by aReferenceIdentifier is in session, False if it corresponds to a not yet retrieved document.

    Parameters (1)
    • aReferenceIdentifier
  • IsStored(aReferenceIdentifier: number): boolean

    returns True if the To Document of the reference identified by aReferenceIdentifier has already been stored, False otherwise.

    Parameters (1)
    • aReferenceIdentifier
  • IsStored(): boolean
  • Name(aReferenceIdentifier: number): TCollection_ExtendedString

    returns the name of the metadata of the To Document of the reference identified by aReferenceIdentifier.

    Parameters (1)
    • aReferenceIdentifier
  • returns the number of references having this document as From Document.

  • returns the number of references having this document as To Document.

  • ShallowReferences(aDocument: CDM_Document): boolean

    returns True is this document references aDocument;

    Parameters (1)
    • aDocument
  • DeepReferences(aDocument: CDM_Document): boolean

    returns True is this document references aDocument;

    Parameters (1)
    • aDocument
  • CopyReference(aFromDocument: CDM_Document, aReferenceIdentifier: number): number

    Copies a reference to this document. This method avoid retrieval of referenced document. The arguments are the original document and a valid reference identifier Returns the local identifier.

    Parameters (2)
    • aFromDocument
    • aReferenceIdentifier
  • IsReadOnly(): boolean

    indicates that this document cannot be modified.

  • IsReadOnly(aReferenceIdentifier: number): boolean

    indicates that the referenced document cannot be modified,

    Parameters (1)
    • aReferenceIdentifier
  • Modify(): void

    Indicates that this document has been modified. This method increments the modification counter.

  • Modifications(): number

    returns the current modification counter.

  • UnModify(): void
  • IsUpToDate(aReferenceIdentifier: number): boolean

    returns true if the modification counter found in the given reference is equal to the actual modification counter of the To Document. This method is able to deal with a reference to a not retrieved document.

    Parameters (1)
    • aReferenceIdentifier
  • SetIsUpToDate(aReferenceIdentifier: number): void

    Resets the modification counter in the given reference to the actual modification counter of its To Document. This method should be called after the application has updated this document.

    Parameters (1)
    • aReferenceIdentifier
  • associates a comment with this document.

    Parameters (1)
    • aComment
  • appends a comment into comments of this document.

    Parameters (1)
    • aComment
  • associates a comments with this document.

    Parameters (1)
    • aComments
  • returns the associated comments through <aComments>. Returns empty sequence if no comments are associated.

    Parameters (1)
    • aComments
      Mutated in place; read the updated value from this argument after the call.
  • Comment(): string

    Returns the first of associated comments. By default the comment is an empty string.

  • StorageVersion(): number

    returns the value of the modification counter at the time of storage. By default returns 0.

  • SetMetaData(aMetaData: CDM_MetaData): void

    associates database information to a document which has been stored. The name of the document is now the name which has beenused to store the data.

    Parameters (1)
    • aMetaData
  • defines the folder in which the object should be stored.

    Parameters (1)
    • aFolder
  • defines the name under which the object should be stored.

    Parameters (1)
    • aName
  • Determines under which the document is going to be store. By default the name of the document will be used. If the document has no name its presentation will be used.

  • Parameters (1)
    • aPreviousVersion
  • defines the Comment with which the object should be stored.

    Parameters (1)
    • aComment
  • read (or rereads) the following resource.

  • gets the Desktop.Domain.Application.FileFormat.FileExtension resource.

  • FindDescription(): boolean
  • gets the FileFormat.Description resource.

  • IsModified(): boolean

    returns true if the version is greater than the storage version

  • IsOpened(): boolean
  • IsOpened(aReferenceIdentifier: number): boolean

    returns true if the document corresponding to the given reference has been retrieved and opened. Otherwise returns false. This method does not retrieve the referenced document

    Parameters (1)
    • aReferenceIdentifier
  • Open(anApplication: CDM_Application): void
    Parameters (1)
    • anApplication
  • Close(): void
  • CanCloseReference(aDocument: CDM_Document, aReferenceIdentifier: number): boolean

    A referenced document may indicate through this virtual method that it does not allow the closing of aDocument which it references through the reference aReferenceIdentifier. By default returns true.

    Parameters (2)
    • aDocument
    • aReferenceIdentifier
  • CloseReference(aDocument: CDM_Document, aReferenceIdentifier: number): void

    A referenced document may update its internal data structure when {aDocument} which it references through the reference {aReferenceIdentifier} is being closed. By default this method does nothing.

    Parameters (2)
    • aDocument
    • aReferenceIdentifier
  • Reference(aReferenceIdentifier: number): CDM_Reference
    Parameters (1)
    • aReferenceIdentifier
  • SetModifications(Modifications: number): void
    Parameters (1)
    • Modifications
  • SetReferenceCounter(aReferenceCounter: number): void
    Parameters (1)
    • aReferenceCounter

CDM_MetaData

Static methods(4)

Instance methods(13)