1 // Created on: 1999-06-25
2 // Created by: Sergey RUIN
3 // Copyright (c) 1999-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #include <TDataStd_Directory.hxx>
19 #include <Standard_DomainError.hxx>
20 #include <Standard_Dump.hxx>
21 #include <Standard_GUID.hxx>
22 #include <Standard_Type.hxx>
23 #include <TDataStd.hxx>
24 #include <TDF_DataSet.hxx>
25 #include <TDF_Label.hxx>
26 #include <TDF_RelocationTable.hxx>
27 #include <TDF_TagSource.hxx>
29 IMPLEMENT_DERIVED_ATTRIBUTE(TDataStd_Directory,TDataStd_GenericEmpty)
31 //=======================================================================
34 //=======================================================================
35 Standard_Boolean TDataStd_Directory::Find (const TDF_Label& current,
36 Handle(TDataStd_Directory)& D)
38 TDF_Label L = current;
39 Handle(TDataStd_Directory) dir;
40 if (L.IsNull()) return Standard_False;
43 if(L.FindAttribute(TDataStd_Directory::GetID(), dir)) break;
45 if (L.IsNull()) break;
52 return Standard_False;
56 //=======================================================================
59 //=======================================================================
61 const Standard_GUID& TDataStd_Directory::GetID()
63 static Standard_GUID TDataStd_DirectoryID("2a96b61f-ec8b-11d0-bee7-080009dc3333");
64 return TDataStd_DirectoryID;
68 //=======================================================================
71 //=======================================================================
73 Handle(TDataStd_Directory) TDataStd_Directory::New (const TDF_Label& L)
75 if (L.HasAttribute()) {
76 throw Standard_DomainError("TDataStd_Directory::New : not an empty label");
78 Handle(TDataStd_Directory) A = new TDataStd_Directory ();
80 TDF_TagSource::Set(L);
85 //=======================================================================
86 //function : TDataStd_AddDirectory
88 //=======================================================================
90 Handle(TDataStd_Directory) TDataStd_Directory::AddDirectory(const Handle(TDataStd_Directory)& dir)
92 TDF_Label newLabel = TDF_TagSource::NewChild ( dir->Label() );
93 Handle(TDataStd_Directory) A = TDataStd_Directory::New (newLabel );
98 //=======================================================================
99 //function : TDataStd_MakeObjectLabel
101 //=======================================================================
103 TDF_Label TDataStd_Directory::MakeObjectLabel(const Handle(TDataStd_Directory)& dir)
105 return TDF_TagSource::NewChild ( dir->Label() );
108 //=======================================================================
109 //function : TDataStd_Directory
111 //=======================================================================
113 TDataStd_Directory::TDataStd_Directory()
117 //=======================================================================
120 //=======================================================================
122 const Standard_GUID& TDataStd_Directory::ID() const
126 //=======================================================================
127 //function : NewEmpty
129 //=======================================================================
131 //Handle(TDF_Attribute) TDataStd_Directory::NewEmpty () const
133 // return new TDataStd_Directory();
136 //=======================================================================
139 //=======================================================================
141 Standard_OStream& TDataStd_Directory::Dump (Standard_OStream& anOS) const