Integration of OCCT 6.5.0 from SVN
[occt.git] / src / DDF / DDF_AttributeBrowser.cxx
CommitLineData
7fd59977 1// File: DDF_AttributeBrowser.cxx
2// ------------------------
3// Author: DAUTRY Philippe
4// <fid@fox.paris1.matra-dtv.fr>
5// Copyright: Matra Datavision 1997
6
7// Version: 0.0
8// History: Version Date Purpose
9// 0.0 Oct 6 1997 Creation
10
11
12
13#include <DDF_AttributeBrowser.hxx>
14
15static DDF_AttributeBrowser* DDF_FirstBrowser = NULL;
16
17//=======================================================================
18//function : DDF_AttributeBrowser
19//purpose :
20//=======================================================================
21
22DDF_AttributeBrowser::DDF_AttributeBrowser
23(Standard_Boolean (*test)(const Handle(TDF_Attribute)&),
24 TCollection_AsciiString (*open)(const Handle(TDF_Attribute)&),
25 TCollection_AsciiString (*text)(const Handle(TDF_Attribute)&))
26: myTest(test),
27 myOpen(open),
28 myText(text),
29 myNext(DDF_FirstBrowser)
30{
31 DDF_FirstBrowser = this;
32}
33
34
35//=======================================================================
36//function : Test
37//purpose :
38//=======================================================================
39
40Standard_Boolean DDF_AttributeBrowser::Test
41(const Handle(TDF_Attribute)&anAtt) const
42{return (*myTest) (anAtt);}
43
44
45//=======================================================================
46//function : Open
47//purpose :
48//=======================================================================
49
50TCollection_AsciiString DDF_AttributeBrowser::Open
51(const Handle(TDF_Attribute)& anAtt) const
52{ return (*myOpen) (anAtt);}
53
54
55//=======================================================================
56//function : Text
57//purpose :
58//=======================================================================
59
60TCollection_AsciiString DDF_AttributeBrowser::Text
61(const Handle(TDF_Attribute)& anAtt) const
62{return (*myText) (anAtt);}
63
64
65//=======================================================================
66//function : FindBrowser
67//purpose :
68//=======================================================================
69
70DDF_AttributeBrowser* DDF_AttributeBrowser::FindBrowser
71(const Handle(TDF_Attribute)&anAtt)
72{
73 DDF_AttributeBrowser* browser = DDF_FirstBrowser;
74 while (browser) {
75 if (browser->Test(anAtt)) break;
76 browser = browser->Next();
77 }
78 return browser;
79}