Open CASCADE Technology 7.8.0
|
A GraphCounter computes values to be sorted with the help of a Graph. I.E. not from a Signature. More...
#include <IFSelect_GraphCounter.hxx>
Public Member Functions | |
IFSelect_GraphCounter (const Standard_Boolean withmap=Standard_True, const Standard_Boolean withlist=Standard_False) | |
Creates a GraphCounter, without applied selection. | |
Handle< IFSelect_SelectDeduct > | Applied () const |
Returns the applied selection. | |
void | SetApplied (const Handle< IFSelect_SelectDeduct > &sel) |
Sets a new applied selection. | |
virtual void | AddWithGraph (const Handle< TColStd_HSequenceOfTransient > &list, const Interface_Graph &graph) override |
Adds a list of entities in the context given by the graph Default takes the count of entities selected by the applied selection, when it is given each entity of the list Can be redefined. | |
Public Member Functions inherited from IFSelect_SignCounter | |
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 guarantees uniqueness of data <withlist> is transmitted to SignatureList (option to list entities, not only to count them). | |
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. | |
Handle< IFSelect_Signature > | Signature () const |
Returns the Signature used to count entities. It can be null. | |
void | SetMap (const Standard_Boolean withmap) |
Changes the control status. The map is not cleared, simply its use changes. | |
virtual 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 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. | |
void | AddList (const Handle< TColStd_HSequenceOfTransient > &list, const Handle< Interface_InterfaceModel > &model) |
Adds a list of entities by adding each of the items. | |
void | AddModel (const Handle< Interface_InterfaceModel > &model) |
Adds all the entities contained in a Model. | |
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. | |
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 immediately) | |
Handle< IFSelect_Selection > | Selection () const |
Returns the selection, or a null Handle. | |
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_Integer | SelMode () const |
Returns the mode of working with the selection. | |
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. | |
virtual 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. | |
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. | |
Public Member Functions inherited from IFSelect_SignatureList | |
IFSelect_SignatureList (const Standard_Boolean withlist=Standard_False) | |
Creates a SignatureList. If <withlist> is True, entities will be not only counted per signature, but also listed. | |
void | SetList (const Standard_Boolean withlist) |
Changes the record-list status. The list is not cleared but its use changes. | |
Standard_Boolean & | 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 Handle< Standard_Transient > &ent, const Standard_CString sign) |
Adds an entity with its signature, i.e. : | |
Standard_CString | LastValue () const |
Returns the last value recorded by Add (only if SignMode set) Cleared by Clear or Init. | |
void | Init (const Standard_CString name, const NCollection_IndexedDataMap< TCollection_AsciiString, Standard_Integer > &count, const NCollection_IndexedDataMap< TCollection_AsciiString, Handle< Standard_Transient > > &list, const Standard_Integer nbnuls) |
Aknowledges the list in once. Name identifies the Signature. | |
Handle< TColStd_HSequenceOfHAsciiString > | List (const Standard_CString 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> | |
Standard_Boolean | HasEntities () const |
Returns True if the list of Entities is aknowledged, else the method Entities will always return a Null Handle. | |
Standard_Integer | NbNulls () const |
Returns the count of null entities. | |
Standard_Integer | NbTimes (const Standard_CString sign) const |
Returns the number of times a signature was counted, 0 if it has not been recorded at all. | |
Handle< TColStd_HSequenceOfTransient > | Entities (const Standard_CString 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 Standard_CString name) |
Defines a name for a SignatureList (used to print it) | |
virtual Standard_CString | 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 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_Transient & | operator= (const Standard_Transient &) |
Assignment operator, needed to avoid copying reference counter. | |
virtual | ~Standard_Transient () |
Destructor must be virtual. | |
virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
Returns a type descriptor about this object. | |
Standard_Boolean | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
Returns a true value if this is an instance of Type. | |
Standard_Boolean | IsInstance (const Standard_CString theTypeName) const |
Returns a true value if this is an instance of TypeName. | |
Standard_Boolean | 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. | |
Standard_Boolean | IsKind (const Standard_CString 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_Transient * | This () 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. | |
Standard_Integer | GetRefCount () const noexcept |
Get the reference counter of this object. | |
void | IncrementRefCounter () noexcept |
Increments the reference counter of this object. | |
Standard_Integer | DecrementRefCounter () noexcept |
Decrements the reference counter of this object; returns the decremented value. | |
virtual void | Delete () const |
Memory deallocator for transient classes. | |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
typedef void | base_type |
Returns a type descriptor about this object. | |
Static Public Member Functions inherited from Standard_Transient | |
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. | |
A GraphCounter computes values to be sorted with the help of a Graph. I.E. not from a Signature.
The default GraphCounter works with an Applied Selection (a SelectDeduct), the value is the count of selected entities from each input entities)
IFSelect_GraphCounter::IFSelect_GraphCounter | ( | const Standard_Boolean | withmap = Standard_True , |
const Standard_Boolean | withlist = Standard_False |
||
) |
Creates a GraphCounter, without applied selection.
|
overridevirtual |
Adds a list of entities in the context given by the graph Default takes the count of entities selected by the applied selection, when it is given each entity of the list Can be redefined.
Reimplemented from IFSelect_SignCounter.
Handle< IFSelect_SelectDeduct > IFSelect_GraphCounter::Applied | ( | ) | const |
Returns the applied selection.
void IFSelect_GraphCounter::SetApplied | ( | const Handle< IFSelect_SelectDeduct > & | sel | ) |
Sets a new applied selection.