42cf5bc1 |
1 | // Created on: 1998-10-15 |
2 | // Created by: Christian CAILLET |
3 | // Copyright (c) 1998-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _IFSelect_GraphCounter_HeaderFile |
18 | #define _IFSelect_GraphCounter_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <IFSelect_SignCounter.hxx> |
24 | #include <Standard_Boolean.hxx> |
25 | #include <TColStd_HSequenceOfTransient.hxx> |
26 | class IFSelect_SelectDeduct; |
27 | class Interface_Graph; |
28 | |
29 | |
30 | class IFSelect_GraphCounter; |
31 | DEFINE_STANDARD_HANDLE(IFSelect_GraphCounter, IFSelect_SignCounter) |
32 | |
33 | //! A GraphCounter computes values to be sorted with the help of |
34 | //! a Graph. I.E. not from a Signature |
35 | //! |
36 | //! The default GraphCounter works with an Applied Selection (a |
37 | //! SelectDeduct), the value is the count of selected entities |
38 | //! from each input entities) |
39 | class IFSelect_GraphCounter : public IFSelect_SignCounter |
40 | { |
41 | |
42 | public: |
43 | |
44 | |
45 | //! Creates a GraphCounter, without applied selection |
46 | Standard_EXPORT IFSelect_GraphCounter(const Standard_Boolean withmap = Standard_True, const Standard_Boolean withlist = Standard_False); |
47 | |
48 | //! Returns the applied selection |
49 | Standard_EXPORT Handle(IFSelect_SelectDeduct) Applied() const; |
50 | |
51 | //! Sets a new applied selection |
52 | Standard_EXPORT void SetApplied (const Handle(IFSelect_SelectDeduct)& sel); |
53 | |
54 | //! Adds a list of entities in the context given by the graph |
55 | //! Default takes the count of entities selected by the applied |
56 | //! selection, when it is given each entity of the list |
57 | //! Can be redefined |
58 | Standard_EXPORT virtual void AddWithGraph (const Handle(TColStd_HSequenceOfTransient)& list, const Interface_Graph& graph) Standard_OVERRIDE; |
59 | |
60 | |
61 | |
62 | |
92efcf78 |
63 | DEFINE_STANDARD_RTTIEXT(IFSelect_GraphCounter,IFSelect_SignCounter) |
42cf5bc1 |
64 | |
65 | protected: |
66 | |
67 | |
68 | |
69 | |
70 | private: |
71 | |
72 | |
73 | Handle(IFSelect_SelectDeduct) theapplied; |
74 | |
75 | |
76 | }; |
77 | |
78 | |
79 | |
80 | |
81 | |
82 | |
83 | |
84 | #endif // _IFSelect_GraphCounter_HeaderFile |