Open CASCADE Technology 7.8.0
|
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. | |
STEPCAFControl_Writer (const Handle< XSControl_WorkSession > &theWS, const Standard_Boolean theScratch=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. | |
void | Init (const Handle< XSControl_WorkSession > &theWS, const Standard_Boolean theScratch=Standard_True) |
Clears the internal data structures and attaches to a new session Clears the session if it was not yet set for STEP. | |
IFSelect_ReturnStatus | Write (const Standard_CString theFileName) |
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. | |
IFSelect_ReturnStatus | WriteStream (std::ostream &theStream) |
Writes all the produced models into the stream. Provided for use like single-file writer. | |
Standard_Boolean | Transfer (const Handle< TDocStd_Document > &theDoc, const STEPControl_StepModelType theMode=STEPControl_AsIs, const Standard_CString theIsMulti=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. | |
Standard_Boolean | Transfer (const Handle< TDocStd_Document > &theDoc, const StepData_ConfParameters &theParams, const STEPControl_StepModelType theMode=STEPControl_AsIs, const Standard_CString theIsMulti=0, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Transfers a document (or single label) to a STEP model This method uses if need to set parameters avoiding initialization from Interface_Static. | |
Standard_Boolean | Transfer (const TDF_Label &theLabel, const STEPControl_StepModelType theMode=STEPControl_AsIs, const Standard_CString theIsMulti=0, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Method to transfer part of the document specified by label. | |
Standard_Boolean | Transfer (const TDF_Label &theLabel, const StepData_ConfParameters &theParams, const STEPControl_StepModelType theMode=STEPControl_AsIs, const Standard_CString theIsMulti=0, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Method to transfer part of the document specified by label This method uses if need to set parameters avoiding initialization from Interface_Static. | |
Standard_Boolean | Transfer (const TDF_LabelSequence &theLabelSeq, const STEPControl_StepModelType theMode=STEPControl_AsIs, const Standard_CString theIsMulti=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. | |
Standard_Boolean | Transfer (const TDF_LabelSequence &theLabelSeq, const StepData_ConfParameters &theParams, const STEPControl_StepModelType theMode=STEPControl_AsIs, const Standard_CString theIsMulti=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 This method uses if need to set parameters avoiding initialization from Interface_Static. | |
Standard_Boolean | Perform (const Handle< TDocStd_Document > &theDoc, const TCollection_AsciiString &theFileName, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Standard_Boolean | Perform (const Handle< TDocStd_Document > &theDoc, const Standard_CString theFileName, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Transfers a document and writes it to a STEP file Returns True if translation is OK. | |
Standard_Boolean | Perform (const Handle< TDocStd_Document > &theDoc, const Standard_CString theFileName, const StepData_ConfParameters &theParams, const Message_ProgressRange &theProgress=Message_ProgressRange()) |
Transfers a document and writes it to a STEP file This method uses if need to set parameters avoiding initialization from Interface_Static Returns True if translation is OK. | |
const NCollection_DataMap< TCollection_AsciiString, Handle< STEPCAFControl_ExternFile > > & | ExternFiles () const |
Returns data on external files Returns Null handle if no external files are read. | |
Standard_Boolean | ExternFile (const TDF_Label &theLabel, Handle< STEPCAFControl_ExternFile > &theExtFile) const |
Returns data on external file by its original label Returns False if no external file with given name is read. | |
Standard_Boolean | ExternFile (const Standard_CString theName, Handle< STEPCAFControl_ExternFile > &theExtFile) const |
Returns data on external file by its name Returns False if no external file with given name is read. | |
STEPControl_Writer & | ChangeWriter () |
Returns basic reader for root file. | |
const STEPControl_Writer & | Writer () const |
Returns basic reader as const. | |
void | SetColorMode (const Standard_Boolean theColorMode) |
Set ColorMode for indicate write Colors or not. | |
Standard_Boolean | GetColorMode () const |
void | SetNameMode (const Standard_Boolean theNameMode) |
Set NameMode for indicate write Name or not. | |
Standard_Boolean | GetNameMode () const |
void | SetLayerMode (const Standard_Boolean theLayerMode) |
Set LayerMode for indicate write Layers or not. | |
Standard_Boolean | GetLayerMode () const |
void | SetPropsMode (const Standard_Boolean thePropsMode) |
PropsMode for indicate write Validation properties or not. | |
Standard_Boolean | GetPropsMode () const |
void | SetSHUOMode (const Standard_Boolean theSHUOMode) |
Set SHUO mode for indicate write SHUO or not. | |
Standard_Boolean | GetSHUOMode () const |
void | SetDimTolMode (const Standard_Boolean theDimTolMode) |
Set dimtolmode for indicate write D>s or not. | |
Standard_Boolean | GetDimTolMode () const |
void | SetMaterialMode (const Standard_Boolean theMaterialMode) |
Set dimtolmode for indicate write D>s or not. | |
Standard_Boolean | GetMaterialMode () const |
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
STEPCAFControl_Writer::STEPCAFControl_Writer | ( | ) |
Creates a writer with an empty STEP model and sets ColorMode, LayerMode, NameMode and PropsMode to Standard_True.
STEPCAFControl_Writer::STEPCAFControl_Writer | ( | const Handle< XSControl_WorkSession > & | theWS, |
const Standard_Boolean | theScratch = 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.
|
inline |
Returns basic reader for root file.
Standard_Boolean STEPCAFControl_Writer::ExternFile | ( | const Standard_CString | theName, |
Handle< STEPCAFControl_ExternFile > & | theExtFile | ||
) | const |
Returns data on external file by its name Returns False if no external file with given name is read.
Standard_Boolean STEPCAFControl_Writer::ExternFile | ( | const TDF_Label & | theLabel, |
Handle< STEPCAFControl_ExternFile > & | theExtFile | ||
) | const |
Returns data on external file by its original label Returns False if no external file with given name is read.
|
inline |
Returns data on external files Returns Null handle if no external files are read.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void STEPCAFControl_Writer::Init | ( | const Handle< XSControl_WorkSession > & | theWS, |
const Standard_Boolean | theScratch = Standard_True |
||
) |
Clears the internal data structures and attaches to a new session Clears the session if it was not yet set for STEP.
Standard_Boolean STEPCAFControl_Writer::Perform | ( | const Handle< TDocStd_Document > & | theDoc, |
const Standard_CString | theFileName, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() |
||
) |
Transfers a document and writes it to a STEP file Returns True if translation is OK.
Standard_Boolean STEPCAFControl_Writer::Perform | ( | const Handle< TDocStd_Document > & | theDoc, |
const Standard_CString | theFileName, | ||
const StepData_ConfParameters & | theParams, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() |
||
) |
Transfers a document and writes it to a STEP file This method uses if need to set parameters avoiding initialization from Interface_Static Returns True if translation is OK.
Standard_Boolean STEPCAFControl_Writer::Perform | ( | const Handle< TDocStd_Document > & | theDoc, |
const TCollection_AsciiString & | theFileName, | ||
const Message_ProgressRange & | theProgress = Message_ProgressRange() |
||
) |
|
protected |
Finds length units located in root of label If it exists, initializes local length unit from it Else initializes according to Cascade length unit.
|
inline |
Set ColorMode for indicate write Colors or not.
|
inline |
Set dimtolmode for indicate write D>s or not.
|
inline |
Set LayerMode for indicate write Layers or not.
|
inline |
Set dimtolmode for indicate write D>s or not.
|
inline |
Set NameMode for indicate write Name or not.
|
inline |
PropsMode for indicate write Validation properties or not.
|
inline |
Set SHUO mode for indicate write SHUO or not.
Standard_Boolean STEPCAFControl_Writer::Transfer | ( | const Handle< TDocStd_Document > & | theDoc, |
const STEPControl_StepModelType | theMode = STEPControl_AsIs , |
||
const Standard_CString | theIsMulti = 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.
Standard_Boolean STEPCAFControl_Writer::Transfer | ( | const Handle< TDocStd_Document > & | theDoc, |
const StepData_ConfParameters & | theParams, | ||
const STEPControl_StepModelType | theMode = STEPControl_AsIs , |
||
const Standard_CString | theIsMulti = 0 , |
||
const Message_ProgressRange & | theProgress = Message_ProgressRange() |
||
) |
Transfers a document (or single label) to a STEP model This method uses if need to set parameters avoiding initialization from Interface_Static.
theParams | configuration parameters |
theMode | mode of translation of shape is AsIs |
theIsMulti | 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) |
theProgress | progress indicator Returns True if translation is OK |
Standard_Boolean STEPCAFControl_Writer::Transfer | ( | const TDF_Label & | theLabel, |
const STEPControl_StepModelType | theMode = STEPControl_AsIs , |
||
const Standard_CString | theIsMulti = 0 , |
||
const Message_ProgressRange & | theProgress = Message_ProgressRange() |
||
) |
Method to transfer part of the document specified by label.
Standard_Boolean STEPCAFControl_Writer::Transfer | ( | const TDF_Label & | theLabel, |
const StepData_ConfParameters & | theParams, | ||
const STEPControl_StepModelType | theMode = STEPControl_AsIs , |
||
const Standard_CString | theIsMulti = 0 , |
||
const Message_ProgressRange & | theProgress = Message_ProgressRange() |
||
) |
Method to transfer part of the document specified by label This method uses if need to set parameters avoiding initialization from Interface_Static.
Standard_Boolean STEPCAFControl_Writer::Transfer | ( | const TDF_LabelSequence & | theLabelSeq, |
const STEPControl_StepModelType | theMode = STEPControl_AsIs , |
||
const Standard_CString | theIsMulti = 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.
Standard_Boolean STEPCAFControl_Writer::Transfer | ( | const TDF_LabelSequence & | theLabelSeq, |
const StepData_ConfParameters & | theParams, | ||
const STEPControl_StepModelType | theMode = STEPControl_AsIs , |
||
const Standard_CString | theIsMulti = 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 This method uses if need to set parameters avoiding initialization from Interface_Static.
|
protected |
Transfers labels to a STEP model Returns True if translation is OK isExternFile setting from transferExternFiles method.
|
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)
IFSelect_ReturnStatus STEPCAFControl_Writer::Write | ( | const Standard_CString | theFileName | ) |
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.
|
protected |
Write colors assigned to specified labels, to STEP model.
|
protected |
|
protected |
Write D>s assigned to specified labels, to STEP model.
|
protected |
Write D>s assigned to specified labels, to STEP model, according AP242.
|
protected |
Write external references to STEP.
|
protected |
|
protected |
Write layers assigned to specified labels, to STEP model.
|
protected |
Write materials assigned to specified labels, to STEP model.
|
protected |
Write names assigned to specified labels, to STEP model.
|
protected |
|
inline |
Returns basic reader as const.
|
protected |
|
protected |
Write SHUO assigned to specified component, to STEP model.
IFSelect_ReturnStatus STEPCAFControl_Writer::WriteStream | ( | std::ostream & | theStream | ) |
Writes all the produced models into the stream. Provided for use like single-file writer.
|
protected |
|
protected |
Write validation properties assigned to specified labels, to STEP model.