1 // Created by: DAUTRY Philippe
2 // Copyright (c) 1997-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _TDF_Delta_HeaderFile
17 #define _TDF_Delta_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
22 #include <Standard_Integer.hxx>
23 #include <TDF_AttributeDeltaList.hxx>
24 #include <TCollection_ExtendedString.hxx>
25 #include <Standard_Transient.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <TDF_LabelList.hxx>
28 #include <Standard_OStream.hxx>
29 class Standard_OutOfRange;
31 class TDF_AttributeDelta;
32 class TCollection_ExtendedString;
36 DEFINE_STANDARD_HANDLE(TDF_Delta, Standard_Transient)
38 //! A set of AttributeDelta for a given transaction
39 //! number and reference time number.
40 //! A delta set is available at <aSourceTime>. If
41 //! applied, it restores the TDF_Data in the state it
42 //! was at <aTargetTime>.
43 class TDF_Delta : public Standard_Transient
50 Standard_EXPORT TDF_Delta();
52 //! Returns true if there is nothing to undo.
53 Standard_Boolean IsEmpty() const;
55 //! Returns true if the Undo action of <me> is
56 //! applicable at <aCurrentTime>.
57 Standard_Boolean IsApplicable (const Standard_Integer aCurrentTime) const;
59 //! Returns the field <myBeginTime>.
60 Standard_Integer BeginTime() const;
62 //! Returns the field <myEndTime>.
63 Standard_Integer EndTime() const;
65 //! Adds in <aLabelList> the labels of the attribute deltas.
66 //! Caution: <aLabelList> is not cleared before use.
67 Standard_EXPORT void Labels (TDF_LabelList& aLabelList) const;
69 //! Returns the field <myAttDeltaList>.
70 const TDF_AttributeDeltaList& AttributeDeltas() const;
72 //! Returns a name associated with this delta.
73 TCollection_ExtendedString Name() const;
75 //! Associates a name <theName> with this delta
76 void SetName (const TCollection_ExtendedString& theName);
78 Standard_EXPORT void Dump (Standard_OStream& OS) const;
81 friend class TDF_Data;
84 DEFINE_STANDARD_RTTIEXT(TDF_Delta,Standard_Transient)
89 //! Validates <me> at <aBeginTime>. If applied, it
90 //! restores the TDF_Data in the state it was at
91 //! <anEndTime>. Reserved to TDF_Data.
92 Standard_EXPORT void Validity (const Standard_Integer aBeginTime, const Standard_Integer anEndTime);
94 //! Adds an AttributeDelta to the list. Reserved to
96 Standard_EXPORT void AddAttributeDelta (const Handle(TDF_AttributeDelta)& anAttributeDelta);
100 //! Replaces Attribute Delta List
101 Standard_EXPORT void ReplaceDeltaList(const TDF_AttributeDeltaList& theList);
103 Standard_EXPORT void BeforeOrAfterApply (const Standard_Boolean before) const;
105 Standard_EXPORT void Apply();
107 Standard_Integer myBeginTime;
108 Standard_Integer myEndTime;
109 TDF_AttributeDeltaList myAttDeltaList;
110 TCollection_ExtendedString myName;
116 #include <TDF_Delta.lxx>
122 #endif // _TDF_Delta_HeaderFile