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) 1997-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 #ifndef _TDF_Delta_HeaderFile
0017 #define _TDF_Delta_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021 
0022 #include <Standard_Integer.hxx>
0023 #include <TDF_AttributeDeltaList.hxx>
0024 #include <TCollection_ExtendedString.hxx>
0025 #include <Standard_Transient.hxx>
0026 #include <TDF_LabelList.hxx>
0027 #include <Standard_OStream.hxx>
0028 class TDF_AttributeDelta;
0029 
0030 
0031 class TDF_Delta;
0032 DEFINE_STANDARD_HANDLE(TDF_Delta, Standard_Transient)
0033 
0034 //! A set of AttributeDelta for a given transaction
0035 //! number and reference time number.
0036 //! A delta set is available at <aSourceTime>. If
0037 //! applied, it restores the TDF_Data in the state it
0038 //! was at <aTargetTime>.
0039 class TDF_Delta : public Standard_Transient
0040 {
0041 
0042 public:
0043 
0044   
0045   //! Creates a delta.
0046   Standard_EXPORT TDF_Delta();
0047   
0048   //! Returns true if there is nothing to undo.
0049     Standard_Boolean IsEmpty() const;
0050   
0051   //! Returns true if the Undo action of <me> is
0052   //! applicable at <aCurrentTime>.
0053     Standard_Boolean IsApplicable (const Standard_Integer aCurrentTime) const;
0054   
0055   //! Returns the field <myBeginTime>.
0056     Standard_Integer BeginTime() const;
0057   
0058   //! Returns the field <myEndTime>.
0059     Standard_Integer EndTime() const;
0060   
0061   //! Adds in <aLabelList> the labels of the attribute deltas.
0062   //! Caution: <aLabelList> is not cleared before use.
0063   Standard_EXPORT void Labels (TDF_LabelList& aLabelList) const;
0064   
0065   //! Returns the field <myAttDeltaList>.
0066     const TDF_AttributeDeltaList& AttributeDeltas() const;
0067   
0068   //! Returns a name associated with this delta.
0069     TCollection_ExtendedString Name() const;
0070   
0071   //! Associates a name <theName> with this delta
0072     void SetName (const TCollection_ExtendedString& theName);
0073 
0074   Standard_EXPORT void Dump (Standard_OStream& OS) const;
0075 
0076   //! Dumps the content of me into the stream
0077   Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0078 
0079 
0080 friend class TDF_Data;
0081 
0082 
0083   DEFINE_STANDARD_RTTIEXT(TDF_Delta,Standard_Transient)
0084 
0085 protected:
0086 
0087   
0088   //! Validates <me> at <aBeginTime>. If applied, it
0089   //! restores the TDF_Data in the state it was at
0090   //! <anEndTime>. Reserved to TDF_Data.
0091   Standard_EXPORT void Validity (const Standard_Integer aBeginTime, const Standard_Integer anEndTime);
0092   
0093   //! Adds an AttributeDelta to the list. Reserved to
0094   //! TDF_Data.
0095   Standard_EXPORT void AddAttributeDelta (const Handle(TDF_AttributeDelta)& anAttributeDelta);
0096 
0097 private:
0098 
0099   //! Replaces Attribute Delta List
0100   void ReplaceDeltaList(const TDF_AttributeDeltaList& theList);
0101 
0102   void BeforeOrAfterApply (const Standard_Boolean before) const;
0103   
0104   void Apply();
0105 
0106   Standard_Integer myBeginTime;
0107   Standard_Integer myEndTime;
0108   TDF_AttributeDeltaList myAttDeltaList;
0109   TCollection_ExtendedString myName;
0110 
0111 
0112 };
0113 
0114 
0115 #include <TDF_Delta.lxx>
0116 
0117 
0118 
0119 
0120 
0121 #endif // _TDF_Delta_HeaderFile