1 // Created by: DAUTRY Philippe 2 // Copyright (c) 1997-1999 Matra Datavision 3 // Copyright (c) 1999-2014 OPEN CASCADE SAS 4 // 5 // This file is part of Open CASCADE Technology software library. 6 // 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. 12 // 13 // Alternatively, this file may be used under the terms of Open CASCADE 14 // commercial license or contractual agreement. 15 16 #ifndef _TDF_DataSet_HeaderFile 17 #define _TDF_DataSet_HeaderFile 18 19 #include <Standard.hxx> 20 #include <Standard_Type.hxx> 21 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> 28 class TDF_Label; 29 class TDF_Attribute; 30 31 32 class TDF_DataSet; 33 DEFINE_STANDARD_HANDLE(TDF_DataSet, Standard_Transient) 34 35 //! This class is a set of TDF information like labels and attributes. 36 class TDF_DataSet : public Standard_Transient 37 { 38 39 public: 40 41 42 //! Creates an empty DataSet object. 43 Standard_EXPORT TDF_DataSet(); 44 45 //! Clears all information. 46 Standard_EXPORT void Clear(); 47 48 //! Returns true if there is at least one label or one 49 //! attribute. 50 Standard_Boolean IsEmpty() const; 51 52 //! Adds <aLabel> in the current data set. 53 void AddLabel (const TDF_Label& aLabel); 54 55 //! Returns true if the label <alabel> is in the data set. 56 Standard_Boolean ContainsLabel (const TDF_Label& aLabel) const; 57 58 //! Returns the map of labels in this data set. 59 //! This map can be used directly, or updated. 60 TDF_LabelMap& Labels(); 61 62 //! Adds <anAttribute> into the current data set. 63 void AddAttribute (const Handle(TDF_Attribute)& anAttribute); 64 65 //! Returns true if <anAttribute> is in the data set. 66 Standard_Boolean ContainsAttribute (const Handle(TDF_Attribute)& anAttribute) const; 67 68 //! Returns the map of attributes in the current data set. 69 //! This map can be used directly, or updated. 70 TDF_AttributeMap& Attributes(); 71 72 //! Adds a root label to <myRootLabels>. 73 void AddRoot (const TDF_Label& aLabel); 74 75 //! Returns <myRootLabels> to be used or updated. 76 TDF_LabelList& Roots(); 77 78 //! Dumps the minimum information about <me> on 79 //! <aStream>. 80 Standard_EXPORT Standard_OStream& Dump (Standard_OStream& anOS) const; operator <<(Standard_OStream & anOS) const81Standard_OStream& operator<< (Standard_OStream& anOS) const 82 { 83 return Dump(anOS); 84 } 85 86 87 88 89 DEFINE_STANDARD_RTTIEXT(TDF_DataSet,Standard_Transient) 90 91 protected: 92 93 94 95 96 private: 97 98 99 TDF_LabelList myRootLabels; 100 TDF_LabelMap myLabelMap; 101 TDF_AttributeMap myAttributeMap; 102 103 104 }; 105 106 107 #include <TDF_DataSet.lxx> 108 109 110 111 112 113 #endif // _TDF_DataSet_HeaderFile 114