summaryrefslogtreecommitdiff
path: root/inc/TDF_IDFilter.hxx
blob: 2695873e2cdacfd8227900b8a3b8dc43eaed0e6a (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
// 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 _TDF_IDFilter_HeaderFile
#define _TDF_IDFilter_HeaderFile

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

#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _TDF_IDMap_HeaderFile
#include <TDF_IDMap.hxx>
#endif
#ifndef _Handle_TDF_Attribute_HeaderFile
#include <Handle_TDF_Attribute.hxx>
#endif
#ifndef _Standard_OStream_HeaderFile
#include <Standard_OStream.hxx>
#endif
class Standard_GUID;
class TDF_IDList;
class TDF_Attribute;


//! This class offers filtering services around an ID list. <br>
class TDF_IDFilter  {
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); 
  }

  //! Creates an ID/attribute filter based on an ID <br>
//!          list. The default mode is "ignore all but...". <br>
//! <br>
//!          This filter has 2 working mode: keep and ignore. <br>
//! <br>
//!          Ignore/Exclusive mode: all IDs are ignored except <br>
//!          these set to be kept, using Keep(). Of course, it <br>
//!          is possible set an kept ID to be ignored using <br>
//!          Ignore(). <br>
//! <br>
//!          Keep/Inclusive mode: all IDs are kept except these <br>
//!          set to be ignored, using Ignore(). Of course, it <br>
//!          is possible set an ignored ID to be kept using <br>
//!          Keep(). <br>
  Standard_EXPORT   TDF_IDFilter(const Standard_Boolean ignoreMode = Standard_True);
  //! The list of ID is cleared and the filter mode is <br>
//!          set to ignore mode if <keep> is true; false <br>
//!          otherwise. <br>
  Standard_EXPORT     void IgnoreAll(const Standard_Boolean ignore) ;
  //! Returns true is the mode is set to "ignore all <br>
//!          but...". <br>
//! <br>
        Standard_Boolean IgnoreAll() const;
  //! An attribute with <anID> as ID is to be kept and <br>
//!          the filter will answer true to the question <br>
//!          IsKept(<anID>). <br>
  Standard_EXPORT     void Keep(const Standard_GUID& anID) ;
  //! Attributes with ID owned by <anIDList> are to be kept and <br>
//!          the filter will answer true to the question <br>
//!          IsKept(<anID>) with ID from <anIDList>. <br>
  Standard_EXPORT     void Keep(const TDF_IDList& anIDList) ;
  //! An attribute with <anID> as ID is to be ignored and <br>
//!          the filter will answer false to the question <br>
//!          IsKept(<anID>). <br>
  Standard_EXPORT     void Ignore(const Standard_GUID& anID) ;
  //! Attributes with ID owned by <anIDList> are to be <br>
//!          ignored and the filter will answer false to the <br>
//!          question IsKept(<anID>) with ID from <anIDList>. <br>
  Standard_EXPORT     void Ignore(const TDF_IDList& anIDList) ;
  //! Returns true if the ID is to be kept. <br>
//! <br>
        Standard_Boolean IsKept(const Standard_GUID& anID) const;
  //! Returns true if the attribute is to be kept. <br>
//! <br>
        Standard_Boolean IsKept(const Handle(TDF_Attribute)& anAtt) const;
  //! Returns true if the ID is to be ignored. <br>
//! <br>
        Standard_Boolean IsIgnored(const Standard_GUID& anID) const;
  //! Returns true if the attribute is to be ignored. <br>
//! <br>
        Standard_Boolean IsIgnored(const Handle(TDF_Attribute)& anAtt) const;
  //! Copies the list of ID to be kept or ignored in <br>
//!          <anIDList>. <anIDList> is cleared before use. <br>
  Standard_EXPORT     void IDList(TDF_IDList& anIDList) const;
  //! Copies into <me> the contents of <br>
//!          <fromFilter>. <me> is cleared before copy. <br>
  Standard_EXPORT     void Copy(const TDF_IDFilter& fromFilter) ;
  //! Writes the contents of <me> to <OS>. <br>
  Standard_EXPORT     void Dump(Standard_OStream& anOS) const;





protected:





private:

  //! Private, to forbid implicit or hidden accesses to <br>
//!          the copy constructor. <br>
  Standard_EXPORT   TDF_IDFilter(const TDF_IDFilter& aFilter);


Standard_Boolean myIgnore;
TDF_IDMap myIDMap;


};


#include <TDF_IDFilter.lxx>



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


#endif