summaryrefslogtreecommitdiff
path: root/src/DDF/DDF_AttributeBrowser.cxx
blob: 930fb813df3562142db8733e01dfc970dbee6cc0 (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
// File:	DDF_AttributeBrowser.cxx
//      	------------------------
// Author:	DAUTRY Philippe
//		<fid@fox.paris1.matra-dtv.fr>
// Copyright:	Matra Datavision 1997

// Version:	0.0
// History:	Version	Date		Purpose
//		0.0	Oct  6 1997	Creation



#include <DDF_AttributeBrowser.hxx>

static DDF_AttributeBrowser* DDF_FirstBrowser = NULL;

//=======================================================================
//function : DDF_AttributeBrowser
//purpose  : 
//=======================================================================

DDF_AttributeBrowser::DDF_AttributeBrowser
(Standard_Boolean (*test)(const Handle(TDF_Attribute)&),
 TCollection_AsciiString (*open)(const Handle(TDF_Attribute)&),
 TCollection_AsciiString (*text)(const Handle(TDF_Attribute)&))
: myTest(test),
  myOpen(open), 
  myText(text),
  myNext(DDF_FirstBrowser)
{
  DDF_FirstBrowser = this;
}


//=======================================================================
//function : Test
//purpose  : 
//=======================================================================

Standard_Boolean DDF_AttributeBrowser::Test
(const Handle(TDF_Attribute)&anAtt) const
{return (*myTest) (anAtt);}


//=======================================================================
//function : Open
//purpose  : 
//=======================================================================

TCollection_AsciiString DDF_AttributeBrowser::Open
(const Handle(TDF_Attribute)& anAtt) const
{ return (*myOpen) (anAtt);}


//=======================================================================
//function : Text
//purpose  : 
//=======================================================================

TCollection_AsciiString DDF_AttributeBrowser::Text
(const Handle(TDF_Attribute)& anAtt) const
{return (*myText) (anAtt);}


//=======================================================================
//function : FindBrowser
//purpose  : 
//=======================================================================

DDF_AttributeBrowser* DDF_AttributeBrowser::FindBrowser
(const Handle(TDF_Attribute)&anAtt)
{
  DDF_AttributeBrowser* browser = DDF_FirstBrowser;
  while (browser) {
    if (browser->Test(anAtt)) break;
    browser = browser->Next();
  }
  return browser;
}