Open CASCADE Technology  7.5.0
Public Member Functions

IGESCAFControl_Reader Class Reference

Provides a tool to read IGES file and put it into DECAF document. Besides transfer of shapes (including assemblies) provided by IGESControl, supports also colors and part names IGESCAFControl_Reader reader; Methods for translation of an IGES file: reader.ReadFile("filename"); reader.Transfer(Document); or reader.Perform("filename",doc); Methods for managing reading attributes. Colors reader.SetColorMode(colormode); Standard_Boolean colormode = reader.GetColorMode(); Layers reader.SetLayerMode(layermode); Standard_Boolean layermode = reader.GetLayerMode(); Names reader.SetNameMode(namemode); Standard_Boolean namemode = reader.GetNameMode();. More...

#include <IGESCAFControl_Reader.hxx>

Inheritance diagram for IGESCAFControl_Reader:
Inheritance graph
[legend]

Public Member Functions

 IGESCAFControl_Reader ()
 Creates a reader with an empty IGES model and sets ColorMode, LayerMode and NameMode to Standard_True. More...
 
 IGESCAFControl_Reader (const Handle< XSControl_WorkSession > &theWS, const Standard_Boolean FromScratch=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 (Handle< TDocStd_Document > &theDoc, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Translates currently loaded IGES file into the document Returns True if succeeded, and False in case of fail. More...
 
Standard_Boolean Perform (const TCollection_AsciiString &theFileName, Handle< TDocStd_Document > &theDoc, const Message_ProgressRange &theProgress=Message_ProgressRange())
 
Standard_Boolean Perform (const Standard_CString theFileName, Handle< TDocStd_Document > &theDoc, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Translate IGES file given by filename into the document Return True if succeeded, and False in case of fail. More...
 
void SetColorMode (const Standard_Boolean theMode)
 Set ColorMode for indicate read Colors or not. More...
 
Standard_Boolean GetColorMode () const
 
void SetNameMode (const Standard_Boolean theMode)
 Set NameMode for indicate read Name or not. More...
 
Standard_Boolean GetNameMode () const
 
void SetLayerMode (const Standard_Boolean theMode)
 Set LayerMode for indicate read Layers or not. More...
 
Standard_Boolean GetLayerMode () const
 
- Public Member Functions inherited from IGESControl_Reader
 IGESControl_Reader ()
 Creates a Reader from scratch. More...
 
 IGESControl_Reader (const Handle< XSControl_WorkSession > &WS, const Standard_Boolean scratch=Standard_True)
 Creates a Reader from an already existing Session. More...
 
void SetReadVisible (const Standard_Boolean ReadRoot)
 Set the transion of ALL Roots (if theReadOnlyVisible is False) or of Visible Roots (if theReadOnlyVisible is True) More...
 
Standard_Boolean GetReadVisible () const
 
Handle< IGESData_IGESModelIGESModel () const
 Returns the model as a IGESModel. It can then be consulted (header, product) More...
 
virtual Standard_Integer NbRootsForTransfer () override
 Determines the list of root entities from Model which are candidate for a transfer to a Shape (type of entities is PRODUCT) <theReadOnlyVisible> is taken into account to define roots. More...
 
void PrintTransferInfo (const IFSelect_PrintFail failwarn, const IFSelect_PrintCount mode) const
 Prints Statistics and check list for Transfer. More...
 
- Public Member Functions inherited from XSControl_Reader
 XSControl_Reader ()
 Creates a Reader from scratch (creates an empty WorkSession) A WorkSession or a Controller must be provided before running. More...
 
 XSControl_Reader (const Standard_CString norm)
 Creates a Reader from scratch, with a norm name which identifies a Controller. More...
 
 XSControl_Reader (const Handle< XSControl_WorkSession > &WS, const Standard_Boolean scratch=Standard_True)
 Creates a Reader from an already existing Session, with a Controller already set Virtual destructor. More...
 
virtual ~XSControl_Reader ()
 Empty virtual destructor. More...
 
Standard_Boolean SetNorm (const Standard_CString norm)
 Sets a specific norm to <me> Returns True if done, False if <norm> is not available. More...
 
void SetWS (const Handle< XSControl_WorkSession > &WS, const Standard_Boolean scratch=Standard_True)
 Sets a specific session to <me> More...
 
Handle< XSControl_WorkSessionWS () const
 Returns the session used in <me> More...
 
IFSelect_ReturnStatus ReadFile (const Standard_CString filename)
 Loads a file and returns the read status Zero for a Model which compies with the Controller. More...
 
IFSelect_ReturnStatus ReadStream (const Standard_CString theName, std::istream &theIStream)
 Loads a file from stream and returns the read status. More...
 
Handle< Interface_InterfaceModelModel () const
 Returns the model. It can then be consulted (header, product) More...
 
Handle< TColStd_HSequenceOfTransient > GiveList (const Standard_CString first="", const Standard_CString second="")
 Returns a list of entities from the IGES or STEP file according to the following rules: More...
 
Handle< TColStd_HSequenceOfTransient > GiveList (const Standard_CString first, const Handle< Standard_Transient > &ent)
 Computes a List of entities from the model as follows <first> beeing a Selection, <ent> beeing an entity or a list of entities (as a HSequenceOfTransient) : the standard result of this selection applied to this list if <first> is erroneous, a null handle is returned. More...
 
Handle< Standard_TransientRootForTransfer (const Standard_Integer num=1)
 Returns an IGES or STEP root entity for translation. The entity is identified by its rank in a list. More...
 
Standard_Boolean TransferOneRoot (const Standard_Integer num=1, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Translates a root identified by the rank num in the model. false is returned if no shape is produced. More...
 
Standard_Boolean TransferOne (const Standard_Integer num, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Translates an IGES or STEP entity identified by the rank num in the model. false is returned if no shape is produced. More...
 
Standard_Boolean TransferEntity (const Handle< Standard_Transient > &start, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Translates an IGES or STEP entity in the model. true is returned if a shape is produced; otherwise, false is returned. More...
 
Standard_Integer TransferList (const Handle< TColStd_HSequenceOfTransient > &list, const Message_ProgressRange &theProgress=Message_ProgressRange())
 Translates a list of entities. Returns the number of IGES or STEP entities that were successfully translated. The list can be produced with GiveList. Warning - This function does not clear the existing output shapes. More...
 
Standard_Integer TransferRoots (const Message_ProgressRange &theProgress=Message_ProgressRange())
 Translates all translatable roots and returns the number of successful translations. Warning - This function clears existing output shapes first. More...
 
void ClearShapes ()
 Clears the list of shapes that may have accumulated in calls to TransferOne or TransferRoot.C. More...
 
Standard_Integer NbShapes () const
 Returns the number of shapes produced by translation. More...
 
TopoDS_Shape Shape (const Standard_Integer num=1) const
 Returns the shape resulting from a translation and identified by the rank num. num equals 1 by default. In other words, the first shape resulting from the translation is returned. More...
 
TopoDS_Shape OneShape () const
 Returns all of the results in a single shape which is: More...
 
void PrintCheckLoad (const Standard_Boolean failsonly, const IFSelect_PrintCount mode) const
 Prints the check list attached to loaded data, on the Standard Trace File (starts at std::cout) All messages or fails only, according to <failsonly> mode = 0 : per entity, prints messages mode = 1 : per message, just gives count of entities per check mode = 2 : also gives entity numbers. More...
 
void PrintCheckLoad (Standard_OStream &theStream, const Standard_Boolean failsonly, const IFSelect_PrintCount mode) const
 Prints the check list attached to loaded data. More...
 
void PrintCheckTransfer (const Standard_Boolean failsonly, const IFSelect_PrintCount mode) const
 Displays check results for the last translation of IGES or STEP entities to Open CASCADE entities. Only fail messages are displayed if failsonly is true. All messages are displayed if failsonly is false. mode determines the contents and the order of the messages according to the terms of the IFSelect_PrintCount enumeration. More...
 
void PrintCheckTransfer (Standard_OStream &theStream, const Standard_Boolean failsonly, const IFSelect_PrintCount mode) const
 Displays check results for the last translation of IGES or STEP entities to Open CASCADE entities. More...
 
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 as follows: More...
 
void PrintStatsTransfer (Standard_OStream &theStream, const Standard_Integer what, const Standard_Integer mode=0) const
 Displays the statistics for the last translation. More...
 
void GetStatsTransfer (const Handle< TColStd_HSequenceOfTransient > &list, Standard_Integer &nbMapped, Standard_Integer &nbWithResult, Standard_Integer &nbWithFail) const
 Gives statistics about Transfer. More...
 

Additional Inherited Members

- Protected Member Functions inherited from XSControl_Reader
TopTools_SequenceOfShapeShapes ()
 Returns a sequence of produced shapes. More...
 
- Protected Attributes inherited from XSControl_Reader
Standard_Boolean therootsta
 
TColStd_SequenceOfTransient theroots
 

Detailed Description

Provides a tool to read IGES file and put it into DECAF document. Besides transfer of shapes (including assemblies) provided by IGESControl, supports also colors and part names IGESCAFControl_Reader reader; Methods for translation of an IGES file: reader.ReadFile("filename"); reader.Transfer(Document); or reader.Perform("filename",doc); Methods for managing reading attributes. Colors reader.SetColorMode(colormode); Standard_Boolean colormode = reader.GetColorMode(); Layers reader.SetLayerMode(layermode); Standard_Boolean layermode = reader.GetLayerMode(); Names reader.SetNameMode(namemode); Standard_Boolean namemode = reader.GetNameMode();.

Constructor & Destructor Documentation

◆ IGESCAFControl_Reader() [1/2]

IGESCAFControl_Reader::IGESCAFControl_Reader ( )
inline

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

◆ IGESCAFControl_Reader() [2/2]

IGESCAFControl_Reader::IGESCAFControl_Reader ( const Handle< XSControl_WorkSession > &  theWS,
const Standard_Boolean  FromScratch = Standard_True 
)
inline

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_Reader::GetColorMode ( ) const
inline

◆ GetLayerMode()

Standard_Boolean IGESCAFControl_Reader::GetLayerMode ( ) const
inline

◆ GetNameMode()

Standard_Boolean IGESCAFControl_Reader::GetNameMode ( ) const
inline

◆ Perform() [1/2]

Standard_Boolean IGESCAFControl_Reader::Perform ( const TCollection_AsciiString theFileName,
Handle< TDocStd_Document > &  theDoc,
const Message_ProgressRange theProgress = Message_ProgressRange() 
)
inline

◆ Perform() [2/2]

Standard_Boolean IGESCAFControl_Reader::Perform ( const Standard_CString  theFileName,
Handle< TDocStd_Document > &  theDoc,
const Message_ProgressRange theProgress = Message_ProgressRange() 
)

Translate IGES file given by filename into the document Return True if succeeded, and False in case of fail.

◆ SetColorMode()

void IGESCAFControl_Reader::SetColorMode ( const Standard_Boolean  theMode)
inline

Set ColorMode for indicate read Colors or not.

◆ SetLayerMode()

void IGESCAFControl_Reader::SetLayerMode ( const Standard_Boolean  theMode)
inline

Set LayerMode for indicate read Layers or not.

◆ SetNameMode()

void IGESCAFControl_Reader::SetNameMode ( const Standard_Boolean  theMode)
inline

Set NameMode for indicate read Name or not.

◆ Transfer()

Standard_Boolean IGESCAFControl_Reader::Transfer ( Handle< TDocStd_Document > &  theDoc,
const Message_ProgressRange theProgress = Message_ProgressRange() 
)

Translates currently loaded IGES file into the document Returns True if succeeded, and False in case of fail.


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