STEPControl
OCCT package STEPControl: STEPControl_ActorRead, STEPControl_ActorWrite, STEPControl_Controller, STEPControl_Reader, and 2 more bound classes.
STEPControl_ActorRead
This class performs the transfer of an Entity from AP214 and AP203, either Geometric or Topologic.
I.E. for each type of Entity, it invokes the appropriate Tool then returns the Binder which contains the Result
Constructors(1)
- constructor(theModel: Interface_InterfaceModel): STEPControl_ActorReadParameters (1)
theModel
Static methods(2)
- get_type_name(): string
Instance methods(9)
- Recognize(start: Standard_Transient): boolean
Prerequisite for Transfer : the method Transfer is called on a starting object only if Recognize has returned True on it This allows to define a list of Actors, each one processing a definite kind of data TransferProcess calls Recognize on each one before calling Transfer. But even if Recognize has returned True, Transfer can reject by returning a Null Binder (afterwards rejection), the next actor is then invoked.
The provided default returns True, can be redefinedParameters (1)start
- Transfer(start: Standard_Transient, TP: Transfer_TransientProcess, theProgress?: Message_ProgressRange): Transfer_BinderParameters (3)
startTPtheProgress
- TransferShape(start: Standard_Transient, TP: Transfer_TransientProcess, theLocalFactors?: StepData_Factors, isManifold?: boolean, theUseTrsf?: boolean, theProgress?: Message_ProgressRange): Transfer_Binder
theUseTrsf - special flag for using Axis2Placement from ShapeRepresentation for transform root shape
Parameters (6)startTPtheLocalFactorsisManifoldtheUseTrsftheProgress
- PrepareUnits(rep: StepRepr_Representation, TP: Transfer_TransientProcess, theLocalFactors: StepData_Factors): void
set units and tolerances context by given ShapeRepresentation
Parameters (3)repTPtheLocalFactors—Mutated in place; read the updated value from this argument after the call.
- ResetUnits(theModel: StepData_StepModel, theLocalFactors: StepData_Factors): void
reset units and tolerances context to default (mm, radians, read.precision.val, etc.)
Parameters (2)theModeltheLocalFactors—Mutated in place; read the updated value from this argument after the call.
- SetModel(theModel: Interface_InterfaceModel): void
Set model.
Parameters (1)theModel
- ComputeTransformation(Origin: StepGeom_Axis2Placement3d, Target: StepGeom_Axis2Placement3d, OrigContext: StepRepr_Representation, TargContext: StepRepr_Representation, TP: Transfer_TransientProcess, Trsf: gp_Trsf, theLocalFactors: StepData_Factors): boolean
Computes transformation defined by two axis placements (in MAPPED_ITEM or ITEM_DEFINED_TRANSFORMATION) taking into account their representation contexts (i.e. units, which may be different) Returns True if transformation is computed and is not an identity.
Parameters (7)OriginTargetOrigContextTargContextTPTrsf—Mutated in place; read the updated value from this argument after the call.theLocalFactors
- ComputeSRRWT(SRR: StepRepr_RepresentationRelationship, TP: Transfer_TransientProcess, Trsf: gp_Trsf, theLocalFactors: StepData_Factors): boolean
Computes transformation defined by given REPRESENTATION_RELATIONSHIP_WITH_TRANSFORMATION.
Parameters (4)SRRTPTrsf—Mutated in place; read the updated value from this argument after the call.theLocalFactors
STEPControl_ActorWrite
This class performs the transfer of a Shape from TopoDS to AP203 or AP214 (CD2 or DIS).
Constructors(1)
Static methods(2)
- get_type_name(): string
Instance methods(12)
- Recognize(start: Transfer_Finder): boolean
Prerequisite for Transfer : the method Transfer is called on a starting object only if Recognize has returned True on it This allows to define a list of Actors, each one processing a definite kind of data TransferProcess calls Recognize on each one before calling Transfer. But even if Recognize has returned True, Transfer can reject by returning a Null Binder (afterwards rejection), the next actor is then invoked.
The provided default returns True, can be redefinedParameters (1)start
- Transfer(start: Transfer_Finder, TP: Transfer_FinderProcess, theProgress?: Message_ProgressRange): Transfer_BinderParameters (3)
startTPtheProgress
- TransferSubShape(start: Transfer_Finder, SDR: StepShape_ShapeDefinitionRepresentation, FP: Transfer_FinderProcess, theLocalFactors: StepData_Factors, shapeGroup: NCollection_HSequence_TopoDS_Shape, isManifold: boolean, theProgress: Message_ProgressRange): { returnValue: Transfer_Binder; AX1: StepGeom_GeometricRepresentationItem; [Symbol.dispose](): void }Parameters (7)
startSDRFPtheLocalFactorsshapeGroupisManifoldtheProgress
- TransferShape(start: Transfer_Finder, SDR: StepShape_ShapeDefinitionRepresentation, FP: Transfer_FinderProcess, theLocalFactors?: StepData_Factors, shapeGroup?: NCollection_HSequence_TopoDS_Shape, isManifold?: boolean, theProgress?: Message_ProgressRange): Transfer_BinderParameters (7)
startSDRFPtheLocalFactorsshapeGroupisManifoldtheProgress
- TransferCompound(start: Transfer_Finder, SDR: StepShape_ShapeDefinitionRepresentation, FP: Transfer_FinderProcess, theLocalFactors?: StepData_Factors, theProgress?: Message_ProgressRange): Transfer_BinderParameters (5)
startSDRFPtheLocalFactorstheProgress
- SetMode(M: STEPControl_StepModelType): voidParameters (1)
M
- SetGroupMode(mode: number): voidParameters (1)
mode
- GroupMode(): number
- SetTolerance(Tol: number): voidParameters (1)
Tol
- IsAssembly(theModel: StepData_StepModel, S: TopoDS_Shape): boolean
Customizable method to check whether shape S should be written as assembly or not Default implementation uses flag GroupMode and analyses the shape itself NOTE: this method can modify shape.
Parameters (2)theModelS—Mutated in place; read the updated value from this argument after the call.
STEPControl_Controller
defines basic controller for STEP processor
Constructors(1)
Initializes the use of STEP Norm (the first time) and returns a Controller.
Static methods(3)
- Init(): boolean
StandardInitialisation. It creates a Controller for STEP and records it to various names, available to select it later Returns True when done, False if could not be done. - get_type_name(): string
Instance methods(5)
Creates a new empty Model ready to receive data of the Norm. It is taken from STEP Template Model.
Returns the Actor for Read attached to the pair (norm,appli).
Parameters (1)model
- Customise(): { WS: XSControl_WorkSession; [Symbol.dispose](): void }
Customises a WorkSession, by adding to it the recorded items (by AddSessionItem).
ReturnsA result object with fields:
WS: owned by the returned envelope.
Dispose the returned envelope to release owned Handle fields.
- TransferWriteShape(shape: TopoDS_Shape, FP: Transfer_FinderProcess, model: Interface_InterfaceModel, modetrans?: number, theProgress?: Message_ProgressRange): IFSelect_ReturnStatus
Takes one Shape and transfers it to the InterfaceModel (already created by NewModel for instance) <modeshape> is to be interpreted by each kind of XstepAdaptor Returns a status : 0 OK 1 No result 2 Fail -1 bad modeshape -2 bad model (requires a StepModel) modeshape : 1 Facetted BRep, 2 Shell, 3 Manifold Solid.
Parameters (5)shapeFPmodelmodetranstheProgress
STEPControl_Reader
Reads STEP files, checks them and translates their contents into Open CASCADE models. The STEP data can be that of a whole model or that of a specific list of entities in the model. As in XSControl_Reader, you specify the list using a selection.
For the translation of iges files it is possible to use next sequence: To change translation parameters class Interface_Static should be used before beginning of translation (see STEP Parameters and General Parameters) Creation of reader - STEPControl_Reader reader; To load s file in a model use method reader.ReadFile("filename.stp") To print load results reader.PrintCheckLoad(failsonly,mode) where mode is equal to the value of enumeration IFSelect_PrintCount For definition number of candidates : int nbroots = reader. NbRootsForTransfer(); To transfer entities from a model the following methods can be used: for the whole model - reader.TransferRoots(); to transfer a list of entities: reader.TransferList(list); to transfer one entity occ::handle<Standard_Transient> ent = reader.RootForTransfer(num); reader.TransferEntity(ent), or reader.TransferOneRoot(num), or reader.TransferOne(num), or reader.TransferRoot(num) To
obtain the result the following method can be used: reader.NbShapes() and reader.Shape(num); or reader.OneShape(); To print the results of transfer use method: reader.PrintCheckTransfer(failwarn,mode); where printfail is equal to the value of enumeration IFSelect_PrintFail, mode see above; or reader.PrintStatsTransfer(); Gets correspondence between a STEP entity and a result shape obtained from it. occ::handle<XSControl_WorkSession> WS = reader.WS(); if ( WS->TransferReader()->HasResult(ent) ) TopoDS_Shape shape = WS->TransferReader()->ShapeResult(ent);.
Constructors(2)
Creates a reader object with an empty STEP model.
- constructor(WS: XSControl_WorkSession, scratch?: boolean): STEPControl_Reader
Creates a Reader for STEP from an already existing Session Clears the session if it was not yet set for STEP.
Parameters (2)WSscratch
Instance methods(6)
- ReadFile(filename: string): IFSelect_ReturnStatus
Loads a file and returns the read status Zero for a Model which compies with the Controller.
Parameters (1)filename
- TransferRoot(num?: number, theProgress?: Message_ProgressRange): boolean
Transfers a root given its rank in the list of candidate roots Default is the first one Returns True if a shape has resulted, false else Same as inherited TransferOneRoot, kept for compatibility.
Parameters (2)numtheProgress
- NbRootsForTransfer(): number
Determines the list of root entities from Model which are candidate for a transfer to a Shape (type of entities is PRODUCT).
- FileUnits(theUnitLengthNames: NCollection_Sequence_TCollection_AsciiString, theUnitAngleNames: NCollection_Sequence_TCollection_AsciiString, theUnitSolidAngleNames: NCollection_Sequence_TCollection_AsciiString): void
Returns sequence of all unit names for shape representations found in file.
Parameters (3)theUnitLengthNames—Mutated in place; read the updated value from this argument after the call.theUnitAngleNames—Mutated in place; read the updated value from this argument after the call.theUnitSolidAngleNames—Mutated in place; read the updated value from this argument after the call.
- SetSystemLengthUnit(theLengthUnit: number): void
Sets system length unit used by transfer process. Performs only if a model is not NULL.
Parameters (1)theLengthUnit
- SystemLengthUnit(): number
Returns system length unit used by transfer process. Performs only if a model is not NULL.
STEPControl_StepModelType
Properties(8)
STEPControl_Writer
This class creates and writes STEP files from Open CASCADE models. A STEP file can be written to an existing STEP file or to a new one. Translation can be performed in one or several operations. Each translation operation outputs a distinct root entity in the STEP file.
Constructors(2)
Creates a Writer from scratch.
- constructor(WS: XSControl_WorkSession, scratch?: boolean): STEPControl_Writer
Creates a Writer from an already existing Session If <scratch> is True (D), clears already recorded data.
Parameters (2)WSscratch
Instance methods(12)
- UnsetTolerance(): void
Unsets the tolerance formerly forced by SetTolerance.
- SetWS(WS: XSControl_WorkSession, scratch?: boolean): void
Sets a specific session to <me>.
Parameters (2)WSscratch
Returns the session used in <me>.
- Model(newone?: boolean): StepData_StepModel
Returns the produced model. Produces a new one if not yet done or if <newone> is True This method allows for instance to edit product or header data before writing.
Parameters (1)newone
- Transfer(sh: TopoDS_Shape, mode: STEPControl_StepModelType, compgraph: boolean, theProgress: Message_ProgressRange): IFSelect_ReturnStatus
Translates shape sh to a STEP entity. mode defines the STEP entity type to be output:
- STEPControlStd_AsIs translates a shape to its highest possible STEP representation.
- STEPControlStd_ManifoldSolidBrep translates a shape to a STEP manifold_solid_brep or brep_with_voids entity.
- STEPControlStd_FacetedBrep translates a shape into a STEP faceted_brep entity.
- STEPControlStd_ShellBasedSurfaceModel translates a shape into a STEP shell_based_surface_model entity.
- STEPControlStd_GeometricCurveSet translates a shape into a STEP geometric_curve_set entity.
Parameters (4)shmodecompgraphtheProgress
- Write(theFileName: string): IFSelect_ReturnStatus
Writes a STEP model in the file identified by filename.
Parameters (1)theFileName
- PrintStatsTransfer(what: number, mode?: number): void
Displays the statistics for the last translation. what defines the kind of statistics that are displayed:
- 0 gives general statistics (number of translated roots, number of warnings, number of fail messages),
- 1 gives root results,
- 2 gives statistics for all checked entities,
- 3 gives the list of translated entities,
- 4 gives warning and fail messages,
- 5 gives fail messages only. mode is used according to the use of what. If what is 0, mode is ignored. If what is 1, 2 or 3, mode defines the following:
- 0 lists the numbers of STEP entities in a STEP model,
- 1 gives the number, identifier, type and result type for each STEP entity and/or its status (fail, warning, etc.),
- 2 gives maximum information for each STEP entity (i.e. checks),
- 3 gives the number of entities by the type of a STEP entity,
- 4 gives the number of of STEP entities per result type and/or status,
- 5 gives the number of pairs (STEP or result type and status),
- 6 gives the number of pairs (STEP or result type and status) AND the list of entity numbers in the STEP model.
Parameters (2)whatmode
- CleanDuplicateEntities(): void
- SetShapeFixParameters(theParameters: NCollection_DataMap_TCollection_AsciiString_TCollection_AsciiString): void
Sets parameters for shape processing.
Parameters (1)theParameters—the parameters for shape processing.
Returns parameters for shape processing that was set by SetParameters() method.
Returnsthe parameters for shape processing. Empty map if no parameters were set.
- SetShapeProcessFlags(theFlags: any): void
Sets flags defining operations to be performed on shapes.
Parameters (1)theFlags—The flags defining operations to be performed on shapes.
- GetShapeProcessFlags(): [any, boolean]
Returns flags defining operations to be performed on shapes.
ReturnsPair of values defining operations to be performed on shapes and a boolean value that indicates whether the flags were set.