1 // Created on: 1992-11-17
2 // Created by: Christian CAILLET
3 // Copyright (c) 1992-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_DispPerCount_HeaderFile
18 #define _IFSelect_DispPerCount_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_DispPerCount;
34 DEFINE_STANDARD_HANDLE(IFSelect_DispPerCount, IFSelect_Dispatch)
36 //! A DispPerCount gathers all the input Entities into one or
37 //! several Packets, each containing a defined count of Entity
38 //! This count is a Parameter of the DispPerCount, given as an
39 //! IntParam, thus allowing external control of its Value
40 class IFSelect_DispPerCount : public IFSelect_Dispatch
46 //! Creates a DispPerCount with no Count (default value 1)
47 Standard_EXPORT IFSelect_DispPerCount();
49 //! Returns the Count Parameter used for splitting
50 Standard_EXPORT Handle(IFSelect_IntParam) Count() const;
52 //! Sets a new Parameter for Count
53 Standard_EXPORT void SetCount (const Handle(IFSelect_IntParam)& count);
55 //! Returns the effective value of the count parameter
56 //! (if Count Parameter not Set or value not positive, returns 1)
57 Standard_EXPORT Standard_Integer CountValue() const;
59 //! Returns as Label, "One File per <count> Input Entities"
60 Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE;
62 //! Returns True, maximum count is given as <nbent>
63 Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const Standard_OVERRIDE;
65 //! Returns True (count is easy to know) and count is computed
66 //! from length of input list (RootResult from Final Selection)
67 Standard_EXPORT virtual Standard_Boolean PacketsCount (const Interface_Graph& G, Standard_Integer& count) const Standard_OVERRIDE;
69 //! Computes the list of produced Packets. It defines Packets in
70 //! order to have at most <Count> Entities per Packet, Entities
71 //! are given by RootResult from the Final Selection.
72 Standard_EXPORT void Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const Standard_OVERRIDE;
77 DEFINE_STANDARD_RTTI(IFSelect_DispPerCount,IFSelect_Dispatch)
87 Handle(IFSelect_IntParam) thecount;
98 #endif // _IFSelect_DispPerCount_HeaderFile