1 // Created by: DAUTRY Philippe
2 // Copyright (c) 1997-1999 Matra Datavision
3 // Copyright (c) 1999-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
20 // ------------------------
23 //Version Date Purpose
24 // 0.0 Oct 6 1997 Creation
28 #include <DDF_AttributeBrowser.hxx>
30 static DDF_AttributeBrowser* DDF_FirstBrowser = NULL;
32 //=======================================================================
33 //function : DDF_AttributeBrowser
35 //=======================================================================
37 DDF_AttributeBrowser::DDF_AttributeBrowser
38 (Standard_Boolean (*test)(const Handle(TDF_Attribute)&),
39 TCollection_AsciiString (*open)(const Handle(TDF_Attribute)&),
40 TCollection_AsciiString (*text)(const Handle(TDF_Attribute)&))
44 myNext(DDF_FirstBrowser)
46 DDF_FirstBrowser = this;
50 //=======================================================================
53 //=======================================================================
55 Standard_Boolean DDF_AttributeBrowser::Test
56 (const Handle(TDF_Attribute)&anAtt) const
57 {return (*myTest) (anAtt);}
60 //=======================================================================
63 //=======================================================================
65 TCollection_AsciiString DDF_AttributeBrowser::Open
66 (const Handle(TDF_Attribute)& anAtt) const
67 { return (*myOpen) (anAtt);}
70 //=======================================================================
73 //=======================================================================
75 TCollection_AsciiString DDF_AttributeBrowser::Text
76 (const Handle(TDF_Attribute)& anAtt) const
77 {return (*myText) (anAtt);}
80 //=======================================================================
81 //function : FindBrowser
83 //=======================================================================
85 DDF_AttributeBrowser* DDF_AttributeBrowser::FindBrowser
86 (const Handle(TDF_Attribute)&anAtt)
88 DDF_AttributeBrowser* browser = DDF_FirstBrowser;
90 if (browser->Test(anAtt)) break;
91 browser = browser->Next();