0026377: Passing Handle objects as arguments to functions as non-const reference...
[occt.git] / src / TNaming / TNaming_Iterator.hxx
CommitLineData
42cf5bc1 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
5//
6// This file is part of Open CASCADE Technology software library.
7//
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _TNaming_Iterator_HeaderFile
18#define _TNaming_Iterator_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <TNaming_PtrNode.hxx>
25#include <Standard_Integer.hxx>
26#include <Standard_Boolean.hxx>
27#include <TNaming_Evolution.hxx>
28class Standard_NoMoreObject;
29class Standard_NoSuchObject;
30class TNaming_NewShapeIterator;
31class TNaming_OldShapeIterator;
32class TNaming_NamedShape;
33class TDF_Label;
34class TopoDS_Shape;
35
36
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.
46class TNaming_Iterator
47{
48public:
49
50 DEFINE_STANDARD_ALLOC
51
52
53 //! Iterates on all the history records in
54 //! <anAtt>.
55 Standard_EXPORT TNaming_Iterator(const Handle(TNaming_NamedShape)& anAtt);
56
57 //! Iterates on all the history records in
58 //! the current transaction
59 Standard_EXPORT TNaming_Iterator(const TDF_Label& aLabel);
60
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);
64
65 //! Returns True if there is a current Item in
66 //! the iteration.
67 Standard_Boolean More() const;
68
69 //! Moves the iteration to the next Item
70 Standard_EXPORT void Next();
71
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;
75
76 //! Returns the new shape in this iterator object.
77 Standard_EXPORT const TopoDS_Shape& NewShape() const;
78
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;
82
83 Standard_EXPORT TNaming_Evolution Evolution() const;
84
85
86friend class TNaming_NewShapeIterator;
87friend class TNaming_OldShapeIterator;
88
89
90protected:
91
92
93
94
95
96private:
97
98
99
100 TNaming_PtrNode myNode;
101 Standard_Integer myTrans;
102
103
104};
105
106
107#include <TNaming_Iterator.lxx>
108
109
110
111
112
113#endif // _TNaming_Iterator_HeaderFile