OCC Main Page | DataExchange | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

# DataExchange
TKSTEP
STEPControl

# STEPControl_Reader Class Reference

Reads STEP files, checks them and translates their contents
into Open CASCADE models. The STEP data can be that of
a whole model or that of a specific list of entities in the model.
As in XSControl_Reader, you specify the list using a selection.
For the translation of iges files it is possible to use next sequence:
To change translation parameters
class Interface_Static should be used before beginning of
translation (see STEP Parameters and General Parameters)
Creation of reader - STEPControl_Reader reader;
To load s file in a model use method reader.ReadFile("filename.stp")
To print load results reader.PrintCheckLoad(failsonly,mode)
where mode is equal to the value of enumeration IFSelect_PrintCount
For definition number of candidates :
Standard_Integer nbroots = reader. NbRootsForTransfer();
To transfer entities from a model the following methods can be used:
for the whole model - reader.TransferRoots();
to transfer a list of entities: reader.TransferList(list);
to transfer one entity Handle(Standard_Transient)
ent = reader.RootForTransfer(num);
reader.TransferEntity(ent), or
reader.TransferOneRoot(num), or
reader.TransferOne(num), or
reader.TransferRoot(num)
To obtain the result the following method can be used:
reader.NbShapes() and reader.Shape(num); or reader.OneShape();
To print the results of transfer use method:
reader.PrintCheckTransfer(failwarn,mode);
where printfail is equal to the value of enumeration
IFSelect_PrintFail, mode see above; or reader.PrintStatsTransfer();
Gets correspondence between a STEP entity and a result
shape obtained from it.
Handle(XSControl_WorkSession)
WS = reader.WS();
if ( WS->TransferReader()->HasResult(ent) )
TopoDS_Shape shape = WS->TransferReader()->ShapeResult(ent);
.

`#include <STEPControl_Reader.hxx>`

Inheritance diagram for STEPControl_Reader:

[legend]

## Public Member Functions
void * | operator new (size_t, void *anAddress)
void * | operator new (size_t size)
void | operator delete (void *anAddress)
Standard_EXPORT | STEPControl_Reader ()
| Creates a reader object with an empty STEP model. .
Standard_EXPORT | STEPControl_Reader (const Handle(XSControl_WorkSession)&WS, const Standard_Boolean scratch=Standard_True)
| Creates a Reader for STEP from an already existing Session Clears the session if it was not yet set for STEP .
Standard_EXPORT Handle_StepData_StepModel | StepModel () const
| Returns the model as a StepModel. It can then be consulted (header, product) .
Standard_EXPORT Standard_Boolean | TransferRoot (const Standard_Integer num=1)
| Transfers a root given its rank in the list of candidate roots Default is the first one Returns True if a shape has resulted, false else Same as inherited TransferOneRoot, kept for compatibility .
virtual Standard_EXPORT Standard_Integer | NbRootsForTransfer ()
| Determines the list of root entities from Model which are candidate for a transfer to a Shape (type of entities is PRODUCT) .

## Constructor & Destructor Documentation

Standard_EXPORT STEPControl_Reader::STEPControl_Reader | ( |  | ) |

Standard_EXPORT STEPControl_Reader::STEPControl_Reader | ( | const Handle(XSControl_WorkSession)& | WS,
|  | const Standard_Boolean | scratch = `Standard_True`
| ) |

## Member Function Documentation

virtual Standard_EXPORT Standard_Integer STEPControl_Reader::NbRootsForTransfer | ( |  | ) | `[virtual]`

| Reimplemented from XSControl_Reader.

void STEPControl_Reader::operator delete | ( | void * | anAddress | ) | `[inline]`

| Reimplemented from XSControl_Reader.

void* STEPControl_Reader::operator new | ( | size_t | size | ) | `[inline]`

| Reimplemented from XSControl_Reader.

void* STEPControl_Reader::operator new | ( | size_t | ,
|  | void * | anAddress
| ) | `[inline]`

| Reimplemented from XSControl_Reader.

Standard_EXPORT Handle_StepData_StepModel STEPControl_Reader::StepModel | ( |  | ) | const

Standard_EXPORT Standard_Boolean STEPControl_Reader::TransferRoot | ( | const Standard_Integer | num = `1` | ) |

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

- STEPControl_Reader.hxx