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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _IFSelect_DispPerFiles_HeaderFile
18 #define _IFSelect_DispPerFiles_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <IFSelect_Dispatch.hxx>
24 #include <Standard_Integer.hxx>
25 #include <Standard_Boolean.hxx>
26 class IFSelect_IntParam;
27 class Interface_InterfaceError;
28 class TCollection_AsciiString;
29 class Interface_Graph;
30 class IFGraph_SubPartsIterator;
33 class IFSelect_DispPerFiles;
34 DEFINE_STANDARD_HANDLE(IFSelect_DispPerFiles, IFSelect_Dispatch)
36 //! A DispPerFiles produces a determined count of Packets from the
37 //! input Entities. It divides, as equally as possible, the input
38 //! list into a count of files. This count is the parameter of the
39 //! DispPerFiles. If the input list has less than this count, of
40 //! course there will be one packet per input entity.
41 //! This count is a Parameter of the DispPerFiles, given as an
42 //! IntParam, thus allowing external control of its Value
43 class IFSelect_DispPerFiles : public IFSelect_Dispatch
49 //! Creates a DispPerFiles with no Count (default value 1 file)
50 Standard_EXPORT IFSelect_DispPerFiles();
52 //! Returns the Count Parameter used for splitting
53 Standard_EXPORT Handle(IFSelect_IntParam) Count() const;
55 //! Sets a new Parameter for Count
56 Standard_EXPORT void SetCount (const Handle(IFSelect_IntParam)& count);
58 //! Returns the effective value of the count parameter
59 //! (if Count Parameter not Set or value not positive, returns 1)
60 Standard_EXPORT Standard_Integer CountValue() const;
62 //! Returns as Label, "Maximum <count> Files"
63 Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE;
65 //! Returns True, maximum count is given as CountValue
66 Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE;
68 //! Returns True (count is easy to know) and count is the minimum
69 //! value between length of input list and CountValue
70 Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const Standard_OVERRIDE;
72 //! Computes the list of produced Packets. It defines Packets in
73 //! order to have <Count> Packets, except if the input count of
74 //! Entities is lower. Entities are given by RootResult from the
76 Standard_EXPORT void Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const Standard_OVERRIDE;
81 DEFINE_STANDARD_RTTIEXT(IFSelect_DispPerFiles,IFSelect_Dispatch)
91 Handle(IFSelect_IntParam) thecount;
102 #endif // _IFSelect_DispPerFiles_HeaderFile