summaryrefslogtreecommitdiff
path: root/inc/IFSelect_ContextModif.hxx
blob: d00cca6a90d7432ed20409002c146d7dde87b529 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _IFSelect_ContextModif_HeaderFile
#define _IFSelect_ContextModif_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _Interface_Graph_HeaderFile
#include <Interface_Graph.hxx>
#endif
#ifndef _Handle_Interface_Protocol_HeaderFile
#include <Handle_Interface_Protocol.hxx>
#endif
#ifndef _Handle_Interface_CopyControl_HeaderFile
#include <Handle_Interface_CopyControl.hxx>
#endif
#ifndef _TCollection_AsciiString_HeaderFile
#include <TCollection_AsciiString.hxx>
#endif
#ifndef _Interface_CheckIterator_HeaderFile
#include <Interface_CheckIterator.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_CString_HeaderFile
#include <Standard_CString.hxx>
#endif
#ifndef _Handle_Interface_InterfaceModel_HeaderFile
#include <Handle_Interface_InterfaceModel.hxx>
#endif
#ifndef _Handle_Standard_Transient_HeaderFile
#include <Handle_Standard_Transient.hxx>
#endif
#ifndef _Handle_IFSelect_GeneralModifier_HeaderFile
#include <Handle_IFSelect_GeneralModifier.hxx>
#endif
#ifndef _Handle_Interface_Check_HeaderFile
#include <Handle_Interface_Check.hxx>
#endif
class Interface_Protocol;
class Interface_CopyControl;
class Standard_NoSuchObject;
class Interface_Graph;
class Interface_CopyTool;
class Interface_EntityIterator;
class Interface_InterfaceModel;
class Standard_Transient;
class IFSelect_GeneralModifier;
class Interface_Check;
class Interface_CheckIterator;


//! This class gathers various informations used by Model Modifiers <br>
//!           apart from the target model itself, and the CopyTool which <br>
//!           must be passed directly. <br>
//! <br>
//!           These informations report to original data : model, entities, <br>
//!           and the selection list if there is one : it allows to query <br>
//!           about such or such starting entity, or result entity, or <br>
//!           iterate on selection list ... <br>
//!           Also data useful for file output are available (because some <br>
//!           Modifiers concern models produced for file output). <br>
//! <br>
//!           Furthermore, in return, ContextModif can record Checks, either <br>
//!           one for all, or one for each Entity. It supports trace too. <br>
class IFSelect_ContextModif  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  //! Prepares a ContextModif with these informations : <br>
//!           - the graph established from original model (target passed <br>
//!             directly to Modifier) <br>
//!           - the CopyTool which detains the CopyControl, which maps <br>
//!             starting (in original) and result (in target) entities <br>
//!           - an optional file name (for file output) <br>
//! <br>
//!           Such a ContextModif is considered to be applied on all <br>
//!           transferred entities (no filter active) <br>
  Standard_EXPORT   IFSelect_ContextModif(const Interface_Graph& graph,const Interface_CopyTool& TC,const Standard_CString filename = "");
  //! Prepares a ContextModif with these informations : <br>
//!           - the graph established from original model (target passed <br>
//!             directly to Modifier) <br>
//!           - an optional file name (for file output) <br>
//!           Here, no CopyControl, hence all entities are considered equal <br>
//!           as starting and result <br>
//! <br>
//!           Such a ContextModif is considered to be applied on all <br>
//!           transferred entities (no filter active) <br>
  Standard_EXPORT   IFSelect_ContextModif(const Interface_Graph& graph,const Standard_CString filename = "");
  //! This method requires ContextModif to be applied with a filter. <br>
//!           If a ModelModifier is defined with a Selection criterium, <br>
//!           the result of this Selection is used as a filter : <br>
//!           - if none of its items has been transferred, the modification <br>
//!             does not apply at all <br>
//!           - else, the Modifier can query for what entities were selected <br>
//!             and what are their results <br>
//!           - if this method is not called before working, the Modifier <br>
//!             has to work on the whole Model <br>
  Standard_EXPORT     void Select(Interface_EntityIterator& list) ;
  //! Returns the original Graph (compared to OriginalModel, it <br>
//!           gives more query capabilitites) <br>
  Standard_EXPORT    const Interface_Graph& OriginalGraph() const;
  //! Returns the original model <br>
  Standard_EXPORT     Handle_Interface_InterfaceModel OriginalModel() const;
  //! Allows to transmit a Protocol as part of a ContextModif <br>
  Standard_EXPORT     void SetProtocol(const Handle(Interface_Protocol)& proto) ;
  //! Returns the Protocol (Null if not set) <br>
  Standard_EXPORT     Handle_Interface_Protocol Protocol() const;
  //! Returns True if a non empty file name has been defined <br>
  Standard_EXPORT     Standard_Boolean HasFileName() const;
  //! Returns File Name (can be empty) <br>
  Standard_EXPORT     Standard_CString FileName() const;
  //! Returns the map for a direct use, if required <br>
  Standard_EXPORT     Handle_Interface_CopyControl Control() const;
  //! Returns True if Select has determined that a Modifier may not <br>
//!           be run (filter defined and empty) <br>
  Standard_EXPORT     Standard_Boolean IsForNone() const;
  //! Returns True if no filter is defined : a Modifier has to work <br>
//!           on all entities of the resulting (target) model <br>
  Standard_EXPORT     Standard_Boolean IsForAll() const;
  //! Returns True if a starting item has been transferred <br>
  Standard_EXPORT     Standard_Boolean IsTransferred(const Handle(Standard_Transient)& ent) const;
  //! Returns True if a starting item has been transferred and selected <br>
  Standard_EXPORT     Standard_Boolean IsSelected(const Handle(Standard_Transient)& ent) const;
  //! Returns True if a starting entity has been transferred, and <br>
//!           the result is in <res>. Returns False else <br>
//!           (direct call to the map) <br>
  Standard_EXPORT     Standard_Boolean Search(const Handle(Standard_Transient)& ent,Handle(Standard_Transient)& res) const;
  //! Returns the list of original selected items. <br>
//!           See also the iteration <br>
  Standard_EXPORT     Interface_EntityIterator SelectedOriginal() const;
  //! Returns the list of resulting counterparts of selected items. <br>
//!           See also the iteration <br>
  Standard_EXPORT     Interface_EntityIterator SelectedResult() const;
  //! Returns the count of selected and transferred items <br>
  Standard_EXPORT     Standard_Integer SelectedCount() const;
  //! Starts an iteration on selected items. It takes into account <br>
//!           IsForAll/IsForNone, by really iterating on all selected items. <br>
  Standard_EXPORT     void Start() ;
  //! Returns True until the iteration has finished <br>
  Standard_EXPORT     Standard_Boolean More() const;
  //! Advances the iteration <br>
  Standard_EXPORT     void Next() ;
  //! Returns the current selected item in the original model <br>
  Standard_EXPORT     Handle_Standard_Transient ValueOriginal() const;
  //! Returns the result counterpart of current selected item <br>
//!           (in the target model) <br>
  Standard_EXPORT     Handle_Standard_Transient ValueResult() const;
  //! Traces the application of a Modifier. Works with default trace <br>
//!           File and Level. Fills the trace if default trace level is at <br>
//!           least 1. Traces the Modifier (its Label) and its Selection if <br>
//!           there is one (its Label). <br>
//!           To be called after Select (because status IsForAll is printed) <br>
//!           Worths to trace a global modification. See also Trace below <br>
  Standard_EXPORT     void TraceModifier(const Handle(IFSelect_GeneralModifier)& modif) ;
  //! Traces the modification of the current entity (see above, <br>
//!           ValueOriginal and ValueResult) for default trace level >= 2. <br>
//!           To be called on each indivudual entity really modified <br>
//!           <mess> is an optionnal additional message <br>
  Standard_EXPORT     void Trace(const Standard_CString mess = "") ;
  //! Adds a Check to the CheckList. If it is empty, nothing is done <br>
//!           If it concerns an Entity from the Original Model (by SetEntity) <br>
//!           to which another Check is attached, it is merged to it. <br>
//!           Else, it is added or merged as to GlobalCheck. <br>
  Standard_EXPORT     void AddCheck(const Handle(Interface_Check)& check) ;
  //! Adds a Warning Message for an Entity from the original Model <br>
//!           If <start> is not an Entity from the original model (e.g. the <br>
//!           model itself) this message is added to Global Check. <br>
  Standard_EXPORT     void AddWarning(const Handle(Standard_Transient)& start,const Standard_CString mess,const Standard_CString orig = "") ;
  //! Adds a Fail Message for an Entity from the original Model <br>
//!           If <start> is not an Entity from the original model (e.g. the <br>
//!           model itself) this message is added to Global Check. <br>
  Standard_EXPORT     void AddFail(const Handle(Standard_Transient)& start,const Standard_CString mess,const Standard_CString orig = "") ;
  //! Returns a Check given an Entity number (in the original Model) <br>
//!           by default a Global Check. Creates it the first time. <br>
//!           It can then be acknowledged on the spot, in condition that the <br>
//!           caller works by reference ("Interface_Check& check = ...") <br>
  Standard_EXPORT     Handle_Interface_Check CCheck(const Standard_Integer num = 0) ;
  //! Returns a Check attached to an Entity from the original Model <br>
//!           It can then be acknowledged on the spot, in condition that the <br>
//!           caller works by reference ("Interface_Check& check = ...") <br>
  Standard_EXPORT     Handle_Interface_Check CCheck(const Handle(Standard_Transient)& start) ;
  //! Returns the complete CheckList <br>
  Standard_EXPORT     Interface_CheckIterator CheckList() const;





protected:





private:



Interface_Graph thegraf;
Handle_Interface_Protocol theprot;
Handle_Interface_CopyControl themap;
TCollection_AsciiString thefile;
TCollection_AsciiString thelist;
Interface_CheckIterator thechek;
Standard_Boolean thesel;
Standard_Integer thecurr;
Standard_Integer thecurt;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif