Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-19 09:28:11

0001 // Created on: 1992-11-17
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _IFSelect_DispPerCount_HeaderFile
0018 #define _IFSelect_DispPerCount_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <IFSelect_Dispatch.hxx>
0024 #include <Standard_Integer.hxx>
0025 class IFSelect_IntParam;
0026 class TCollection_AsciiString;
0027 class Interface_Graph;
0028 class IFGraph_SubPartsIterator;
0029 
0030 //! A DispPerCount gathers all the input Entities into one or
0031 //! several Packets, each containing a defined count of Entity
0032 //! This count is a Parameter of the DispPerCount, given as an
0033 //! IntParam, thus allowing external control of its Value
0034 class IFSelect_DispPerCount : public IFSelect_Dispatch
0035 {
0036 
0037 public:
0038   //! Creates a DispPerCount with no Count (default value 1)
0039   Standard_EXPORT IFSelect_DispPerCount();
0040 
0041   //! Returns the Count Parameter used for splitting
0042   Standard_EXPORT occ::handle<IFSelect_IntParam> Count() const;
0043 
0044   //! Sets a new Parameter for Count
0045   Standard_EXPORT void SetCount(const occ::handle<IFSelect_IntParam>& count);
0046 
0047   //! Returns the effective value of the count parameter
0048   //! (if Count Parameter not Set or value not positive, returns 1)
0049   Standard_EXPORT int CountValue() const;
0050 
0051   //! Returns as Label, "One File per <count> Input Entities"
0052   Standard_EXPORT TCollection_AsciiString Label() const override;
0053 
0054   //! Returns True, maximum count is given as <nbent>
0055   Standard_EXPORT bool LimitedMax(const int nbent, int& max) const override;
0056 
0057   //! Computes the list of produced Packets. It defines Packets in
0058   //! order to have at most <Count> Entities per Packet, Entities
0059   //! are given by RootResult from the Final Selection.
0060   Standard_EXPORT void Packets(const Interface_Graph&    G,
0061                                IFGraph_SubPartsIterator& packs) const override;
0062 
0063   DEFINE_STANDARD_RTTIEXT(IFSelect_DispPerCount, IFSelect_Dispatch)
0064 
0065 private:
0066   occ::handle<IFSelect_IntParam> thecount;
0067 };
0068 
0069 #endif // _IFSelect_DispPerCount_HeaderFile