0026377: Passing Handle objects as arguments to functions as non-const reference...
[occt.git] / src / IFSelect / IFSelect_DispPerCount.hxx
CommitLineData
42cf5bc1 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
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_DispPerCount_HeaderFile
18#define _IFSelect_DispPerCount_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <IFSelect_Dispatch.hxx>
24#include <Standard_Integer.hxx>
25#include <Standard_Boolean.hxx>
26class IFSelect_IntParam;
27class Interface_InterfaceError;
28class TCollection_AsciiString;
29class Interface_Graph;
30class IFGraph_SubPartsIterator;
31
32
33class IFSelect_DispPerCount;
34DEFINE_STANDARD_HANDLE(IFSelect_DispPerCount, IFSelect_Dispatch)
35
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
40class IFSelect_DispPerCount : public IFSelect_Dispatch
41{
42
43public:
44
45
46 //! Creates a DispPerCount with no Count (default value 1)
47 Standard_EXPORT IFSelect_DispPerCount();
48
49 //! Returns the Count Parameter used for splitting
50 Standard_EXPORT Handle(IFSelect_IntParam) Count() const;
51
52 //! Sets a new Parameter for Count
53 Standard_EXPORT void SetCount (const Handle(IFSelect_IntParam)& count);
54
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;
58
59 //! Returns as Label, "One File per <count> Input Entities"
79104795 60 Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE;
42cf5bc1 61
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;
64
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;
68
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.
79104795 72 Standard_EXPORT void Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const Standard_OVERRIDE;
42cf5bc1 73
74
75
76
92efcf78 77 DEFINE_STANDARD_RTTIEXT(IFSelect_DispPerCount,IFSelect_Dispatch)
42cf5bc1 78
79protected:
80
81
82
83
84private:
85
86
87 Handle(IFSelect_IntParam) thecount;
88
89
90};
91
92
93
94
95
96
97
98#endif // _IFSelect_DispPerCount_HeaderFile