OpenCascade.js
API ReferenceDataExchangeTKXSBase

TransferBRep

OCCT package TransferBRep: TransferBRep_BinderOfShape, TransferBRep_Reader, TransferBRep_ShapeBinder, TransferBRep_ShapeInfo, and 3 more bound classes.

TransferBRep_BinderOfShape

Allows direct binding between a starting Object and the Result of its transfer when it is Unique. The Result itself is defined as a formal parameter <Shape from TopoDS> Warning : While it is possible to instantiate BinderOfShape with any Type for the Result, it is not advisable to instantiate it with Transient Classes, because such Results are directly known and managed by TransferProcess & Co, through SimpleBinderOfTransient : this class looks like instantiation of BinderOfShape, but its method ResultType is adapted (reads DynamicType of the Result).

Constructors(2)

Static methods(2)

Instance methods(6)

  • Returns the Type permitted for the Result, i.e. the Type of the Parameter Class <Shape from TopoDS> (statically defined).

  • ResultTypeName(): string

    Returns the Type Name computed for the Result (dynamic).

  • Defines the Result.

    Parameters (1)
    • res
  • Returns the defined Result, if there is one.

  • Returns the defined Result, if there is one, and allows to change it (avoids Result + SetResult). Admits that Result can be not yet defined Warning : a call to CResult causes Result to be known as defined.

TransferBRep_Reader

This class offers a simple, easy to call, way of transferring data from interface files to Shapes from CasCade It must be specialized according to each norm/protocol, by :

  • defining how to read a file (specific method with protocol)
  • definig transfer, by providing an Actor

Constructors(1)

  • Initializes a non-specialised Reader. Typically, for each norm or protocol, is will be required to define a specific Create to load a file and transfer it.

Instance methods(30)

  • Records the protocol to be used for read and transfer roots.

    Parameters (1)
    • protocol
  • Returns the recorded Protocol.

  • Records the actor to be used for transfers.

    Parameters (1)
    • actor
  • Returns the recorded Actor.

  • SetFileStatus(status: number): void

    Sets File Status to be interpreted as follows : = 0 OK < 0 file not found.
    0 read error, no Model could be created

    Parameters (1)
    • status
  • FileStatus(): number

    Returns the File Status.

  • FileNotFound(): boolean

    Returns True if FileStatus is for FileNotFound.

  • SyntaxError(): boolean

    Returns True if FileStatus is for Error during read (major error; for local error, see CheckModel).

  • Specifies a Model to work on Also clears the result and Done status.

    Parameters (1)
    • model
  • Returns the Model to be worked on.

  • Clear(): void

    clears the result and Done status. But not the Model.

  • CheckStatusModel(withprint: boolean): boolean

    Checks the Model. Returns True if there is NO FAIL at all (regardless Warnings) If <withprint> is True, also sends Checks on standard output.

    Parameters (1)
    • withprint
  • ModeNewTransfer(): boolean

    Returns (by Reference, hence can be changed) the Mode for new Transfer : True (D) means that each new Transfer produces a new TransferProcess. Else keeps the original one but each Transfer clears its (former results are not kept).

  • BeginTransfer(): boolean

    Initializes the Reader for a Transfer (one,roots, or list) Also calls PrepareTransfer Returns True when done, False if could not be done.

  • EndTransfer(): void

    Ebds a Transfer (one, roots or list) by recording its result.

  • Prepares the Transfer. Also can act on the Actor or change the TransientProcess if required. Should not set the Actor into the TransientProcess, it is done by caller. The provided default does nothing.

  • Transfers all Root Entities which are recognized as Geom-Topol The result will be a list of Shapes. This method calls user redefinable PrepareTransfer Remark : former result is cleared.

    Parameters (1)
    • theProgress
  • Transfer(num: number, theProgress?: Message_ProgressRange): boolean

    Transfers an Entity given its rank in the Model (Root or not) Returns True if it is recognized as Geom-Topol. (But it can have failed : see IsDone).

    Parameters (2)
    • num
    • theProgress
  • Transfers a list of Entities (only the ones also in the Model) Remark : former result is cleared.

    Parameters (2)
    • list
    • theProgress
  • IsDone(): boolean

    Returns True if the LAST Transfer/TransferRoots was a success.

  • NbShapes(): number

    Returns the count of produced Shapes (roots).

  • Returns the complete list of produced Shapes.

  • Shape(num?: number): TopoDS_Shape

    Returns a Shape given its rank, by default the first one.

    Parameters (1)
    • num
  • Returns a Shape produced from a given entity (if it was individually transferred or if an intermediate result is known). If no Shape is bound with <ent>, returns a Null Shape Warning : Runs on the last call to Transfer,TransferRoots,TransferList.

    Parameters (1)
    • ent
  • Returns a unique Shape for the result :

    • a void Shape (type = SHAPE) if result is empty
    • a simple Shape if result has only one : returns this one
    • a Compound if result has more than one Shape
  • NbTransients(): number

    Returns the count of produced Transient Results (roots).

  • Returns the complete list of produced Transient Results.

  • Returns a Transient Root Result, given its rank (by default the first one).

    Parameters (1)
    • num
  • CheckStatusResult(withprints: boolean): boolean

    Checks the Result of last Transfer (individual or roots, no cumulation on several transfers). Returns True if NO fail occurred during Transfer (queries the TransientProcess).

    Parameters (1)
    • withprints
  • Returns the TransientProcess. It records information about the very last transfer done. Null if no transfer yet done. Can be used for queries more accurate than the default ones.

TransferBRep_ShapeBinder

A ShapeBinder is a BinderOfShape with some additional services to cast the Result under various kinds of Shapes.

Constructors(2)

Static methods(2)

Instance methods(10)

TransferBRep_ShapeListBinder

This binder binds several (a list of) shapes with a starting entity, when this entity itself corresponds to a simple list of shapes. Each part is not seen as a sub-result of an independent component, but as an item of a built-in list.

Constructors(2)

Static methods(2)

Instance methods(19)

TransferBRep_ShapeMapper

Constructors(1)

  • Creates a Mapper with a Value. This Value can then not be changed. It is used by the Hasher to compute the HashCode, which will then be stored for an immediate reading.

    Parameters (1)
    • akey

Static methods(2)

Instance methods(5)

  • Returns the contained value.

  • Equates(other: Transfer_Finder): boolean

    Specific test of equality : defined as False if <other> has not the same true Type, else contents are compared (by C++ operator ==).

    Parameters (1)
    • other
  • Returns the Type of the Value. By default, returns the DynamicType of <me>, but can be redefined.

  • ValueTypeName(): string

    Returns the name of the Type of the Value. Default is name of ValueType, unless it is for a non-handled object.

TransferBRep_TransferResultInfo

Data structure for storing information on transfer result. At the moment it dispatches information for the following types:

  • result,
  • result + warning(s),
  • result + fail(s),
  • result + warning(s) + fail(s)
  • no result,
  • no result + warning(s),
  • no result + fail(s),
  • no result + warning(s) + fail(s),

Constructors(1)

Static methods(2)

Instance methods(10)