1 // Created by: DAUTRY Philippe
2 // Copyright (c) 1997-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _DDF_Browser_HeaderFile
17 #define _DDF_Browser_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
22 #include <TDF_AttributeIndexedMap.hxx>
23 #include <Draw_Drawable3D.hxx>
24 #include <Standard_OStream.hxx>
25 #include <Draw_Interpretor.hxx>
26 #include <Standard_Integer.hxx>
29 class Draw_Drawable3D;
30 class TCollection_AsciiString;
35 DEFINE_STANDARD_HANDLE(DDF_Browser, Draw_Drawable3D)
37 //! Browses a data framework from TDF.
38 class DDF_Browser : public Draw_Drawable3D
44 Standard_EXPORT DDF_Browser(const Handle(TDF_Data)& aDF);
46 Standard_EXPORT void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
48 Standard_EXPORT virtual Handle(Draw_Drawable3D) Copy() const Standard_OVERRIDE;
50 Standard_EXPORT virtual void Dump (Standard_OStream& S) const Standard_OVERRIDE;
52 Standard_EXPORT virtual void Whatis (Draw_Interpretor& I) const Standard_OVERRIDE;
54 Standard_EXPORT void Data (const Handle(TDF_Data)& aDF);
56 Standard_EXPORT Handle(TDF_Data) Data() const;
58 //! Returns a string composed with the sub-label
59 //! entries of <myDF>.
60 Standard_EXPORT TCollection_AsciiString OpenRoot() const;
62 //! Returns a string composed with the sub-label
63 //! entries of <aLab>.
64 Standard_EXPORT TCollection_AsciiString OpenLabel (const TDF_Label& aLab) const;
66 //! Returns a string composed with the attribute index
67 //! (found in <myAttMap>) of <aLab>.
68 Standard_EXPORT TCollection_AsciiString OpenAttributeList (const TDF_Label& aLab);
70 //! Returns a string composed with the list of
71 //! referenced attribute index of the attribute
72 //! <anIndex>. For exemple, it is usefull for
73 //! TDataStd_Group. It uses a mecanism based on a
74 //! DDF_AttributeBrowser.
75 Standard_EXPORT TCollection_AsciiString OpenAttribute (const Standard_Integer anIndex = 0);
77 //! Returns information about <me> to be displayed in
78 //! information window.
79 Standard_EXPORT TCollection_AsciiString Information() const;
81 //! Returns information about <aLab> to be displayed
82 //! in information window.
83 Standard_EXPORT TCollection_AsciiString Information (const TDF_Label& aLab) const;
85 //! Returns information about attribute <anIndex> to
86 //! be displayed in information window.
87 Standard_EXPORT TCollection_AsciiString Information (const Standard_Integer anIndex = 0) const;
92 DEFINE_STANDARD_RTTIEXT(DDF_Browser,Draw_Drawable3D)
102 Handle(TDF_Data) myDF;
103 TDF_AttributeIndexedMap myAttMap;
114 #endif // _DDF_Browser_HeaderFile