OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    XSControl_Reader Class Reference

    A groundwork to convert a shape to data which complies with a particular norm. This data can be that of a whole model or that of a specific list of entities in the model. You specify the list using a single selection or a combination of selections. A selection is an operator which computes a list of entities from a list given in input. To specify the input, you can use: More...

    #include <XSControl_Reader.hxx>

    Inheritance diagram for XSControl_Reader:

    Public Member Functions

     XSControl_Reader ()
     Creates a Reader from scratch (creates an empty WorkSession) A WorkSession or a Controller must be provided before running.
     XSControl_Reader (const char *const norm)
     Creates a Reader from scratch, with a norm name which identifies a Controller.
     XSControl_Reader (const occ::handle< XSControl_WorkSession > &WS, const bool scratch=true)
     Creates a Reader from an already existing Session, with a Controller already set Virtual destructor.
    virtual ~XSControl_Reader ()=default
     Empty virtual destructor.
    bool SetNorm (const char *const norm)
     Sets a specific norm to <me> Returns True if done, False if <norm> is not available.
    void SetWS (const occ::handle< XSControl_WorkSession > &WS, const bool scratch=true)
     Sets a specific session to <me>.
    occ::handle< XSControl_WorkSessionWS () const
     Returns the session used in <me>.
    virtual IFSelect_ReturnStatus ReadFile (const char *const filename)
     Loads a file and returns the read status Zero for a Model which complies with the Controller.
    virtual IFSelect_ReturnStatus ReadStream (const char *const theName, std::istream &theIStream)
     Loads a file from stream and returns the read status.
    occ::handle< Interface_InterfaceModelModel () const
     Returns the model. It can then be consulted (header, product).
    occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > GiveList (const char *const firstfirst="", const char *const second="")
     Returns a list of entities from the IGES or STEP file according to the following rules:
    occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > GiveList (const char *const firstfirst, const occ::handle< Standard_Transient > &ent)
     Computes a List of entities from the model as follows <first> being a Selection, <ent> being 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.
    virtual int NbRootsForTransfer ()
     Determines the list of root entities which are candidate for a transfer to a Shape, and returns the number of entities in the list.
    occ::handle< Standard_TransientRootForTransfer (const int numnum=1)
     Returns an IGES or STEP root entity for translation. The entity is identified by its rank in a list.
    bool TransferOneRoot (const int numnum=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.
    bool TransferOne (const int numnum, 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.
    bool TransferEntity (const occ::handle< Standard_Transient > &startstart, 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.
    int TransferList (const occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > &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.
    int 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.
    void ClearShapes ()
     Clears the list of shapes that may have accumulated in calls to TransferOne or TransferRoot.C.
    int NbShapes () const
     Returns the number of shapes produced by translation.
    TopoDS_Shape Shape (const int numnum=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.
    TopoDS_Shape OneShape () const
     Returns all of the results in a single shape which is:
    void PrintCheckLoad (const bool failsonly, const IFSelect_PrintCount modemode) 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.
    void PrintCheckLoad (Standard_OStream &theStream, const bool failsonly, const IFSelect_PrintCount modemode) const
     Prints the check list attached to loaded data.
    void PrintCheckTransfer (const bool failsonly, const IFSelect_PrintCount modemode) 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.
    void PrintCheckTransfer (Standard_OStream &theStream, const bool failsonly, const IFSelect_PrintCount modemode) const
     Displays check results for the last translation of IGES or STEP entities to Open CASCADE entities.
    void PrintStatsTransfer (const int what, const int modemode=0) const
     Displays the statistics for the last translation. what defines the kind of statistics that are displayed as follows:
    void PrintStatsTransfer (Standard_OStream &theStream, const int what, const int modemode=0) const
     Displays the statistics for the last translation.
    void GetStatsTransfer (const occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > &list, int &nbMapped, int &nbWithResult, int &nbWithFail) const
     Gives statistics about Transfer.
    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 XSAlgo_ShapeProcessor::ProcessingFlagsGetShapeProcessFlags () const
     Returns flags defining operations to be performed on shapes.

    Protected Member Functions

    NCollection_Sequence< TopoDS_Shape > & Shapes ()
     Returns a sequence of produced shapes.
    virtual DE_ShapeFixParameters GetDefaultShapeFixParameters () const
     Returns default parameters for shape fixing. This method should be implemented in the derived classes to return default parameters for shape fixing.
    virtual ShapeProcess::OperationsFlags GetDefaultShapeProcessFlags () const
     Returns default flags for shape processing. This method should be implemented in the derived classes to return default flags for shape processing.

    Protected Attributes

    bool therootsta
    NCollection_Sequence< occ::handle< Standard_Transient > > theroots

    Detailed Description

    A groundwork to convert a shape to data which complies with a particular norm. This data can be that of a whole model or that of a specific list of entities in the model. You specify the list using a single selection or a combination of selections. A selection is an operator which computes a list of entities from a list given in input. To specify the input, you can use:

    • A predefined selection such as "xst-transferrable-roots"
    • A filter based on a signature. A signature is an operator which returns a string from an entity according to its type. For example:
    • "xst-type" (CDL)
    • "iges-level"
    • "step-type". A filter can be based on a signature by giving a value to be matched by the string returned. For example, "xst-type(Curve)". If no list is specified, the selection computes its list of entities from the whole model. To use this class, you have to initialize the transfer norm first, as shown in the example below. Example: Control_Reader reader; IFSelect_ReturnStatus status = reader.ReadFile (filename.); When using IGESControl_Reader or STEPControl_Reader - as the above example shows - the reader initializes the norm directly. Note that loading the file only stores the data. It does not translate this data. Shapes are accumulated by successive transfers. The last shape is cleared by:
    • ClearShapes which allows you to handle a new batch
    • TransferRoots which restarts the list of shapes from scratch.

    Constructor & Destructor Documentation

    ◆ XSControl_Reader() [1/3]

    XSControl_Reader::XSControl_Reader ( )

    Creates a Reader from scratch (creates an empty WorkSession) A WorkSession or a Controller must be provided before running.

    ◆ XSControl_Reader() [2/3]

    XSControl_Reader::XSControl_Reader ( const char *const norm)

    Creates a Reader from scratch, with a norm name which identifies a Controller.

    ◆ XSControl_Reader() [3/3]

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

    Creates a Reader from an already existing Session, with a Controller already set Virtual destructor.

    ◆ ~XSControl_Reader()

    virtual XSControl_Reader::~XSControl_Reader ( )
    virtualdefault

    Empty virtual destructor.

    Member Function Documentation

    ◆ ClearShapes()

    void XSControl_Reader::ClearShapes ( )

    Clears the list of shapes that may have accumulated in calls to TransferOne or TransferRoot.C.

    ◆ GetDefaultShapeFixParameters()

    virtual DE_ShapeFixParameters XSControl_Reader::GetDefaultShapeFixParameters ( ) const
    inlineprotectedvirtual

    Returns default parameters for shape fixing. This method should be implemented in the derived classes to return default parameters for shape fixing.

    Returns
    Default parameters for shape fixing.

    Reimplemented in IGESControl_Reader, and STEPControl_Reader.

    ◆ GetDefaultShapeProcessFlags()

    virtual ShapeProcess::OperationsFlags XSControl_Reader::GetDefaultShapeProcessFlags ( ) const
    inlineprotectedvirtual

    Returns default flags for shape processing. This method should be implemented in the derived classes to return default flags for shape processing.

    Returns
    Default flags for shape processing.

    Reimplemented in IGESControl_Reader, and STEPControl_Reader.

    ◆ GetShapeFixParameters()

    const XSAlgo_ShapeProcessor::ParameterMap & XSControl_Reader::GetShapeFixParameters ( ) const

    Returns parameters for shape processing that was set by SetParameters() method.

    Returns
    the parameters for shape processing. Empty map if no parameters were set.

    ◆ GetShapeProcessFlags()

    const XSAlgo_ShapeProcessor::ProcessingFlags & XSControl_Reader::GetShapeProcessFlags ( ) const

    Returns flags defining operations to be performed on shapes.

    Returns
    Pair of values defining operations to be performed on shapes and a boolean value that indicates whether the flags were set.

    ◆ GetStatsTransfer()

    void XSControl_Reader::GetStatsTransfer ( const occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > & list,
    int & nbMapped,
    int & nbWithResult,
    int & nbWithFail ) const

    Gives statistics about Transfer.

    ◆ GiveList() [1/2]

    occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > XSControl_Reader::GiveList ( const char *const first,
    const occ::handle< Standard_Transient > & ent )

    Computes a List of entities from the model as follows <first> being a Selection, <ent> being 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.

    ◆ GiveList() [2/2]

    occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > XSControl_Reader::GiveList ( const char *const first = "",
    const char *const second = "" )

    Returns a list of entities from the IGES or STEP file according to the following rules:

    • if first and second are empty strings, the whole file is selected.
    • if first is an entity number or label, the entity referred to is selected.
    • if first is a list of entity numbers/labels separated by commas, the entities referred to are selected,
    • if first is the name of a selection in the worksession and second is not defined, the list contains the standard output for that selection.
    • if first is the name of a selection and second is defined, the criterion defined by second is applied to the result of the first selection. A selection is an operator which computes a list of entities from a list given in input according to its type. If no list is specified, the selection computes its list of entities from the whole model. A selection can be:
    • A predefined selection (xst-transferrable-mode)
    • A filter based on a signature A Signature is an operator which returns a string from an entity according to its type. For example:
    • "xst-type" (CDL)
    • "iges-level"
    • "step-type". For example, if you wanted to select only the advanced_faces in a STEP file you would use the following code: Example Reader.GiveList("xst-transferrable-roots","step-type(ADVANCED_FACE)"); Warning If the value given to second is incorrect, it will simply be ignored.

    ◆ Model()

    occ::handle< Interface_InterfaceModel > XSControl_Reader::Model ( ) const

    Returns the model. It can then be consulted (header, product).

    ◆ NbRootsForTransfer()

    virtual int XSControl_Reader::NbRootsForTransfer ( )
    virtual

    Determines the list of root entities which are candidate for a transfer to a Shape, and returns the number of entities in the list.

    Reimplemented in IGESControl_Reader, and STEPControl_Reader.

    ◆ NbShapes()

    int XSControl_Reader::NbShapes ( ) const

    Returns the number of shapes produced by translation.

    ◆ OneShape()

    TopoDS_Shape XSControl_Reader::OneShape ( ) const

    Returns all of the results in a single shape which is:

    • a null shape if there are no results,
    • a shape if there is one result,
    • a compound containing the resulting shapes if there are more than one.

    ◆ PrintCheckLoad() [1/2]

    void XSControl_Reader::PrintCheckLoad ( const bool 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.

    ◆ PrintCheckLoad() [2/2]

    void XSControl_Reader::PrintCheckLoad ( Standard_OStream & theStream,
    const bool failsonly,
    const IFSelect_PrintCount mode ) const

    Prints the check list attached to loaded data.

    ◆ PrintCheckTransfer() [1/2]

    void XSControl_Reader::PrintCheckTransfer ( const bool 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.

    ◆ PrintCheckTransfer() [2/2]

    void XSControl_Reader::PrintCheckTransfer ( Standard_OStream & theStream,
    const bool failsonly,
    const IFSelect_PrintCount mode ) const

    Displays check results for the last translation of IGES or STEP entities to Open CASCADE entities.

    ◆ PrintStatsTransfer() [1/2]

    void XSControl_Reader::PrintStatsTransfer ( const int what,
    const int mode = 0 ) const

    Displays the statistics for the last translation. what defines the kind of statistics that are displayed as follows:

    • 0 gives general statistics (number of translated roots, number of warnings, number of fail messages),
    • 1 gives root results,
    • 2 gives statistics for all checked entities,
    • 3 gives the list of translated entities,
    • 4 gives warning and fail messages,
    • 5 gives fail messages only. The use of mode depends on the value of what. If what is 0, mode is ignored. If what is 1, 2 or 3, mode defines the following:
    • 0 lists the numbers of IGES or STEP entities in the respective model
    • 1 gives the number, identifier, type and result type for each IGES or STEP entity and/or its status (fail, warning, etc.)
    • 2 gives maximum information for each IGES or STEP entity (i.e. checks)
    • 3 gives the number of entities per type of IGES or STEP entity
    • 4 gives the number of IGES or STEP entities per result type and/or status
    • 5 gives the number of pairs (IGES or STEP or result type and status)
    • 6 gives the number of pairs (IGES or STEP or result type and status) AND the list of entity numbers in the IGES or STEP model. If what is 4 or 5, mode defines the warning and fail messages as follows:
    • if mode is 0 all warnings and checks per entity are returned
    • if mode is 2 the list of entities per warning is returned. If mode is not set, only the list of all entities per warning is given.

    ◆ PrintStatsTransfer() [2/2]

    void XSControl_Reader::PrintStatsTransfer ( Standard_OStream & theStream,
    const int what,
    const int mode = 0 ) const

    Displays the statistics for the last translation.

    ◆ ReadFile()

    virtual IFSelect_ReturnStatus XSControl_Reader::ReadFile ( const char *const filename)
    virtual

    Loads a file and returns the read status Zero for a Model which complies with the Controller.

    Reimplemented in STEPControl_Reader.

    ◆ ReadStream()

    virtual IFSelect_ReturnStatus XSControl_Reader::ReadStream ( const char *const theName,
    std::istream & theIStream )
    virtual

    Loads a file from stream and returns the read status.

    Reimplemented in STEPControl_Reader.

    ◆ RootForTransfer()

    occ::handle< Standard_Transient > XSControl_Reader::RootForTransfer ( const int num = 1)

    Returns an IGES or STEP root entity for translation. The entity is identified by its rank in a list.

    ◆ SetNorm()

    bool XSControl_Reader::SetNorm ( const char *const norm)

    Sets a specific norm to <me> Returns True if done, False if <norm> is not available.

    ◆ SetShapeFixParameters() [1/3]

    void XSControl_Reader::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.

    Parameters
    theParametersthe parameters for shape processing.
    theAdditionalParametersthe additional parameters for shape processing.

    ◆ SetShapeFixParameters() [2/3]

    void XSControl_Reader::SetShapeFixParameters ( const XSAlgo_ShapeProcessor::ParameterMap & theParameters)

    Sets parameters for shape processing.

    Parameters
    theParametersthe parameters for shape processing.

    ◆ SetShapeFixParameters() [3/3]

    void XSControl_Reader::SetShapeFixParameters ( XSAlgo_ShapeProcessor::ParameterMap && theParameters)

    Sets parameters for shape processing. Parameters are moved from the input map.

    Parameters
    theParametersthe parameters for shape processing.

    ◆ SetShapeProcessFlags()

    void XSControl_Reader::SetShapeProcessFlags ( const ShapeProcess::OperationsFlags & theFlags)

    Sets flags defining operations to be performed on shapes.

    Parameters
    theFlagsThe flags defining operations to be performed on shapes.

    ◆ SetWS()

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

    Sets a specific session to <me>.

    ◆ Shape()

    TopoDS_Shape XSControl_Reader::Shape ( const int 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.

    ◆ Shapes()

    NCollection_Sequence< TopoDS_Shape > & XSControl_Reader::Shapes ( )
    protected

    Returns a sequence of produced shapes.

    ◆ TransferEntity()

    bool XSControl_Reader::TransferEntity ( const occ::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.

    ◆ TransferList()

    int XSControl_Reader::TransferList ( const occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > & 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.

    ◆ TransferOne()

    bool XSControl_Reader::TransferOne ( const int 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.

    ◆ TransferOneRoot()

    bool XSControl_Reader::TransferOneRoot ( const int 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.

    ◆ TransferRoots()

    int XSControl_Reader::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.

    ◆ WS()

    occ::handle< XSControl_WorkSession > XSControl_Reader::WS ( ) const

    Returns the session used in <me>.

    Field Documentation

    ◆ theroots

    NCollection_Sequence<occ::handle<Standard_Transient> > XSControl_Reader::theroots
    protected

    ◆ therootsta

    bool XSControl_Reader::therootsta
    protected

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