Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:20

0001 // Created by: DAUTRY Philippe
0002 // Copyright (c) 1998-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 //          -------------------------
0017 
0018 // Version: 0.0
0019 //Version   Date        Purpose
0020 //      0.0 Feb 16 1998 Creation
0021 
0022 #ifndef TDF_AttributeIterator_HeaderFile
0023 #define TDF_AttributeIterator_HeaderFile
0024 
0025 #include <TDF_Label.hxx>
0026 #include <TDF_LabelNodePtr.hxx>
0027 
0028 // This class provides a way to iterates on the
0029 // up-to-date (current) valid attributes of a label.
0030 //
0031 // This class should not be used for standard attributes workflow.
0032 // Application always knows what to search at particular label.
0033 // So, use IsAttribute and FindAttribute methods of
0034 // TDF_Label to check and get attributes in usual way.
0035 // This class may be used for processing of content of labels
0036 // in generic way, like copy-tool, specific save/restore algorithms,
0037 // etc.
0038 //
0039 // Even a forgotten attribute may be found if this
0040 // option is set. To use this possibility, look at
0041 // the constructor.
0042 
0043 class TDF_AttributeIterator  {
0044 
0045 public:
0046 
0047   // Methods PUBLIC
0048   // 
0049   Standard_EXPORT TDF_AttributeIterator();
0050   Standard_EXPORT TDF_AttributeIterator
0051     (const TDF_Label& aLabel,
0052      const Standard_Boolean withoutForgotten = Standard_True);
0053   Standard_EXPORT TDF_AttributeIterator
0054     (const TDF_LabelNodePtr aLabelNode,
0055      const Standard_Boolean withoutForgotten = Standard_True);
0056   Standard_EXPORT   void Initialize
0057     (const TDF_Label& aLabel,
0058      const Standard_Boolean withoutForgotten = Standard_True) ;
0059   inline   Standard_Boolean More() const;
0060   Standard_EXPORT   void Next() ;
0061   inline   Handle(TDF_Attribute) Value() const;
0062 
0063   //! Provides an access to the internal pointer of the current attribute.
0064   //! The method has better performance as not-creating handle.
0065   inline const TDF_Attribute* PtrValue() const { return myValue; }
0066 
0067 protected:
0068 
0069  // Methods PROTECTED
0070  // 
0071 
0072 
0073  // Fields PROTECTED
0074  //
0075 
0076 
0077 private: 
0078 
0079  // Methods PRIVATE
0080  // 
0081   void goToNext (const Handle(TDF_Attribute)& anAttr);
0082 
0083 
0084  // Fields PRIVATE
0085  //
0086   TDF_Attribute    * myValue;
0087   Standard_Boolean myWithoutForgotten;
0088 };
0089 
0090 
0091 // other inline functions and methods (like "C++: function call" methods)
0092 //
0093 
0094 inline Standard_Boolean TDF_AttributeIterator::More() const
0095 { return (myValue != 0L); }
0096 
0097 inline Handle(TDF_Attribute) TDF_AttributeIterator::Value() const
0098 { return myValue; }
0099 
0100 #endif