0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation...
[occt.git] / src / TDF / TDF_AttributeIterator.hxx
1 // Created by: DAUTRY Philippe
2 // Copyright (c) 1998-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 //              -------------------------
17
18 // Version:     0.0
19 //Version       Date            Purpose
20 //              0.0     Feb 16 1998     Creation
21
22 #ifndef TDF_AttributeIterator_HeaderFile
23 #define TDF_AttributeIterator_HeaderFile
24
25 #include <TDF_Attribute.hxx>
26 #include <TDF_Label.hxx>
27 #include <TDF_LabelNodePtr.hxx>
28
29 // This class provides a way to iterates on the
30 // up-to-date (current) valid attributes of a label.
31 //
32 // This class should not be used for standard attributes workflow.
33 // Application allways knows what to search at particular label.
34 // So, use IsAttribute and FindAttibute methods of
35 // TDF_Label to check and get attributes in usual way.
36 // This class may be used for processing of content of labels
37 // in generic way, like copy-tool, specific save/restore algorithms,
38 // etc.
39 //
40 // Even a forgotten attribute may be found if this
41 // option is set. To use this possibility, look at
42 // the constructor.
43
44 class TDF_AttributeIterator  {
45
46 public:
47
48   // Methods PUBLIC
49   // 
50   Standard_EXPORT TDF_AttributeIterator();
51   Standard_EXPORT TDF_AttributeIterator
52     (const TDF_Label& aLabel,
53      const Standard_Boolean withoutForgotten = Standard_True);
54   Standard_EXPORT TDF_AttributeIterator
55     (const TDF_LabelNodePtr aLabelNode,
56      const Standard_Boolean withoutForgotten = Standard_True);
57   Standard_EXPORT   void Initialize
58     (const TDF_Label& aLabel,
59      const Standard_Boolean withoutForgotten = Standard_True) ;
60   inline   Standard_Boolean More() const;
61   Standard_EXPORT   void Next() ;
62   inline   Handle(TDF_Attribute) Value() const;
63
64
65 protected:
66
67  // Methods PROTECTED
68  // 
69
70
71  // Fields PROTECTED
72  //
73
74
75 private: 
76
77  // Methods PRIVATE
78  // 
79   void goToNext (const Handle(TDF_Attribute)& anAttr);
80
81
82  // Fields PRIVATE
83  //
84   TDF_Attribute    * myValue;
85   Standard_Boolean myWithoutForgotten;
86 };
87
88
89 // other inline functions and methods (like "C++: function call" methods)
90 //
91
92 inline Standard_Boolean TDF_AttributeIterator::More() const
93 { return (myValue != 0L); }
94
95 inline Handle(TDF_Attribute) TDF_AttributeIterator::Value() const
96 { return myValue; }
97
98 #endif