Open CASCADE Technology  7.5.0
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); Standard_Boolean colormode = writer.GetColorMode(); Layers writer.SetLayerMode(layermode); Standard_Boolean layermode = writer.GetLayerMode(); Names writer.SetNameMode(namemode); Standard_Boolean 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 Standard_True. More...
 
 IGESCAFControl_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 IGES. More...
 
Standard_Boolean Transfer (const Handle< TDocStd_Document > &doc, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Transfers a document to a IGES model Returns True if translation is OK. More...
 
Standard_Boolean Transfer (const TDF_LabelSequence &labels, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Transfers labels to a IGES model Returns True if translation is OK. More...
 
Standard_Boolean Transfer (const TDF_Label &label, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Transfers label to a IGES model Returns True if translation is OK. 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 IGES file Returns True if translation is OK. 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
 
- 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 Standard_CString unit, const Standard_Integer modecr = 0);. More...
 
 IGESControl_Writer (const Standard_CString unit, const Standard_Integer modecr=0)
 Creates a writer with given values for units and for write mode. unit may be any unit that is accepted by the IGES standard. By default, it is the millimeter. modecr defines the write mode and may be: More...
 
 IGESControl_Writer (const Handle< IGESData_IGESModel > &model, const Standard_Integer modecr=0)
 Creates a writer object with the prepared IGES model model in write mode. modecr defines the write mode and may be: More...
 
const Handle< IGESData_IGESModel > & Model () const
 Returns the IGES model to be written in output. More...
 
const Handle< Transfer_FinderProcess > & TransferProcess () const
 
void SetTransferProcess (const Handle< Transfer_FinderProcess > &TP)
 Returns/Sets the TransferProcess : it contains final results and if some, check messages. More...
 
Standard_Boolean 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. More...
 
Standard_Boolean AddGeom (const 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. More...
 
Standard_Boolean AddEntity (const Handle< IGESData_IGESEntity > &ent)
 Adds an IGES entity (and the ones it references) to the model. More...
 
void ComputeModel ()
 Computes the entities found in the model, which is ready to be written. This contrasts with the default computation of headers only. More...
 
Standard_Boolean Write (Standard_OStream &S, const Standard_Boolean fnes=Standard_False)
 Computes then writes the model to an OStream Returns True when done, false in case of error. More...
 
Standard_Boolean Write (const Standard_CString file, const Standard_Boolean fnes=Standard_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). More...
 

Protected Member Functions

Standard_Boolean WriteAttributes (const TDF_LabelSequence &labels)
 Reads colors from DECAF document and assigns them to corresponding IGES entities. More...
 
Standard_Boolean WriteLayers (const TDF_LabelSequence &labels)
 Reads layers from DECAF document and assigns them to corresponding IGES entities. More...
 
Standard_Boolean WriteNames (const TDF_LabelSequence &labels)
 Recursivile iterates on subshapes and assign names to IGES entity. More...
 

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); Standard_Boolean colormode = writer.GetColorMode(); Layers writer.SetLayerMode(layermode); Standard_Boolean layermode = writer.GetLayerMode(); Names writer.SetNameMode(namemode); Standard_Boolean namemode = writer.GetNameMode();.

Constructor & Destructor Documentation

◆ IGESCAFControl_Writer() [1/2]

IGESCAFControl_Writer::IGESCAFControl_Writer ( )

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

◆ IGESCAFControl_Writer() [2/2]

IGESCAFControl_Writer::IGESCAFControl_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 IGES.

Member Function Documentation

◆ GetColorMode()

Standard_Boolean IGESCAFControl_Writer::GetColorMode ( ) const

◆ GetLayerMode()

Standard_Boolean IGESCAFControl_Writer::GetLayerMode ( ) const

◆ GetNameMode()

Standard_Boolean IGESCAFControl_Writer::GetNameMode ( ) const

◆ Perform() [1/2]

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

◆ Perform() [2/2]

Standard_Boolean IGESCAFControl_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 IGES file Returns True if translation is OK.

◆ SetColorMode()

void IGESCAFControl_Writer::SetColorMode ( const Standard_Boolean  colormode)

Set ColorMode for indicate write Colors or not.

◆ SetLayerMode()

void IGESCAFControl_Writer::SetLayerMode ( const Standard_Boolean  layermode)

Set LayerMode for indicate write Layers or not.

◆ SetNameMode()

void IGESCAFControl_Writer::SetNameMode ( const Standard_Boolean  namemode)

Set NameMode for indicate write Name or not.

◆ Transfer() [1/3]

Standard_Boolean IGESCAFControl_Writer::Transfer ( const Handle< TDocStd_Document > &  doc,
const Message_ProgressRange theProgress = Message_ProgressRange() 
)

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

◆ Transfer() [2/3]

Standard_Boolean IGESCAFControl_Writer::Transfer ( const TDF_LabelSequence labels,
const Message_ProgressRange theProgress = Message_ProgressRange() 
)

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

◆ Transfer() [3/3]

Standard_Boolean 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()

Standard_Boolean IGESCAFControl_Writer::WriteAttributes ( const TDF_LabelSequence labels)
protected

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

◆ WriteLayers()

Standard_Boolean IGESCAFControl_Writer::WriteLayers ( const TDF_LabelSequence labels)
protected

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

◆ WriteNames()

Standard_Boolean IGESCAFControl_Writer::WriteNames ( const TDF_LabelSequence labels)
protected

Recursivile iterates on subshapes and assign names to IGES entity.


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