|
||||
File indexing completed on 2025-01-18 10:05:21
0001 // Created on: 1999-07-19 0002 // Created by: Denis PASCAL 0003 // Copyright (c) 1999 Matra Datavision 0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS 0005 // 0006 // This file is part of Open CASCADE Technology software library. 0007 // 0008 // This library is free software; you can redistribute it and/or modify it under 0009 // the terms of the GNU Lesser General Public License version 2.1 as published 0010 // by the Free Software Foundation, with special exception defined in the file 0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0012 // distribution for complete text of the license and disclaimer of any warranty. 0013 // 0014 // Alternatively, this file may be used under the terms of Open CASCADE 0015 // commercial license or contractual agreement. 0016 0017 #ifndef _TFunction_Logbook_HeaderFile 0018 #define _TFunction_Logbook_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_DefineAlloc.hxx> 0022 #include <Standard_Handle.hxx> 0023 0024 #include <TDF_LabelMap.hxx> 0025 #include <TDF_Attribute.hxx> 0026 #include <Standard_OStream.hxx> 0027 class TDF_Label; 0028 class Standard_GUID; 0029 class TFunction_Logbook; 0030 class TDF_RelocationTable; 0031 0032 DEFINE_STANDARD_HANDLE(TFunction_Logbook, TDF_Attribute) 0033 0034 //! This class contains information which is written and 0035 //! read during the solving process. Information is divided 0036 //! in three groups. 0037 //! 0038 //! * Touched Labels (modified by the end user), 0039 //! * Impacted Labels (modified during execution of the function), 0040 //! * Valid Labels (within the valid label scope). 0041 class TFunction_Logbook : public TDF_Attribute 0042 { 0043 public: 0044 0045 //! Finds or Creates a TFunction_Logbook attribute at the root label accessed by <Access>. 0046 //! Returns the attribute. 0047 Standard_EXPORT static Handle(TFunction_Logbook) Set(const TDF_Label& Access); 0048 0049 //! Returns the GUID for logbook attribute. 0050 Standard_EXPORT static const Standard_GUID& GetID(); 0051 0052 0053 //! The methods manipulating the data 0054 //! (touched, impacted and valid labels) 0055 // ==================================== 0056 0057 //! Constructor (empty). 0058 Standard_EXPORT TFunction_Logbook(); 0059 0060 //! Clears this logbook to its default, empty state. 0061 Standard_EXPORT void Clear(); 0062 Standard_EXPORT Standard_Boolean IsEmpty() const; 0063 0064 //! Sets the label L as a touched label in this logbook. 0065 //! In other words, L is understood to have been modified by the end user. 0066 void SetTouched (const TDF_Label& L); 0067 0068 //! Sets the label L as an impacted label in this logbook. 0069 //! This method is called by execution of the function driver. 0070 Standard_EXPORT void SetImpacted (const TDF_Label& L, const Standard_Boolean WithChildren = Standard_False); 0071 0072 //! Sets the label L as a valid label in this logbook. 0073 Standard_EXPORT void SetValid (const TDF_Label& L, const Standard_Boolean WithChildren = Standard_False); 0074 Standard_EXPORT void SetValid (const TDF_LabelMap& Ls); 0075 0076 //! Returns True if the label L is touched or impacted. This method 0077 //! is called by <TFunction_FunctionDriver::MustExecute>. 0078 //! If <WithChildren> is set to true, the method checks 0079 //! all the sublabels of <L> too. 0080 Standard_EXPORT Standard_Boolean IsModified (const TDF_Label& L, const Standard_Boolean WithChildren = Standard_False) const; 0081 0082 //! Returns the map of touched labels in this logbook. 0083 //! A touched label is the one modified by the end user. 0084 const TDF_LabelMap& GetTouched() const; 0085 0086 //! Returns the map of impacted labels contained in this logbook. 0087 const TDF_LabelMap& GetImpacted() const; 0088 0089 //! Returns the map of valid labels in this logbook. 0090 const TDF_LabelMap& GetValid() const; 0091 Standard_EXPORT void GetValid(TDF_LabelMap& Ls) const; 0092 0093 //! Sets status of execution. 0094 void Done (const Standard_Boolean status); 0095 0096 //! Returns status of execution. 0097 Standard_Boolean IsDone() const; 0098 0099 0100 //! The methods inherited from TDF_Attribute 0101 // ======================================== 0102 0103 //! Returns the ID of the attribute. 0104 Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE; 0105 0106 //! Undos (and redos) the attribute. 0107 Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& with) Standard_OVERRIDE; 0108 0109 //! Pastes the attribute to another label. 0110 Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& into, 0111 const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE; 0112 0113 //! Returns a new empty instance of the attribute. 0114 Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE; 0115 0116 //! Prints th data of the attributes (touched, impacted and valid labels). 0117 Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE; 0118 0119 0120 private: 0121 0122 TDF_LabelMap myTouched; 0123 TDF_LabelMap myImpacted; 0124 TDF_LabelMap myValid; 0125 Standard_Boolean isDone; 0126 }; 0127 0128 #include <TFunction_Logbook.lxx> 0129 0130 #endif // _TFunction_Logbook_HeaderFile
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |