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
    IFSelect_SignCounter Class Reference

    SignCounter gives the frame to count signatures associated with entities, deducted from them. Ex.: their Dynamic Type. More...

    #include <IFSelect_SignCounter.hxx>

    Inheritance diagram for IFSelect_SignCounter:

    Public Member Functions

     IFSelect_SignCounter (const bool withmap=true, const bool withlist=false)
     Creates a SignCounter, without proper Signature If <withmap> is True (default), added entities are counted only if they are not yet recorded in the map Map control can be set off if the input guarantees uniqueness of data <withlist> is transmitted to SignatureList (option to list entities, not only to count them).
     IFSelect_SignCounter (const occ::handle< IFSelect_Signature > &matcher, const bool withmap=true, const bool withlist=false)
     Creates a SignCounter, with a predefined Signature Other arguments as for Create without Signature.
    occ::handle< IFSelect_SignatureSignature () const
     Returns the Signature used to count entities. It can be null.
    void SetMap (const bool withmap)
     Changes the control status. The map is not cleared, simply its use changes.
    virtual bool AddEntity (const occ::handle< Standard_Transient > &ent, const occ::handle< Interface_InterfaceModel > &model)
     Adds an entity by considering its signature, which is given by call to method AddSign Returns True if added, False if already in the map (and map control status set).
    virtual void AddSign (const occ::handle< Standard_Transient > &ent, const occ::handle< Interface_InterfaceModel > &model)
     Adds an entity (already filtered by Map) with its signature. This signature can be computed with the containing model. Its value is provided by the object Signature given at start, if no Signature is defined, it does nothing.
    void AddList (const occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > &list, const occ::handle< Interface_InterfaceModel > &model)
     Adds a list of entities by adding each of the items.
    virtual void AddWithGraph (const occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > &list, const Interface_Graph &graph)
     Adds a list of entities in the context given by the graph Default just call basic AddList Can be redefined to get a signature computed with the graph.
    void AddModel (const occ::handle< Interface_InterfaceModel > &model)
     Adds all the entities contained in a Model.
    void AddFromSelection (const occ::handle< IFSelect_Selection > &sel, const Interface_Graph &G)
     Adds the result determined by a Selection from a Graph Remark : does not impact at all data from SetSelection & Co.
    void SetSelection (const occ::handle< IFSelect_Selection > &sel)
     Sets a Selection as input : this causes content to be cleared then the Selection to be ready to compute (but not immediately).
    occ::handle< IFSelect_SelectionSelection () const
     Returns the selection, or a null Handle.
    void SetSelMode (const int selmode)
     Changes the mode of working with the selection : -1 just clears optimisation data and nothing else 0 clears it 1 inhibits it for computing (but no clearing) 2 sets it active for computing Default at creation is 0, after SetSelection (not null) is 2.
    int SelMode () const
     Returns the mode of working with the selection.
    bool ComputeSelected (const Interface_Graph &G, const bool forced=false)
     Computes from the selection result, if selection is active (mode 2). If selection is not defined (mode 0) or is inhibited (mode 1) does nothing. Returns True if computation is done (or optimised), False else This method is called by ComputeCounter from WorkSession.
    virtual occ::handle< TCollection_HAsciiStringSign (const occ::handle< Standard_Transient > &ent, const occ::handle< Interface_InterfaceModel > &model) const
     Determines and returns the value of the signature for an entity as an HAsciiString. This method works exactly as AddSign, which is optimized.
    const char * ComputedSign (const occ::handle< Standard_Transient > &ent, const Interface_Graph &G)
     Applies AddWithGraph on one entity, and returns the Signature Value which has been recorded To do this, Add is called with SignOnly Mode True during the call, the returned value is LastValue.
    Public Member Functions inherited from IFSelect_SignatureList
     IFSelect_SignatureList (const bool withlist=false)
     Creates a SignatureList. If <withlist> is True, entities will be not only counted per signature, but also listed.
    void SetList (const bool withlist)
     Changes the record-list status. The list is not cleared but its use changes.
    bool & ModeSignOnly ()
     Returns modifiable the SignOnly Mode If False (D), the counter normally counts If True, the counting work is turned off, Add only fills the LastValue, which can be used as signature, when a counter works from data which are not available from a Signature.
    virtual void Clear ()
    void Add (const occ::handle< Standard_Transient > &ent, const char *const sign)
     Adds an entity with its signature, i.e. :
    const char * LastValue () const
     Returns the last value recorded by Add (only if SignMode set) Cleared by Clear or Init.
    void Init (const char *const namename, const NCollection_IndexedDataMap< TCollection_AsciiString, int > &countcount, const NCollection_IndexedDataMap< TCollection_AsciiString, occ::handle< Standard_Transient > > &list, const int nbnuls)
     Acknowledges the list in once. Name identifies the Signature.
    occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > List (const char *const root="") const
     Returns the list of signatures, as a sequence of strings (but without their respective counts). It is ordered. By default, for all the signatures. If <root> is given non empty, for the signatures which begin by <root>.
    bool HasEntities () const
     Returns True if the list of Entities is acknowledged, else the method Entities will always return a Null Handle.
    int NbNulls () const
     Returns the count of null entities.
    int NbTimes (const char *const sign) const
     Returns the number of times a signature was counted, 0 if it has not been recorded at all.
    occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > Entities (const char *const sign) const
     Returns the list of entities attached to a signature It is empty if <sign> has not been recorded It is a Null Handle if the list of entities is not known.
    void SetName (const char *const namename)
     Defines a name for a SignatureList (used to print it).
    virtual const char * Name () const
     Returns the recorded Name. Remark : default is "..." (no SetName called).
    virtual void PrintCount (Standard_OStream &S) const
     Prints the counts of items (not the list).
    virtual void PrintList (Standard_OStream &S, const occ::handle< Interface_InterfaceModel > &model, const IFSelect_PrintCount mod=IFSelect_ListByItem) const
     Prints the lists of items, if they are present (else, prints a message "no list available") Uses <model> to determine for each entity to be listed, its number, and its specific identifier (by PrintLabel) <mod> gives a mode for printing :
    virtual void PrintSum (Standard_OStream &S) const
     Prints a summary Item which has the greatest count of entities For items which are numeric values : their count, maximum, minimum values, cumul, average.
    Public Member Functions inherited from Standard_Transient
     Standard_Transient ()
     Empty constructor.
     Standard_Transient (const Standard_Transient &)
     Copy constructor – does nothing.
    Standard_Transientoperator= (const Standard_Transient &)
     Assignment operator, needed to avoid copying reference counter.
    virtual ~Standard_Transient ()=default
     Destructor must be virtual.
    virtual const opencascade::handle< Standard_Type > & DynamicType () const
     Returns a type descriptor about this object.
    bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
     Returns a true value if this is an instance of Type.
    bool IsInstance (const char *const theTypeName) const
     Returns a true value if this is an instance of TypeName.
    bool IsKind (const opencascade::handle< Standard_Type > &theType) const
     Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
    bool IsKind (const char *const theTypeName) const
     Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
    Standard_TransientThis () const
     Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
    int GetRefCount () const noexcept
     Get the reference counter of this object.
    void IncrementRefCounter () noexcept
     Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
    int DecrementRefCounter () noexcept
     Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
    virtual void Delete () const
     Memory deallocator for transient classes.

    Additional Inherited Members

    typedef void base_type
     Returns a type descriptor about this object.
    static constexpr const char * get_type_name ()
     Returns a type descriptor about this object.
    static const opencascade::handle< Standard_Type > & get_type_descriptor ()
     Returns type descriptor of Standard_Transient class.

    Detailed Description

    SignCounter gives the frame to count signatures associated with entities, deducted from them. Ex.: their Dynamic Type.

    It can sort a set of Entities according a signature, i.e. :

    • list of different values found for this Signature
    • for each one, count and list of entities Results are returned as a SignatureList, which can be queried on the count (list of strings, count per signature, or list of entities per signature)

    A SignCounter can be filled, either directly from lists, or from the result of a Selection : hence, its content can be automatically recomputed as desired

    SignCounter works by using a Signature in its method AddSign

    Methods can be redefined to, either

    • directly compute the value without a Signature
    • compute the value in the context of a Graph

    Constructor & Destructor Documentation

    ◆ IFSelect_SignCounter() [1/2]

    IFSelect_SignCounter::IFSelect_SignCounter ( const bool withmap = true,
    const bool withlist = false )

    Creates a SignCounter, without proper Signature If <withmap> is True (default), added entities are counted only if they are not yet recorded in the map Map control can be set off if the input guarantees uniqueness of data <withlist> is transmitted to SignatureList (option to list entities, not only to count them).

    ◆ IFSelect_SignCounter() [2/2]

    IFSelect_SignCounter::IFSelect_SignCounter ( const occ::handle< IFSelect_Signature > & matcher,
    const bool withmap = true,
    const bool withlist = false )

    Creates a SignCounter, with a predefined Signature Other arguments as for Create without Signature.

    Member Function Documentation

    ◆ AddEntity()

    virtual bool IFSelect_SignCounter::AddEntity ( const occ::handle< Standard_Transient > & ent,
    const occ::handle< Interface_InterfaceModel > & model )
    virtual

    Adds an entity by considering its signature, which is given by call to method AddSign Returns True if added, False if already in the map (and map control status set).

    ◆ AddFromSelection()

    void IFSelect_SignCounter::AddFromSelection ( const occ::handle< IFSelect_Selection > & sel,
    const Interface_Graph & G )

    Adds the result determined by a Selection from a Graph Remark : does not impact at all data from SetSelection & Co.

    ◆ AddList()

    void IFSelect_SignCounter::AddList ( const occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > & list,
    const occ::handle< Interface_InterfaceModel > & model )

    Adds a list of entities by adding each of the items.

    ◆ AddModel()

    void IFSelect_SignCounter::AddModel ( const occ::handle< Interface_InterfaceModel > & model)

    Adds all the entities contained in a Model.

    ◆ AddSign()

    virtual void IFSelect_SignCounter::AddSign ( const occ::handle< Standard_Transient > & ent,
    const occ::handle< Interface_InterfaceModel > & model )
    virtual

    Adds an entity (already filtered by Map) with its signature. This signature can be computed with the containing model. Its value is provided by the object Signature given at start, if no Signature is defined, it does nothing.

    Can be redefined (in this case, see also Sign)

    Reimplemented in IGESSelect_CounterOfLevelNumber.

    ◆ AddWithGraph()

    virtual void IFSelect_SignCounter::AddWithGraph ( const occ::handle< NCollection_HSequence< occ::handle< Standard_Transient > > > & list,
    const Interface_Graph & graph )
    virtual

    Adds a list of entities in the context given by the graph Default just call basic AddList Can be redefined to get a signature computed with the graph.

    Reimplemented in IFSelect_GraphCounter.

    ◆ ComputedSign()

    const char * IFSelect_SignCounter::ComputedSign ( const occ::handle< Standard_Transient > & ent,
    const Interface_Graph & G )

    Applies AddWithGraph on one entity, and returns the Signature Value which has been recorded To do this, Add is called with SignOnly Mode True during the call, the returned value is LastValue.

    ◆ ComputeSelected()

    bool IFSelect_SignCounter::ComputeSelected ( const Interface_Graph & G,
    const bool forced = false )

    Computes from the selection result, if selection is active (mode 2). If selection is not defined (mode 0) or is inhibited (mode 1) does nothing. Returns True if computation is done (or optimised), False else This method is called by ComputeCounter from WorkSession.

    If <forced> is True, recomputes systematically Else (D), if the counter was not cleared and if the former computed result started from the same total size of Graph and same count of selected entities : computation is not redone unless <forced> is given as True

    ◆ Selection()

    occ::handle< IFSelect_Selection > IFSelect_SignCounter::Selection ( ) const

    Returns the selection, or a null Handle.

    ◆ SelMode()

    int IFSelect_SignCounter::SelMode ( ) const

    Returns the mode of working with the selection.

    ◆ SetMap()

    void IFSelect_SignCounter::SetMap ( const bool withmap)

    Changes the control status. The map is not cleared, simply its use changes.

    ◆ SetSelection()

    void IFSelect_SignCounter::SetSelection ( const occ::handle< IFSelect_Selection > & sel)

    Sets a Selection as input : this causes content to be cleared then the Selection to be ready to compute (but not immediately).

    ◆ SetSelMode()

    void IFSelect_SignCounter::SetSelMode ( const int selmode)

    Changes the mode of working with the selection : -1 just clears optimisation data and nothing else 0 clears it 1 inhibits it for computing (but no clearing) 2 sets it active for computing Default at creation is 0, after SetSelection (not null) is 2.

    ◆ Sign()

    virtual occ::handle< TCollection_HAsciiString > IFSelect_SignCounter::Sign ( const occ::handle< Standard_Transient > & ent,
    const occ::handle< Interface_InterfaceModel > & model ) const
    virtual

    Determines and returns the value of the signature for an entity as an HAsciiString. This method works exactly as AddSign, which is optimized.

    Can be redefined, accorded with AddSign

    Reimplemented in IGESSelect_CounterOfLevelNumber.

    ◆ Signature()

    occ::handle< IFSelect_Signature > IFSelect_SignCounter::Signature ( ) const

    Returns the Signature used to count entities. It can be null.


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