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)
normal standard constructor, creates an empty BinderOfShape
constructor which in the same time defines the result Returns True if a starting object is bound with SEVERAL results : Here, returns always False But it can have next results
Parameters (1)res
Static methods(2)
- get_type_name(): string
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).
- SetResult(res: TopoDS_Shape): void
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)
- SetProtocol(protocol: Interface_Protocol): void
Records the protocol to be used for read and transfer roots.
Parameters (1)protocol
Returns the recorded Protocol.
- SetActor(actor: Transfer_ActorOfTransientProcess): void
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 createdParameters (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).
- SetModel(model: Interface_InterfaceModel): void
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.
- PrepareTransfer(): void
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.
- TransferRoots(theProgress?: Message_ProgressRange): void
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)numtheProgress
- TransferList(list: NCollection_HSequence_handle_Standard_Transient, theProgress?: Message_ProgressRange): void
Transfers a list of Entities (only the ones also in the Model) Remark : former result is cleared.
Parameters (2)listtheProgress
- 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.
- Transient(num?: number): Standard_Transient
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)
Creates an empty ShapeBinder.
Creates a ShapeBinder with a result.
Parameters (1)res
Static methods(2)
- get_type_name(): string
Instance methods(10)
Returns the Type of the Shape Result (under
TopAbsform).- Edge(): TopoDS_Edge
- Wire(): TopoDS_Wire
- Face(): TopoDS_Face
TransferBRep_ShapeInfo
Gives information on an object, see template DataInfo This class is for Shape.
Constructors(1)
Static methods(2)
- Type(ent: TopoDS_Shape): Standard_Type
Returns the Type attached to an object Here, TShape (Shape has no Dynamic Type).
Parameters (1)ent
- TypeName(ent: TopoDS_Shape): string
Returns Type Name (string) Here, the true name of the Type of a Shape.
Parameters (1)ent
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)
- Parameters (1)
list
Static methods(2)
- get_type_name(): string
Instance methods(19)
- IsMultiple(): boolean
Returns True if a Binder has several results, either by itself or because it has next results Can be defined by sub-classes.
Returns the Type which characterizes the Result (if known).
- ResultTypeName(): string
Returns the Name of the Type which characterizes the Result Can be returned even if ResultType itself is unknown.
- AddResult(res: TopoDS_Shape): void
Adds an item to the result list.
Parameters (1)res
- AddResult(next: Transfer_Binder): void
Adds an item to the result list.
Parameters (1)next
- SetResult(num: number, res: TopoDS_Shape): void
Changes an already defined sub-result.
Parameters (2)numres
- NbShapes(): number
- Shape(num: number): TopoDS_ShapeParameters (1)
num
- ShapeType(num: number): TopAbs_ShapeEnumParameters (1)
num
- Vertex(num: number): TopoDS_VertexParameters (1)
num
- Edge(num: number): TopoDS_EdgeParameters (1)
num
- Wire(num: number): TopoDS_WireParameters (1)
num
- Face(num: number): TopoDS_FaceParameters (1)
num
- Shell(num: number): TopoDS_ShellParameters (1)
num
- Solid(num: number): TopoDS_SolidParameters (1)
num
- CompSolid(num: number): TopoDS_CompSolidParameters (1)
num
- Compound(num: number): TopoDS_CompoundParameters (1)
num
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)
- get_type_name(): string
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)
Creates object with all fields nullified.
Static methods(2)
- get_type_name(): string
Instance methods(10)
- Clear(): void
Resets all the fields.
- Result(): number
- ResultWarning(): number
- ResultFail(): number
- ResultWarningFail(): number
- NoResult(): number
- NoResultWarning(): number
- NoResultFail(): number
- NoResultWarningFail(): number