1 // Created on: 1996-12-16
2 // Created by: Remi Lequette
3 // Copyright (c) 1996-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 #ifndef _TNaming_Iterator_HeaderFile
18 #define _TNaming_Iterator_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TNaming_PtrNode.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <TNaming_Evolution.hxx>
28 class Standard_NoMoreObject;
29 class Standard_NoSuchObject;
30 class TNaming_NewShapeIterator;
31 class TNaming_OldShapeIterator;
32 class TNaming_NamedShape;
37 //! A tool to visit the contents of a named shape attribute.
38 //! Pairs of shapes in the attribute are iterated, one
39 //! being the pre-modification or the old shape, and
40 //! the other the post-modification or the new shape.
41 //! This allows you to have a full access to all
42 //! contents of an attribute. If, on the other hand, you
43 //! are only interested in topological entities stored
44 //! in the attribute, you can use the functions
45 //! GetShape and CurrentShape in TNaming_Tool.
46 class TNaming_Iterator
53 //! Iterates on all the history records in
55 Standard_EXPORT TNaming_Iterator(const Handle(TNaming_NamedShape)& anAtt);
57 //! Iterates on all the history records in
58 //! the current transaction
59 Standard_EXPORT TNaming_Iterator(const TDF_Label& aLabel);
61 //! Iterates on all the history records in
62 //! the transaction <aTrans>
63 Standard_EXPORT TNaming_Iterator(const TDF_Label& aLabel, const Standard_Integer aTrans);
65 //! Returns True if there is a current Item in
67 Standard_Boolean More() const;
69 //! Moves the iteration to the next Item
70 Standard_EXPORT void Next();
72 //! Returns the old shape in this iterator object.
73 //! This shape can be a null one.
74 Standard_EXPORT const TopoDS_Shape& OldShape() const;
76 //! Returns the new shape in this iterator object.
77 Standard_EXPORT const TopoDS_Shape& NewShape() const;
79 //! Returns true if the new shape is a modification (split,
80 //! fuse,etc...) of the old shape.
81 Standard_EXPORT Standard_Boolean IsModification() const;
83 Standard_EXPORT TNaming_Evolution Evolution() const;
86 friend class TNaming_NewShapeIterator;
87 friend class TNaming_OldShapeIterator;
100 TNaming_PtrNode myNode;
101 Standard_Integer myTrans;
107 #include <TNaming_Iterator.lxx>
113 #endif // _TNaming_Iterator_HeaderFile