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 <TNaming_Evolution.hxx>
27 class Standard_NoMoreObject;
28 class Standard_NoSuchObject;
29 class TNaming_NewShapeIterator;
30 class TNaming_OldShapeIterator;
31 class TNaming_NamedShape;
36 //! A tool to visit the contents of a named shape attribute.
37 //! Pairs of shapes in the attribute are iterated, one
38 //! being the pre-modification or the old shape, and
39 //! the other the post-modification or the new shape.
40 //! This allows you to have a full access to all
41 //! contents of an attribute. If, on the other hand, you
42 //! are only interested in topological entities stored
43 //! in the attribute, you can use the functions
44 //! GetShape and CurrentShape in TNaming_Tool.
45 class TNaming_Iterator
52 //! Iterates on all the history records in
54 Standard_EXPORT TNaming_Iterator(const Handle(TNaming_NamedShape)& anAtt);
56 //! Iterates on all the history records in
57 //! the current transaction
58 Standard_EXPORT TNaming_Iterator(const TDF_Label& aLabel);
60 //! Iterates on all the history records in
61 //! the transaction <aTrans>
62 Standard_EXPORT TNaming_Iterator(const TDF_Label& aLabel, const Standard_Integer aTrans);
64 //! Returns True if there is a current Item in
66 Standard_Boolean More() const;
68 //! Moves the iteration to the next Item
69 Standard_EXPORT void Next();
71 //! Returns the old shape in this iterator object.
72 //! This shape can be a null one.
73 Standard_EXPORT const TopoDS_Shape& OldShape() const;
75 //! Returns the new shape in this iterator object.
76 Standard_EXPORT const TopoDS_Shape& NewShape() const;
78 //! Returns true if the new shape is a modification (split,
79 //! fuse,etc...) of the old shape.
80 Standard_EXPORT Standard_Boolean IsModification() const;
82 Standard_EXPORT TNaming_Evolution Evolution() const;
85 friend class TNaming_NewShapeIterator;
86 friend class TNaming_OldShapeIterator;
99 TNaming_PtrNode myNode;
100 Standard_Integer myTrans;
106 #include <TNaming_Iterator.lxx>
112 #endif // _TNaming_Iterator_HeaderFile