42cf5bc1 |
1 | // Created on: 1994-12-21 |
2 | // Created by: Christian CAILLET |
3 | // Copyright (c) 1994-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_DispPerFiles_HeaderFile |
18 | #define _IFSelect_DispPerFiles_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <IFSelect_Dispatch.hxx> |
24 | #include <Standard_Integer.hxx> |
42cf5bc1 |
25 | class IFSelect_IntParam; |
42cf5bc1 |
26 | class TCollection_AsciiString; |
27 | class Interface_Graph; |
28 | class IFGraph_SubPartsIterator; |
29 | |
30 | |
31 | class IFSelect_DispPerFiles; |
32 | DEFINE_STANDARD_HANDLE(IFSelect_DispPerFiles, IFSelect_Dispatch) |
33 | |
34 | //! A DispPerFiles produces a determined count of Packets from the |
35 | //! input Entities. It divides, as equally as possible, the input |
36 | //! list into a count of files. This count is the parameter of the |
37 | //! DispPerFiles. If the input list has less than this count, of |
38 | //! course there will be one packet per input entity. |
39 | //! This count is a Parameter of the DispPerFiles, given as an |
40 | //! IntParam, thus allowing external control of its Value |
41 | class IFSelect_DispPerFiles : public IFSelect_Dispatch |
42 | { |
43 | |
44 | public: |
45 | |
46 | |
47 | //! Creates a DispPerFiles with no Count (default value 1 file) |
48 | Standard_EXPORT IFSelect_DispPerFiles(); |
49 | |
50 | //! Returns the Count Parameter used for splitting |
51 | Standard_EXPORT Handle(IFSelect_IntParam) Count() const; |
52 | |
53 | //! Sets a new Parameter for Count |
54 | Standard_EXPORT void SetCount (const Handle(IFSelect_IntParam)& count); |
55 | |
56 | //! Returns the effective value of the count parameter |
57 | //! (if Count Parameter not Set or value not positive, returns 1) |
58 | Standard_EXPORT Standard_Integer CountValue() const; |
59 | |
60 | //! Returns as Label, "Maximum <count> Files" |
79104795 |
61 | Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; |
42cf5bc1 |
62 | |
63 | //! Returns True, maximum count is given as CountValue |
64 | Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE; |
dde68833 |
65 | |
42cf5bc1 |
66 | //! Computes the list of produced Packets. It defines Packets in |
67 | //! order to have <Count> Packets, except if the input count of |
68 | //! Entities is lower. Entities are given by RootResult from the |
69 | //! Final Selection. |
79104795 |
70 | Standard_EXPORT void Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const Standard_OVERRIDE; |
42cf5bc1 |
71 | |
72 | |
73 | |
74 | |
92efcf78 |
75 | DEFINE_STANDARD_RTTIEXT(IFSelect_DispPerFiles,IFSelect_Dispatch) |
42cf5bc1 |
76 | |
77 | protected: |
78 | |
79 | |
80 | |
81 | |
82 | private: |
83 | |
84 | |
85 | Handle(IFSelect_IntParam) thecount; |
86 | |
87 | |
88 | }; |
89 | |
90 | |
91 | |
92 | |
93 | |
94 | |
95 | |
96 | #endif // _IFSelect_DispPerFiles_HeaderFile |