Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions
IGESCAFControl_Writer Class Reference

Provides a tool to write DECAF document to the IGES file. Besides transfer of shapes (including assemblies) provided by IGESControl, supports also colors and part names IGESCAFControl_Writer writer(); Methods for writing IGES file: writer.Transfer (Document); writer.Write("filename") or writer.Write(OStream) or writer.Perform(Document,"filename"); Methods for managing the writing of attributes. Colors writer.SetColorMode(colormode); bool colormode = writer.GetColorMode(); Layers writer.SetLayerMode(layermode); bool layermode = writer.GetLayerMode(); Names writer.SetNameMode(namemode); bool namemode = writer.GetNameMode();. More...

#include <IGESCAFControl_Writer.hxx>

Inheritance diagram for IGESCAFControl_Writer:
Inheritance graph
[legend]

Public Member Functions

 IGESCAFControl_Writer ()
 Creates a writer with an empty IGES model and sets ColorMode, LayerMode and NameMode to true.
 
 IGESCAFControl_Writer (const occ::handle< XSControl_WorkSession > &WS, const bool scratch=true)
 Creates a reader tool and attaches it to an already existing Session Clears the session if it was not yet set for IGES.
 
 IGESCAFControl_Writer (const occ::handle< XSControl_WorkSession > &theWS, const char *const theUnit)
 Creates a reader tool and attaches it to an already existing Session Clears the session if it was not yet set for IGES Sets target Unit for the writing process.
 
bool Transfer (const occ::handle< TDocStd_Document > &doc, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Transfers a document to a IGES model Returns True if translation is OK.
 
bool Transfer (const NCollection_Sequence< TDF_Label > &labels, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Transfers labels to a IGES model Returns True if translation is OK.
 
bool Transfer (const TDF_Label &label, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Transfers label to a IGES model Returns True if translation is OK.
 
bool Perform (const occ::handle< TDocStd_Document > &doc, const TCollection_AsciiString &filename, const Message_ProgressRange &theProgress=Message_ProgressRange())
 
bool Perform (const occ::handle< TDocStd_Document > &doc, const char *const filename, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Transfers a document and writes it to a IGES file Returns True if translation is OK.
 
void SetColorMode (const bool colormode)
 Set ColorMode for indicate write Colors or not.
 
bool GetColorMode () const
 
void SetNameMode (const bool namemode)
 Set NameMode for indicate write Name or not.
 
bool GetNameMode () const
 
void SetLayerMode (const bool layermode)
 Set LayerMode for indicate write Layers or not.
 
bool GetLayerMode () const
 
- Public Member Functions inherited from IGESControl_Writer
 IGESControl_Writer ()
 Creates a writer object with the default unit (millimeters) and write mode (Face). IGESControl_Writer (const char* const unit, const int modecr = 0);.
 
 IGESControl_Writer (const char *const theUnit, const int theModecr=0)
 Creates a writer with given values for units and for write mode. theUnit may be any unit that is accepted by the IGES standard. By default, it is the millimeter. theModecr defines the write mode and may be:
 
 IGESControl_Writer (const occ::handle< IGESData_IGESModel > &theModel, const int theModecr=0)
 Creates a writer object with the prepared IGES model theModel in write mode. theModecr defines the write mode and may be:
 
const occ::handle< IGESData_IGESModel > & Model () const
 Returns the IGES model to be written in output.
 
const occ::handle< Transfer_FinderProcess > & TransferProcess () const
 
void SetTransferProcess (const occ::handle< Transfer_FinderProcess > &TP)
 Returns/Sets the TransferProcess : it contains final results and if some, check messages.
 
bool AddShape (const TopoDS_Shape &sh, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Translates a Shape to IGES Entities and adds them to the model Returns True if done, False if Shape not suitable for IGES or null.
 
bool AddGeom (const occ::handle< Standard_Transient > &geom)
 Translates a Geometry (Surface or Curve) to IGES Entities and adds them to the model Returns True if done, False if geom is neither a Surface or a Curve suitable for IGES or is null.
 
bool AddEntity (const occ::handle< IGESData_IGESEntity > &ent)
 Adds an IGES entity (and the ones it references) to the model.
 
void ComputeModel ()
 Computes the entities found in the model, which is ready to be written. This contrasts with the default computation of headers only.
 
bool Write (Standard_OStream &S, const bool fnes=false)
 Computes then writes the model to an OStream Returns True when done, false in case of error.
 
bool Write (const char *const file, const bool fnes=false)
 Prepares and writes an IGES model either to an OStream, S or to a file name,CString. Returns True if the operation was performed correctly and False if an error occurred (for instance, if the processor could not create the file).
 
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 ShapeProcess::OperationsFlagsGetShapeProcessFlags () const
 Returns flags defining operations to be performed on shapes.
 

Protected Member Functions

bool WriteAttributes (const NCollection_Sequence< TDF_Label > &labels)
 Reads colors from DECAF document and assigns them to corresponding IGES entities.
 
bool WriteLayers (const NCollection_Sequence< TDF_Label > &labels)
 Reads layers from DECAF document and assigns them to corresponding IGES entities.
 
bool WriteNames (const NCollection_Sequence< TDF_Label > &labels)
 Recursivile iterates on subshapes and assign names to IGES entity.
 
void prepareUnit (const TDF_Label &theLabel)
 Finds length units located in root of label If it exists, initializes local length unit from it Else initializes according to Cascade length unit.
 

Detailed Description

Provides a tool to write DECAF document to the IGES file. Besides transfer of shapes (including assemblies) provided by IGESControl, supports also colors and part names IGESCAFControl_Writer writer(); Methods for writing IGES file: writer.Transfer (Document); writer.Write("filename") or writer.Write(OStream) or writer.Perform(Document,"filename"); Methods for managing the writing of attributes. Colors writer.SetColorMode(colormode); bool colormode = writer.GetColorMode(); Layers writer.SetLayerMode(layermode); bool layermode = writer.GetLayerMode(); Names writer.SetNameMode(namemode); bool namemode = writer.GetNameMode();.

Constructor & Destructor Documentation

◆ IGESCAFControl_Writer() [1/3]

IGESCAFControl_Writer::IGESCAFControl_Writer ( )

Creates a writer with an empty IGES model and sets ColorMode, LayerMode and NameMode to true.

◆ IGESCAFControl_Writer() [2/3]

IGESCAFControl_Writer::IGESCAFControl_Writer ( const occ::handle< XSControl_WorkSession > & WS,
const bool scratch = true )

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

◆ IGESCAFControl_Writer() [3/3]

IGESCAFControl_Writer::IGESCAFControl_Writer ( const occ::handle< XSControl_WorkSession > & theWS,
const char *const theUnit )

Creates a reader tool and attaches it to an already existing Session Clears the session if it was not yet set for IGES Sets target Unit for the writing process.

Member Function Documentation

◆ GetColorMode()

bool IGESCAFControl_Writer::GetColorMode ( ) const

◆ GetLayerMode()

bool IGESCAFControl_Writer::GetLayerMode ( ) const

◆ GetNameMode()

bool IGESCAFControl_Writer::GetNameMode ( ) const

◆ Perform() [1/2]

bool IGESCAFControl_Writer::Perform ( const occ::handle< TDocStd_Document > & doc,
const char *const filename,
const Message_ProgressRange & theProgress = Message_ProgressRange() )

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

◆ Perform() [2/2]

bool IGESCAFControl_Writer::Perform ( const occ::handle< TDocStd_Document > & doc,
const TCollection_AsciiString & filename,
const Message_ProgressRange & theProgress = Message_ProgressRange() )

◆ prepareUnit()

void IGESCAFControl_Writer::prepareUnit ( const TDF_Label & theLabel)
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.

◆ SetColorMode()

void IGESCAFControl_Writer::SetColorMode ( const bool colormode)

Set ColorMode for indicate write Colors or not.

◆ SetLayerMode()

void IGESCAFControl_Writer::SetLayerMode ( const bool layermode)

Set LayerMode for indicate write Layers or not.

◆ SetNameMode()

void IGESCAFControl_Writer::SetNameMode ( const bool namemode)

Set NameMode for indicate write Name or not.

◆ Transfer() [1/3]

bool IGESCAFControl_Writer::Transfer ( const NCollection_Sequence< TDF_Label > & labels,
const Message_ProgressRange & theProgress = Message_ProgressRange() )

Transfers labels to a IGES model Returns True if translation is OK.

◆ Transfer() [2/3]

bool IGESCAFControl_Writer::Transfer ( const occ::handle< TDocStd_Document > & doc,
const Message_ProgressRange & theProgress = Message_ProgressRange() )

Transfers a document to a IGES model Returns True if translation is OK.

◆ Transfer() [3/3]

bool IGESCAFControl_Writer::Transfer ( const TDF_Label & label,
const Message_ProgressRange & theProgress = Message_ProgressRange() )

Transfers label to a IGES model Returns True if translation is OK.

◆ WriteAttributes()

bool IGESCAFControl_Writer::WriteAttributes ( const NCollection_Sequence< TDF_Label > & labels)
protected

Reads colors from DECAF document and assigns them to corresponding IGES entities.

◆ WriteLayers()

bool IGESCAFControl_Writer::WriteLayers ( const NCollection_Sequence< TDF_Label > & labels)
protected

Reads layers from DECAF document and assigns them to corresponding IGES entities.

◆ WriteNames()

bool IGESCAFControl_Writer::WriteNames ( const NCollection_Sequence< TDF_Label > & labels)
protected

Recursivile iterates on subshapes and assign names to IGES entity.


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