42cf5bc1 |
1 | // Created on: 1998-10-19 |
2 | // Created by: Christian CAILLET |
3 | // Copyright (c) 1998-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_SelectSuite_HeaderFile |
18 | #define _IFSelect_SelectSuite_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <TCollection_AsciiString.hxx> |
24 | #include <TColStd_SequenceOfTransient.hxx> |
25 | #include <IFSelect_SelectDeduct.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | #include <Standard_Integer.hxx> |
28 | #include <Standard_CString.hxx> |
29 | class Interface_InterfaceError; |
30 | class IFSelect_Selection; |
31 | class IFSelect_SelectDeduct; |
32 | class Interface_EntityIterator; |
33 | class Interface_Graph; |
34 | class TCollection_AsciiString; |
35 | |
36 | |
37 | class IFSelect_SelectSuite; |
38 | DEFINE_STANDARD_HANDLE(IFSelect_SelectSuite, IFSelect_SelectDeduct) |
39 | |
40 | //! A SelectSuite can describe a suite of SelectDeduct as a unique |
41 | //! one : in other words, it can be seen as a "macro selection" |
42 | //! |
43 | //! It works by applying each of its items (which is a |
44 | //! SelectDeduct) on the result computed by the previous one |
45 | //! (by using Alternate Input) |
46 | //! |
47 | //! But each of these Selections used as items may be used |
48 | //! independently, it will then give its own result |
49 | //! |
50 | //! Hence, SelectSuite gives a way of defining a new Selection |
51 | //! from existing ones, without having to do copies or saves |
52 | class IFSelect_SelectSuite : public IFSelect_SelectDeduct |
53 | { |
54 | |
55 | public: |
56 | |
57 | |
58 | //! Creates an empty SelectSuite |
59 | Standard_EXPORT IFSelect_SelectSuite(); |
60 | |
61 | //! Adds an input selection. I.E. : |
62 | //! If <item> is a SelectDeduct, adds it as Previous, not as Input |
63 | //! Else, sets it as Input |
64 | //! Returns True when done |
65 | //! Returns False and refuses to work if Input is already defined |
66 | Standard_EXPORT Standard_Boolean AddInput (const Handle(IFSelect_Selection)& item); |
67 | |
68 | //! Adds a new first item (prepends to the list). The Input is not |
69 | //! touched |
70 | //! If <item> is null, does nothing |
71 | Standard_EXPORT void AddPrevious (const Handle(IFSelect_SelectDeduct)& item); |
72 | |
73 | //! Adds a new last item (prepends to the list) |
74 | //! If <item> is null, does nothing |
75 | Standard_EXPORT void AddNext (const Handle(IFSelect_SelectDeduct)& item); |
76 | |
77 | //! Returns the count of Items |
78 | Standard_EXPORT Standard_Integer NbItems() const; |
79 | |
80 | //! Returns an item from its rank in the list |
81 | //! (the Input is always apart) |
82 | Standard_EXPORT Handle(IFSelect_SelectDeduct) Item (const Standard_Integer num) const; |
83 | |
84 | //! Sets a value for the Label |
85 | Standard_EXPORT void SetLabel (const Standard_CString lab); |
86 | |
87 | //! Returns the list of selected entities |
88 | //! To do this, once InputResult has been taken (if Input or |
89 | //! Alternate has been defined, else the first Item gives it) : |
90 | //! this result is set as alternate input for the first item, |
91 | //! which computes its result : this result is set as alternate |
92 | //! input for the second item, etc... |
79104795 |
93 | Standard_EXPORT Interface_EntityIterator RootResult (const Interface_Graph& G) const Standard_OVERRIDE; |
42cf5bc1 |
94 | |
95 | //! Returns the Label |
96 | //! Either it has been defined by SetLabel, or it will give |
97 | //! "Suite of nn Selections" |
79104795 |
98 | Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE; |
42cf5bc1 |
99 | |
100 | |
101 | |
102 | |
92efcf78 |
103 | DEFINE_STANDARD_RTTIEXT(IFSelect_SelectSuite,IFSelect_SelectDeduct) |
42cf5bc1 |
104 | |
105 | protected: |
106 | |
107 | |
108 | |
109 | |
110 | private: |
111 | |
112 | |
113 | TCollection_AsciiString thelab; |
114 | TColStd_SequenceOfTransient thesel; |
115 | |
116 | |
117 | }; |
118 | |
119 | |
120 | |
121 | |
122 | |
123 | |
124 | |
125 | #endif // _IFSelect_SelectSuite_HeaderFile |