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 _TDF_DataSet_HeaderFile
17 #define _TDF_DataSet_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
22 #include <TDF_LabelList.hxx>
23 #include <TDF_LabelMap.hxx>
24 #include <TDF_AttributeMap.hxx>
25 #include <Standard_Transient.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <Standard_OStream.hxx>
33 DEFINE_STANDARD_HANDLE(TDF_DataSet, Standard_Transient)
35 //! This class is a set of TDF informations like
36 //! labels and attributes.
37 class TDF_DataSet : public Standard_Transient
43 //! Creates an empty DataSet object.
44 Standard_EXPORT TDF_DataSet();
46 //! Clears all information.
47 Standard_EXPORT void Clear();
49 //! Returns true if there is at least one label or one
51 Standard_Boolean IsEmpty() const;
53 //! Adds <aLabel> in the current data set.
54 void AddLabel (const TDF_Label& aLabel);
56 //! Returns true if the label <alabel> is in the data set.
57 Standard_Boolean ContainsLabel (const TDF_Label& aLabel) const;
59 //! Returns the map of labels in this data set.
60 //! This map can be used directly, or updated.
61 TDF_LabelMap& Labels();
63 //! Adds <anAttribute> into the current data set.
64 void AddAttribute (const Handle(TDF_Attribute)& anAttribute);
66 //! Returns true if <anAttribute> is in the data set.
67 Standard_Boolean ContainsAttribute (const Handle(TDF_Attribute)& anAttribute) const;
69 //! Returns the map of attributes in the current data set.
70 //! This map can be used directly, or updated.
71 TDF_AttributeMap& Attributes();
73 //! Adds a root label to <myRootLabels>.
74 void AddRoot (const TDF_Label& aLabel);
76 //! Returns <myRootLabels> to be used or updated.
77 TDF_LabelList& Roots();
79 //! Dumps the minimum information about <me> on
81 Standard_EXPORT Standard_OStream& Dump (Standard_OStream& anOS) const;
82 Standard_OStream& operator<< (Standard_OStream& anOS) const
90 DEFINE_STANDARD_RTTIEXT(TDF_DataSet,Standard_Transient)
100 TDF_LabelList myRootLabels;
101 TDF_LabelMap myLabelMap;
102 TDF_AttributeMap myAttributeMap;
108 #include <TDF_DataSet.lxx>
114 #endif // _TDF_DataSet_HeaderFile