# DataExchange
TKXSBase
IFSelect

# IFSelect_SignCounter Class Reference

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
.

`#include <IFSelect_SignCounter.hxx>`

Inheritance diagram for IFSelect_SignCounter:

[legend]

## Public Member Functions

Standard_EXPORT | IFSelect_SignCounter (const Standard_Boolean withmap=Standard_True, const Standard_Boolean withlist=Standard_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 garantees uniqueness of data <withlist> is transmitted to SignatureList (option to list entities, not only to count them). .
Standard_EXPORT | IFSelect_SignCounter (const Handle(IFSelect_Signature)&matcher, const Standard_Boolean withmap=Standard_True, const Standard_Boolean withlist=Standard_False)
| Creates a SignCounter, with a predefined Signature Other arguments as for Create without Signature. .
Standard_EXPORT Handle_IFSelect_Signature | Signature () const
| Returns the Signature used to count entities. It can be null. .
Standard_EXPORT void | SetMap (const Standard_Boolean withmap)
| Changes the control status. The map is not cleared, simply its use changes .
virtual Standard_EXPORT Standard_Boolean | AddEntity (const Handle(Standard_Transient)&ent, const 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 Standard_EXPORT void | AddSign (const Handle(Standard_Transient)&ent, const 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. Can be redefined (in this case, see also Sign) .
Standard_EXPORT void | AddList (const Handle(TColStd_HSequenceOfTransient)&list, const Handle(Interface_InterfaceModel)&model)
| Adds a list of entities by adding each of the items .
virtual Standard_EXPORT void | AddWithGraph (const Handle(TColStd_HSequenceOfTransient)&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 .
Standard_EXPORT void | AddModel (const Handle(Interface_InterfaceModel)&model)
| Adds all the entities contained in a Model .
Standard_EXPORT void | AddFromSelection (const 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 .
Standard_EXPORT void | SetSelection (const 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 immediatly) .
Standard_EXPORT Handle_IFSelect_Selection | Selection () const
| Returns the selection, or a null Handle .
Standard_EXPORT void | SetSelMode (const Standard_Integer 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 .
Standard_EXPORT Standard_Integer | SelMode () const
| Returns the mode of working with the selection .
Standard_EXPORT Standard_Boolean | ComputeSelected (const Interface_Graph &G, const Standard_Boolean forced=Standard_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
.

virtual Standard_EXPORT Handle_TCollection_HAsciiString | Sign (const Handle(Standard_Transient)&ent, const 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 Can be redefined, accorded with AddSign .
Standard_EXPORT Standard_CString | ComputedSign (const 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 .
Standard_EXPORT const | Handle (Standard_Type)&DynamicType() const

## Private Attributes

Standard_Boolean | themapstat
TColStd_MapOfTransient | themap
Handle_IFSelect_Signature | thematcher
Handle_IFSelect_Selection | theselect
Standard_Integer | theselmode
Standard_Integer | thenbcomp1
Standard_Integer | thenbcomp2

## Constructor & Destructor Documentation

Standard_EXPORT IFSelect_SignCounter::IFSelect_SignCounter | ( | const Standard_Boolean | withmap = `Standard_True`,
|  | const Standard_Boolean | withlist = `Standard_False`
| ) |

Standard_EXPORT IFSelect_SignCounter::IFSelect_SignCounter | ( | const Handle(IFSelect_Signature)& | matcher,
|  | const Standard_Boolean | withmap = `Standard_True`,
|  | const Standard_Boolean | withlist = `Standard_False`
| ) |

## Member Function Documentation

virtual Standard_EXPORT Standard_Boolean IFSelect_SignCounter::AddEntity | ( | const Handle(Standard_Transient)& | ent,
|  | const Handle(Interface_InterfaceModel)& | model
| ) | `[virtual]`

Standard_EXPORT void IFSelect_SignCounter::AddFromSelection | ( | const Handle(IFSelect_Selection)& | sel,
|  | const Interface_Graph & | G
| ) |

Standard_EXPORT void IFSelect_SignCounter::AddList | ( | const Handle(TColStd_HSequenceOfTransient)& | list,
|  | const Handle(Interface_InterfaceModel)& | model
| ) |

Standard_EXPORT void IFSelect_SignCounter::AddModel | ( | const Handle(Interface_InterfaceModel)& | model | ) |

virtual Standard_EXPORT void IFSelect_SignCounter::AddSign | ( | const Handle(Standard_Transient)& | ent,
|  | const Handle(Interface_InterfaceModel)& | model
| ) | `[virtual]`

| Reimplemented in IGESSelect_CounterOfLevelNumber.

virtual Standard_EXPORT void IFSelect_SignCounter::AddWithGraph | ( | const Handle(TColStd_HSequenceOfTransient)& | list,
|  | const Interface_Graph & | graph
| ) | `[virtual]`

| Reimplemented in IFSelect_GraphCounter.

Standard_EXPORT Standard_CString IFSelect_SignCounter::ComputedSign | ( | const Handle(Standard_Transient)& | ent,
|  | const Interface_Graph & | G
| ) |

Standard_EXPORT Standard_Boolean IFSelect_SignCounter::ComputeSelected | ( | const Interface_Graph & | G,
|  | const Standard_Boolean | forced = `Standard_False`
| ) |

Standard_EXPORT const IFSelect_SignCounter::Handle | ( | Standard_Type |  | ) | const

| Reimplemented from IFSelect_SignatureList. Reimplemented in IFSelect_GraphCounter, and IGESSelect_CounterOfLevelNumber.

Standard_EXPORT Handle_IFSelect_Selection IFSelect_SignCounter::Selection | ( |  | ) | const

Standard_EXPORT Standard_Integer IFSelect_SignCounter::SelMode | ( |  | ) | const

Standard_EXPORT void IFSelect_SignCounter::SetMap | ( | const Standard_Boolean | withmap | ) |

Standard_EXPORT void IFSelect_SignCounter::SetSelection | ( | const Handle(IFSelect_Selection)& | sel | ) |

Standard_EXPORT void IFSelect_SignCounter::SetSelMode | ( | const Standard_Integer | selmode | ) |

virtual Standard_EXPORT Handle_TCollection_HAsciiString IFSelect_SignCounter::Sign | ( | const Handle(Standard_Transient)& | ent,
|  | const Handle(Interface_InterfaceModel)& | model
| ) | const`[virtual]`

| Reimplemented in IGESSelect_CounterOfLevelNumber.

Standard_EXPORT Handle_IFSelect_Signature IFSelect_SignCounter::Signature | ( |  | ) | const

## Field Documentation

TColStd_MapOfTransient IFSelect_SignCounter::themap`[private]`

Standard_Boolean IFSelect_SignCounter::themapstat`[private]`

Handle_IFSelect_Signature IFSelect_SignCounter::thematcher`[private]`

Standard_Integer IFSelect_SignCounter::thenbcomp1`[private]`

Standard_Integer IFSelect_SignCounter::thenbcomp2`[private]`

Handle_IFSelect_Selection IFSelect_SignCounter::theselect`[private]`

Standard_Integer IFSelect_SignCounter::theselmode`[private]`

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

- IFSelect_SignCounter.hxx