Open CASCADE Technology  7.5.0
Public Member Functions | Protected Member Functions

STEPCAFControl_Writer Class Reference

Provides a tool to write DECAF document to the STEP file. Besides transfer of shapes (including assemblies) provided by STEPControl, supports also colors and part names. More...

#include <STEPCAFControl_Writer.hxx>

Public Member Functions

 STEPCAFControl_Writer ()
 Creates a writer with an empty STEP model and sets ColorMode, LayerMode, NameMode and PropsMode to Standard_True. More...
 
 STEPCAFControl_Writer (const Handle< XSControl_WorkSession > &WS, const Standard_Boolean scratch=Standard_True)
 Creates a reader tool and attaches it to an already existing Session Clears the session if it was not yet set for STEP Clears the internal data structures. More...
 
void Init (const Handle< XSControl_WorkSession > &WS, const Standard_Boolean scratch=Standard_True)
 Clears the internal data structures and attaches to a new session Clears the session if it was not yet set for STEP. More...
 
IFSelect_ReturnStatus Write (const Standard_CString filename)
 Writes all the produced models into file In case of multimodel with extern references, filename will be a name of root file, all other files have names of corresponding parts Provided for use like single-file writer. More...
 
Standard_Boolean Transfer (const Handle< TDocStd_Document > &doc, const STEPControl_StepModelType mode=STEPControl_AsIs, const Standard_CString multi=0, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Transfers a document (or single label) to a STEP model The mode of translation of shape is AsIs If multi is not null pointer, it switches to multifile mode (with external refs), and string pointed by <multi> gives prefix for names of extern files (can be empty string) Returns True if translation is OK. More...
 
Standard_Boolean Transfer (const TDF_Label &L, const STEPControl_StepModelType mode=STEPControl_AsIs, const Standard_CString multi=0, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Method to transfer part of the document specified by label. More...
 
Standard_Boolean Perform (const Handle< TDocStd_Document > &doc, const TCollection_AsciiString &filename, const Message_ProgressRange &theProgress=Message_ProgressRange())
 
Standard_Boolean Perform (const Handle< TDocStd_Document > &doc, const Standard_CString filename, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Transfers a document and writes it to a STEP file Returns True if translation is OK. More...
 
const NCollection_DataMap< TCollection_AsciiString, Handle< STEPCAFControl_ExternFile > > & ExternFiles () const
 Returns data on external files Returns Null handle if no external files are read. More...
 
Standard_Boolean ExternFile (const TDF_Label &L, Handle< STEPCAFControl_ExternFile > &ef) const
 Returns data on external file by its original label Returns False if no external file with given name is read. More...
 
Standard_Boolean ExternFile (const Standard_CString name, Handle< STEPCAFControl_ExternFile > &ef) const
 Returns data on external file by its name Returns False if no external file with given name is read. More...
 
STEPControl_WriterChangeWriter ()
 Returns basic reader for root file. More...
 
const STEPControl_WriterWriter () const
 Returns basic reader as const. More...
 
void SetColorMode (const Standard_Boolean colormode)
 Set ColorMode for indicate write Colors or not. More...
 
Standard_Boolean GetColorMode () const
 
void SetNameMode (const Standard_Boolean namemode)
 Set NameMode for indicate write Name or not. More...
 
Standard_Boolean GetNameMode () const
 
void SetLayerMode (const Standard_Boolean layermode)
 Set LayerMode for indicate write Layers or not. More...
 
Standard_Boolean GetLayerMode () const
 
void SetPropsMode (const Standard_Boolean propsmode)
 PropsMode for indicate write Validation properties or not. More...
 
Standard_Boolean GetPropsMode () const
 
void SetSHUOMode (const Standard_Boolean shuomode)
 Set SHUO mode for indicate write SHUO or not. More...
 
Standard_Boolean GetSHUOMode () const
 
void SetDimTolMode (const Standard_Boolean dimtolmode)
 Set dimtolmode for indicate write D&GTs or not. More...
 
Standard_Boolean GetDimTolMode () const
 
void SetMaterialMode (const Standard_Boolean matmode)
 Set dimtolmode for indicate write D&GTs or not. More...
 
Standard_Boolean GetMaterialMode () const
 

Protected Member Functions

Standard_Boolean Transfer (const TDF_LabelSequence &L, const STEPControl_StepModelType mode=STEPControl_AsIs, const Standard_CString multi=0, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Mehod to writing sequence of root assemblies or part of the file specified by use by one label. More...
 
Standard_Boolean Transfer (STEPControl_Writer &wr, const TDF_LabelSequence &labels, const STEPControl_StepModelType mode=STEPControl_AsIs, const Standard_CString multi=0, const Standard_Boolean isExternFile=Standard_False, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Transfers labels to a STEP model Returns True if translation is OK isExternFile setting from TransferExternFiles method. More...
 
TopoDS_Shape TransferExternFiles (const TDF_Label &L, const STEPControl_StepModelType mode, TDF_LabelSequence &Lseq, const Standard_CString prefix="", const Message_ProgressRange &theProgress=Message_ProgressRange())
 Parses assembly structure of label L, writes all the simple shapes each to its own file named by name of its label plus prefix Returns shape representing that assembly structure in the form of nested empty compounds (and a sequence of labels which are newly written nodes of this assembly) More...
 
Standard_Boolean WriteExternRefs (const Handle< XSControl_WorkSession > &WS, const TDF_LabelSequence &labels) const
 Write external references to STEP. More...
 
Standard_Boolean WriteColors (const Handle< XSControl_WorkSession > &WS, const TDF_LabelSequence &labels)
 Write colors assigned to specified labels, to STEP model. More...
 
Standard_Boolean WriteNames (const Handle< XSControl_WorkSession > &WS, const TDF_LabelSequence &labels) const
 Write names assigned to specified labels, to STEP model. More...
 
Standard_Boolean WriteDGTs (const Handle< XSControl_WorkSession > &WS, const TDF_LabelSequence &labels) const
 Write D&GTs assigned to specified labels, to STEP model. More...
 
Standard_Boolean WriteDGTsAP242 (const Handle< XSControl_WorkSession > &WS, const TDF_LabelSequence &labels)
 Write D&GTs assigned to specified labels, to STEP model, according AP242. More...
 
Standard_Boolean WriteMaterials (const Handle< XSControl_WorkSession > &WS, const TDF_LabelSequence &labels) const
 Write materials assigned to specified labels, to STEP model. More...
 
Standard_Boolean WriteValProps (const Handle< XSControl_WorkSession > &WS, const TDF_LabelSequence &labels, const Standard_CString multi) const
 Write validation properties assigned to specified labels, to STEP model. More...
 
Standard_Boolean WriteLayers (const Handle< XSControl_WorkSession > &WS, const TDF_LabelSequence &labels) const
 Write layers assigned to specified labels, to STEP model. More...
 
Standard_Boolean WriteSHUOs (const Handle< XSControl_WorkSession > &WS, const TDF_LabelSequence &labels)
 Write SHUO assigned to specified component, to STEP model. More...
 

Detailed Description

Provides a tool to write DECAF document to the STEP file. Besides transfer of shapes (including assemblies) provided by STEPControl, supports also colors and part names.

Also supports multifile writing

Constructor & Destructor Documentation

◆ STEPCAFControl_Writer() [1/2]

STEPCAFControl_Writer::STEPCAFControl_Writer ( )

Creates a writer with an empty STEP model and sets ColorMode, LayerMode, NameMode and PropsMode to Standard_True.

◆ STEPCAFControl_Writer() [2/2]

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

Creates a reader tool and attaches it to an already existing Session Clears the session if it was not yet set for STEP Clears the internal data structures.

Member Function Documentation

◆ ChangeWriter()

STEPControl_Writer& STEPCAFControl_Writer::ChangeWriter ( )

Returns basic reader for root file.

◆ ExternFile() [1/2]

Standard_Boolean STEPCAFControl_Writer::ExternFile ( const TDF_Label L,
Handle< STEPCAFControl_ExternFile > &  ef 
) const

Returns data on external file by its original label Returns False if no external file with given name is read.

◆ ExternFile() [2/2]

Standard_Boolean STEPCAFControl_Writer::ExternFile ( const Standard_CString  name,
Handle< STEPCAFControl_ExternFile > &  ef 
) const

Returns data on external file by its name Returns False if no external file with given name is read.

◆ ExternFiles()

const NCollection_DataMap<TCollection_AsciiString, Handle< STEPCAFControl_ExternFile > >& STEPCAFControl_Writer::ExternFiles ( ) const

Returns data on external files Returns Null handle if no external files are read.

◆ GetColorMode()

Standard_Boolean STEPCAFControl_Writer::GetColorMode ( ) const

◆ GetDimTolMode()

Standard_Boolean STEPCAFControl_Writer::GetDimTolMode ( ) const

◆ GetLayerMode()

Standard_Boolean STEPCAFControl_Writer::GetLayerMode ( ) const

◆ GetMaterialMode()

Standard_Boolean STEPCAFControl_Writer::GetMaterialMode ( ) const

◆ GetNameMode()

Standard_Boolean STEPCAFControl_Writer::GetNameMode ( ) const

◆ GetPropsMode()

Standard_Boolean STEPCAFControl_Writer::GetPropsMode ( ) const

◆ GetSHUOMode()

Standard_Boolean STEPCAFControl_Writer::GetSHUOMode ( ) const

◆ Init()

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

Clears the internal data structures and attaches to a new session Clears the session if it was not yet set for STEP.

◆ Perform() [1/2]

Standard_Boolean STEPCAFControl_Writer::Perform ( const Handle< TDocStd_Document > &  doc,
const TCollection_AsciiString filename,
const Message_ProgressRange theProgress = Message_ProgressRange() 
)

◆ Perform() [2/2]

Standard_Boolean STEPCAFControl_Writer::Perform ( const Handle< TDocStd_Document > &  doc,
const Standard_CString  filename,
const Message_ProgressRange theProgress = Message_ProgressRange() 
)

Transfers a document and writes it to a STEP file Returns True if translation is OK.

◆ SetColorMode()

void STEPCAFControl_Writer::SetColorMode ( const Standard_Boolean  colormode)

Set ColorMode for indicate write Colors or not.

◆ SetDimTolMode()

void STEPCAFControl_Writer::SetDimTolMode ( const Standard_Boolean  dimtolmode)

Set dimtolmode for indicate write D&GTs or not.

◆ SetLayerMode()

void STEPCAFControl_Writer::SetLayerMode ( const Standard_Boolean  layermode)

Set LayerMode for indicate write Layers or not.

◆ SetMaterialMode()

void STEPCAFControl_Writer::SetMaterialMode ( const Standard_Boolean  matmode)

Set dimtolmode for indicate write D&GTs or not.

◆ SetNameMode()

void STEPCAFControl_Writer::SetNameMode ( const Standard_Boolean  namemode)

Set NameMode for indicate write Name or not.

◆ SetPropsMode()

void STEPCAFControl_Writer::SetPropsMode ( const Standard_Boolean  propsmode)

PropsMode for indicate write Validation properties or not.

◆ SetSHUOMode()

void STEPCAFControl_Writer::SetSHUOMode ( const Standard_Boolean  shuomode)

Set SHUO mode for indicate write SHUO or not.

◆ Transfer() [1/4]

Standard_Boolean STEPCAFControl_Writer::Transfer ( const Handle< TDocStd_Document > &  doc,
const STEPControl_StepModelType  mode = STEPControl_AsIs,
const Standard_CString  multi = 0,
const Message_ProgressRange theProgress = Message_ProgressRange() 
)

Transfers a document (or single label) to a STEP model The mode of translation of shape is AsIs If multi is not null pointer, it switches to multifile mode (with external refs), and string pointed by <multi> gives prefix for names of extern files (can be empty string) Returns True if translation is OK.

◆ Transfer() [2/4]

Standard_Boolean STEPCAFControl_Writer::Transfer ( const TDF_Label L,
const STEPControl_StepModelType  mode = STEPControl_AsIs,
const Standard_CString  multi = 0,
const Message_ProgressRange theProgress = Message_ProgressRange() 
)

Method to transfer part of the document specified by label.

◆ Transfer() [3/4]

Standard_Boolean STEPCAFControl_Writer::Transfer ( const TDF_LabelSequence L,
const STEPControl_StepModelType  mode = STEPControl_AsIs,
const Standard_CString  multi = 0,
const Message_ProgressRange theProgress = Message_ProgressRange() 
)
protected

Mehod to writing sequence of root assemblies or part of the file specified by use by one label.

◆ Transfer() [4/4]

Standard_Boolean STEPCAFControl_Writer::Transfer ( STEPControl_Writer wr,
const TDF_LabelSequence labels,
const STEPControl_StepModelType  mode = STEPControl_AsIs,
const Standard_CString  multi = 0,
const Standard_Boolean  isExternFile = Standard_False,
const Message_ProgressRange theProgress = Message_ProgressRange() 
)
protected

Transfers labels to a STEP model Returns True if translation is OK isExternFile setting from TransferExternFiles method.

◆ TransferExternFiles()

TopoDS_Shape STEPCAFControl_Writer::TransferExternFiles ( const TDF_Label L,
const STEPControl_StepModelType  mode,
TDF_LabelSequence Lseq,
const Standard_CString  prefix = "",
const Message_ProgressRange theProgress = Message_ProgressRange() 
)
protected

Parses assembly structure of label L, writes all the simple shapes each to its own file named by name of its label plus prefix Returns shape representing that assembly structure in the form of nested empty compounds (and a sequence of labels which are newly written nodes of this assembly)

◆ Write()

IFSelect_ReturnStatus STEPCAFControl_Writer::Write ( const Standard_CString  filename)

Writes all the produced models into file In case of multimodel with extern references, filename will be a name of root file, all other files have names of corresponding parts Provided for use like single-file writer.

◆ WriteColors()

Standard_Boolean STEPCAFControl_Writer::WriteColors ( const Handle< XSControl_WorkSession > &  WS,
const TDF_LabelSequence labels 
)
protected

Write colors assigned to specified labels, to STEP model.

◆ WriteDGTs()

Standard_Boolean STEPCAFControl_Writer::WriteDGTs ( const Handle< XSControl_WorkSession > &  WS,
const TDF_LabelSequence labels 
) const
protected

Write D&GTs assigned to specified labels, to STEP model.

◆ WriteDGTsAP242()

Standard_Boolean STEPCAFControl_Writer::WriteDGTsAP242 ( const Handle< XSControl_WorkSession > &  WS,
const TDF_LabelSequence labels 
)
protected

Write D&GTs assigned to specified labels, to STEP model, according AP242.

◆ WriteExternRefs()

Standard_Boolean STEPCAFControl_Writer::WriteExternRefs ( const Handle< XSControl_WorkSession > &  WS,
const TDF_LabelSequence labels 
) const
protected

Write external references to STEP.

◆ WriteLayers()

Standard_Boolean STEPCAFControl_Writer::WriteLayers ( const Handle< XSControl_WorkSession > &  WS,
const TDF_LabelSequence labels 
) const
protected

Write layers assigned to specified labels, to STEP model.

◆ WriteMaterials()

Standard_Boolean STEPCAFControl_Writer::WriteMaterials ( const Handle< XSControl_WorkSession > &  WS,
const TDF_LabelSequence labels 
) const
protected

Write materials assigned to specified labels, to STEP model.

◆ WriteNames()

Standard_Boolean STEPCAFControl_Writer::WriteNames ( const Handle< XSControl_WorkSession > &  WS,
const TDF_LabelSequence labels 
) const
protected

Write names assigned to specified labels, to STEP model.

◆ Writer()

const STEPControl_Writer& STEPCAFControl_Writer::Writer ( ) const

Returns basic reader as const.

◆ WriteSHUOs()

Standard_Boolean STEPCAFControl_Writer::WriteSHUOs ( const Handle< XSControl_WorkSession > &  WS,
const TDF_LabelSequence labels 
)
protected

Write SHUO assigned to specified component, to STEP model.

◆ WriteValProps()

Standard_Boolean STEPCAFControl_Writer::WriteValProps ( const Handle< XSControl_WorkSession > &  WS,
const TDF_LabelSequence labels,
const Standard_CString  multi 
) const
protected

Write validation properties assigned to specified labels, to STEP model.


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