Open CASCADE Technology 7.9.0
STEPControl_Writer Class Reference

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. More...

#include <STEPControl_Writer.hxx>

Public Member Functions

 STEPControl_Writer ()
 Creates a Writer from scratch.
 
 STEPControl_Writer (const Handle< XSControl_WorkSession > &WS, const Standard_Boolean scratch=Standard_True)
 Creates a Writer from an already existing Session If <scratch> is True (D), clears already recorded data.
 
void SetTolerance (const Standard_Real Tol)
 Sets a length-measure value that will be written to uncertainty-measure-with-unit when the next shape is translated.
 
void UnsetTolerance ()
 Unsets the tolerance formerly forced by SetTolerance.
 
void SetWS (const Handle< XSControl_WorkSession > &WS, const Standard_Boolean scratch=Standard_True)
 Sets a specific session to <me>
 
Handle< XSControl_WorkSessionWS () const
 Returns the session used in <me>
 
Handle< StepData_StepModelModel (const Standard_Boolean newone=Standard_False)
 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.
 
IFSelect_ReturnStatus Transfer (const TopoDS_Shape &sh, const STEPControl_StepModelType mode, const Standard_Boolean compgraph=Standard_True, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Translates shape sh to a STEP entity. mode defines the STEP entity type to be output:
 
IFSelect_ReturnStatus Transfer (const TopoDS_Shape &sh, const STEPControl_StepModelType mode, const DESTEP_Parameters &theParams, const Standard_Boolean compgraph=Standard_True, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Translates shape sh to a STEP entity.
 
IFSelect_ReturnStatus Write (const Standard_CString theFileName)
 Writes a STEP model in the file identified by filename.
 
IFSelect_ReturnStatus WriteStream (std::ostream &theOStream)
 Writes a STEP model in the std::ostream.
 
void PrintStatsTransfer (const Standard_Integer what, const Standard_Integer mode=0) const
 Displays the statistics for the last translation. what defines the kind of statistics that are displayed:
 
void SetShapeFixParameters (const XSAlgo_ShapeProcessor::ParameterMap &theParameters)
 Sets parameters for shape processing.
 
void SetShapeFixParameters (XSAlgo_ShapeProcessor::ParameterMap &&theParameters)
 Sets parameters for shape processing. Parameters are moved from the input map.
 
void SetShapeFixParameters (const DE_ShapeFixParameters &theParameters, const XSAlgo_ShapeProcessor::ParameterMap &theAdditionalParameters={})
 Sets parameters for shape processing. Parameters from theParameters are copied to the internal map. Parameters from theAdditionalParameters are copied to the internal map if they are not present in theParameters.
 
const XSAlgo_ShapeProcessor::ParameterMapGetShapeFixParameters () const
 Returns parameters for shape processing that was set by SetParameters() method.
 
void SetShapeProcessFlags (const ShapeProcess::OperationsFlags &theFlags)
 Sets flags defining operations to be performed on shapes.
 
const XSAlgo_ShapeProcessor::ProcessingFlagsGetShapeProcessFlags () const
 Returns flags defining operations to be performed on shapes.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ STEPControl_Writer() [1/2]

STEPControl_Writer::STEPControl_Writer ( )

Creates a Writer from scratch.

◆ STEPControl_Writer() [2/2]

STEPControl_Writer::STEPControl_Writer ( const Handle< XSControl_WorkSession > & WS,
const Standard_Boolean scratch = Standard_True )

Creates a Writer from an already existing Session If <scratch> is True (D), clears already recorded data.

Member Function Documentation

◆ GetShapeFixParameters()

const XSAlgo_ShapeProcessor::ParameterMap & STEPControl_Writer::GetShapeFixParameters ( ) const

Returns parameters for shape processing that was set by SetParameters() method.

Returns
the parameters for shape processing. Empty map if no parameters were set.

◆ GetShapeProcessFlags()

const XSAlgo_ShapeProcessor::ProcessingFlags & STEPControl_Writer::GetShapeProcessFlags ( ) const

Returns flags defining operations to be performed on shapes.

Returns
Pair of values defining operations to be performed on shapes and a boolean value that indicates whether the flags were set.

◆ Model()

Handle< StepData_StepModel > STEPControl_Writer::Model ( const Standard_Boolean newone = Standard_False)

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.

◆ PrintStatsTransfer()

void STEPControl_Writer::PrintStatsTransfer ( const Standard_Integer what,
const Standard_Integer mode = 0 ) const

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.

◆ SetShapeFixParameters() [1/3]

void STEPControl_Writer::SetShapeFixParameters ( const DE_ShapeFixParameters & theParameters,
const XSAlgo_ShapeProcessor::ParameterMap & theAdditionalParameters = {} )

Sets parameters for shape processing. Parameters from theParameters are copied to the internal map. Parameters from theAdditionalParameters are copied to the internal map if they are not present in theParameters.

Parameters
theParametersthe parameters for shape processing.
theAdditionalParametersthe additional parameters for shape processing.

◆ SetShapeFixParameters() [2/3]

void STEPControl_Writer::SetShapeFixParameters ( const XSAlgo_ShapeProcessor::ParameterMap & theParameters)

Sets parameters for shape processing.

Parameters
theParametersthe parameters for shape processing.

◆ SetShapeFixParameters() [3/3]

void STEPControl_Writer::SetShapeFixParameters ( XSAlgo_ShapeProcessor::ParameterMap && theParameters)

Sets parameters for shape processing. Parameters are moved from the input map.

Parameters
theParametersthe parameters for shape processing.

◆ SetShapeProcessFlags()

void STEPControl_Writer::SetShapeProcessFlags ( const ShapeProcess::OperationsFlags & theFlags)

Sets flags defining operations to be performed on shapes.

Parameters
theFlagsThe flags defining operations to be performed on shapes.

◆ SetTolerance()

void STEPControl_Writer::SetTolerance ( const Standard_Real Tol)

Sets a length-measure value that will be written to uncertainty-measure-with-unit when the next shape is translated.

◆ SetWS()

void STEPControl_Writer::SetWS ( const Handle< XSControl_WorkSession > & WS,
const Standard_Boolean scratch = Standard_True )

Sets a specific session to <me>

◆ Transfer() [1/2]

IFSelect_ReturnStatus STEPControl_Writer::Transfer ( const TopoDS_Shape & sh,
const STEPControl_StepModelType mode,
const DESTEP_Parameters & theParams,
const Standard_Boolean compgraph = Standard_True,
const Message_ProgressRange & theProgress = Message_ProgressRange() )

Translates shape sh to a STEP entity.

◆ Transfer() [2/2]

IFSelect_ReturnStatus STEPControl_Writer::Transfer ( const TopoDS_Shape & sh,
const STEPControl_StepModelType mode,
const Standard_Boolean compgraph = Standard_True,
const Message_ProgressRange & theProgress = Message_ProgressRange() )

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.

◆ UnsetTolerance()

void STEPControl_Writer::UnsetTolerance ( )

Unsets the tolerance formerly forced by SetTolerance.

◆ Write()

IFSelect_ReturnStatus STEPControl_Writer::Write ( const Standard_CString theFileName)

Writes a STEP model in the file identified by filename.

◆ WriteStream()

IFSelect_ReturnStatus STEPControl_Writer::WriteStream ( std::ostream & theOStream)

Writes a STEP model in the std::ostream.

◆ WS()

Handle< XSControl_WorkSession > STEPControl_Writer::WS ( ) const

Returns the session used in <me>


The documentation for this class was generated from the following file: