Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-28 09:20:26

0001 // Created on: 1994-12-21
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1994-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_DispPerFiles_HeaderFile
0018 #define _IFSelect_DispPerFiles_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 DispPerFiles produces a determined count of Packets from the
0031 //! input Entities. It divides, as equally as possible, the input
0032 //! list into a count of files. This count is the parameter of the
0033 //! DispPerFiles. If the input list has less than this count, of
0034 //! course there will be one packet per input entity.
0035 //! This count is a Parameter of the DispPerFiles, given as an
0036 //! IntParam, thus allowing external control of its Value
0037 class IFSelect_DispPerFiles : public IFSelect_Dispatch
0038 {
0039 
0040 public:
0041   //! Creates a DispPerFiles with no Count (default value 1 file)
0042   Standard_EXPORT IFSelect_DispPerFiles();
0043 
0044   //! Returns the Count Parameter used for splitting
0045   Standard_EXPORT occ::handle<IFSelect_IntParam> Count() const;
0046 
0047   //! Sets a new Parameter for Count
0048   Standard_EXPORT void SetCount(const occ::handle<IFSelect_IntParam>& count);
0049 
0050   //! Returns the effective value of the count parameter
0051   //! (if Count Parameter not Set or value not positive, returns 1)
0052   Standard_EXPORT int CountValue() const;
0053 
0054   //! Returns as Label, "Maximum <count> Files"
0055   Standard_EXPORT TCollection_AsciiString Label() const override;
0056 
0057   //! Returns True, maximum count is given as CountValue
0058   Standard_EXPORT bool LimitedMax(const int nbent, int& max) const override;
0059 
0060   //! Computes the list of produced Packets. It defines Packets in
0061   //! order to have <Count> Packets, except if the input count of
0062   //! Entities is lower. Entities are given by RootResult from the
0063   //! Final Selection.
0064   Standard_EXPORT void Packets(const Interface_Graph&    G,
0065                                IFGraph_SubPartsIterator& packs) const override;
0066 
0067   DEFINE_STANDARD_RTTIEXT(IFSelect_DispPerFiles, IFSelect_Dispatch)
0068 
0069 private:
0070   occ::handle<IFSelect_IntParam> thecount;
0071 };
0072 
0073 #endif // _IFSelect_DispPerFiles_HeaderFile