Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-04 08:33:20

0001 // Created by: DAUTRY Philippe
0002 // Copyright (c) 1997-1999 Matra Datavision
0003 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _TDF_DataSet_HeaderFile
0017 #define _TDF_DataSet_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 
0021 #include <TDF_LabelList.hxx>
0022 #include <TDF_LabelMap.hxx>
0023 #include <TDF_AttributeMap.hxx>
0024 #include <Standard_Transient.hxx>
0025 #include <Standard_Boolean.hxx>
0026 #include <Standard_OStream.hxx>
0027 class TDF_Label;
0028 class TDF_Attribute;
0029 
0030 class TDF_DataSet;
0031 DEFINE_STANDARD_HANDLE(TDF_DataSet, Standard_Transient)
0032 
0033 //! This class is a set of TDF information like labels and attributes.
0034 class TDF_DataSet : public Standard_Transient
0035 {
0036 
0037 public:
0038   //! Creates an  empty   DataSet  object.
0039   Standard_EXPORT TDF_DataSet();
0040 
0041   //! Clears all information.
0042   Standard_EXPORT void Clear();
0043 
0044   //! Returns true if there is at least one label or one
0045   //! attribute.
0046   Standard_Boolean IsEmpty() const;
0047 
0048   //! Adds <aLabel> in  the  current  data  set.
0049   void AddLabel(const TDF_Label& aLabel);
0050 
0051   //! Returns true if the label  <alabel>   is in the data set.
0052   Standard_Boolean ContainsLabel(const TDF_Label& aLabel) const;
0053 
0054   //! Returns the map of labels in this data set.
0055   //! This map can be used directly, or updated.
0056   TDF_LabelMap& Labels();
0057 
0058   //! Adds <anAttribute> into the current data  set.
0059   void AddAttribute(const Handle(TDF_Attribute)& anAttribute);
0060 
0061   //! Returns true if <anAttribute> is in the data set.
0062   Standard_Boolean ContainsAttribute(const Handle(TDF_Attribute)& anAttribute) const;
0063 
0064   //! Returns the map of attributes in the  current  data   set.
0065   //! This map can be used directly, or updated.
0066   TDF_AttributeMap& Attributes();
0067 
0068   //! Adds a root label to <myRootLabels>.
0069   void AddRoot(const TDF_Label& aLabel);
0070 
0071   //! Returns <myRootLabels> to be used or updated.
0072   TDF_LabelList& Roots();
0073 
0074   //! Dumps the minimum information about <me> on
0075   //! <aStream>.
0076   Standard_EXPORT Standard_OStream& Dump(Standard_OStream& anOS) const;
0077 
0078   Standard_OStream& operator<<(Standard_OStream& anOS) const { return Dump(anOS); }
0079 
0080   DEFINE_STANDARD_RTTIEXT(TDF_DataSet, Standard_Transient)
0081 
0082 protected:
0083 private:
0084   TDF_LabelList    myRootLabels;
0085   TDF_LabelMap     myLabelMap;
0086   TDF_AttributeMap myAttributeMap;
0087 };
0088 
0089 #include <TDF_DataSet.lxx>
0090 
0091 #endif // _TDF_DataSet_HeaderFile