Warnings on vc14 were eliminated
[occt.git] / src / IFSelect / IFSelect_Dispatch.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_Dispatch_HeaderFile
18#define _IFSelect_Dispatch_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <MMgt_TShared.hxx>
24#include <Standard_Boolean.hxx>
25#include <Standard_Integer.hxx>
26class TCollection_HAsciiString;
27class IFSelect_Selection;
28class Interface_InterfaceError;
29class IFSelect_SelectionIterator;
30class TCollection_AsciiString;
31class Interface_EntityIterator;
32class Interface_Graph;
33class IFGraph_SubPartsIterator;
34
35
36class IFSelect_Dispatch;
37DEFINE_STANDARD_HANDLE(IFSelect_Dispatch, MMgt_TShared)
38
39//! This class allows to describe how a set of Entities has to be
40//! dispatched into resulting Packets : a Packet is a sub-set of
41//! the initial set of entities.
42//!
43//! Thus, it can generate zero, one, or more Packets according
44//! input set and criterium of dispatching. And it can let apart
45//! some entities : it is the Remainder, which can be recovered
46//! by a specific Selection (RemainderFromDispatch).
47//!
48//! Depending of sub-classes, a Dispatch can potentially generate
49//! a limited or not count of packet, and a remainder or none.
50//!
51//! The input set is read from a specified Selection, attached to
52//! the Dispatch : the Final Selection of the Dispatch. The input
53//! is the Unique Root Entities list of the Final Selection
54class IFSelect_Dispatch : public MMgt_TShared
55{
56
57public:
58
59
60 //! Sets a Root Name as an HAsciiString
61 //! To reset it, give a Null Handle (then, a ShareOut will have
62 //! to define the Default Root Name)
63 Standard_EXPORT void SetRootName (const Handle(TCollection_HAsciiString)& name);
64
65 //! Returns True if a specific Root Name has been set
66 //! (else, the Default Root Name has to be used)
67 Standard_EXPORT Standard_Boolean HasRootName() const;
68
69 //! Returns the Root Name for files produced by this dispatch
70 //! It is empty if it has not been set or if it has been reset
71 Standard_EXPORT const Handle(TCollection_HAsciiString)& RootName() const;
72
73 //! Stores (or Changes) the Final Selection for a Dispatch
74 Standard_EXPORT void SetFinalSelection (const Handle(IFSelect_Selection)& sel);
75
76 //! Returns the Final Selection of a Dispatch
77 //! we 'd like : C++ : return const &
78 Standard_EXPORT Handle(IFSelect_Selection) FinalSelection() const;
79
80 //! Returns the complete list of source Selections (starting
81 //! from FinalSelection)
82 Standard_EXPORT IFSelect_SelectionIterator Selections() const;
83
84 //! Returns True if a Dispatch can have a Remainder, i.e. if its
85 //! criterium can let entities apart. It is a potential answer,
86 //! remainder can be empty at run-time even if answer is True.
87 //! (to attach a RemainderFromDispatch Selection is not allowed if
88 //! answer is True).
89 //! Default answer given here is False (can be redefined)
90 Standard_EXPORT virtual Standard_Boolean CanHaveRemainder() const;
91
92 //! Returns True if a Dispatch generates a count of Packets always
93 //! less than or equal to a maximum value : it can be computed
94 //! from the total count of Entities to be dispatched : <nbent>.
95 //! If answer is False, no limited maximum is expected for account
96 //! If answer is True, expected maximum is given in argument <max>
97 //! Default answer given here is False (can be redefined)
98 Standard_EXPORT virtual Standard_Boolean LimitedMax (const Standard_Integer nbent, Standard_Integer& max) const;
99
100 //! Returns a text which defines the way a Dispatch produces
101 //! packets (which will become files) from its Input
102 Standard_EXPORT virtual TCollection_AsciiString Label() const = 0;
103
104 //! Gets Unique Root Entities from the Final Selection, given an
105 //! input Graph
106 //! This the starting step for an Evaluation (Packets - Remainder)
107 Standard_EXPORT Interface_EntityIterator GetEntities (const Interface_Graph& G) const;
dde68833 108
42cf5bc1 109 //! Returns the list of produced Packets into argument <pack>.
110 //! Each Packet corresponds to a Part, the Entities listed are the
111 //! Roots given by the Selection. Input is given as a Graph.
112 //! Thus, to create a file from a packet, it suffices to take the
113 //! entities listed in a Part of Packets (that is, a Packet)
114 //! without worrying about Shared entities
115 //! This method can raise an Exception if data are not coherent
116 Standard_EXPORT virtual void Packets (const Interface_Graph& G, IFGraph_SubPartsIterator& packs) const = 0;
117
118 //! Returns the list of all Input Entities (see GetEntities) which
119 //! are put in a Packet. That is, Entities listed in GetEntities
120 //! but not in Remainder (see below). Input is given as a Graph.
121 Standard_EXPORT Interface_EntityIterator Packeted (const Interface_Graph& G) const;
122
123 //! Returns Remainder which is a set of Entities. Can be empty.
124 //! Default evaluation is empty (has to be redefined if
125 //! CanHaveRemainder is redefined to return True).
126 Standard_EXPORT virtual Interface_EntityIterator Remainder (const Interface_Graph& G) const;
127
128
129
130
92efcf78 131 DEFINE_STANDARD_RTTIEXT(IFSelect_Dispatch,MMgt_TShared)
42cf5bc1 132
133protected:
134
135
136
137
138private:
139
140
141 Handle(TCollection_HAsciiString) thename;
142 Handle(IFSelect_Selection) thefinal;
143
144
145};
146
147
148
149
150
151
152
153#endif // _IFSelect_Dispatch_HeaderFile