1 // Created on: 1999-07-19
2 // Created by: Denis PASCAL
3 // Copyright (c) 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 _TFunction_Logbook_HeaderFile
18 #define _TFunction_Logbook_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TDF_LabelMap.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_OStream.hxx>
30 //! This class contains information which is written and
31 //! read during the solving process. Information is divided
34 //! * Touched Labels (modified by the end user),
35 //! * Impacted Labels (modified during execution of the function),
36 //! * Valid Labels (within the valid label scope).
37 class TFunction_Logbook
44 //! next methods are solving declaration
45 //! ===================================
46 Standard_EXPORT TFunction_Logbook();
48 //! Clears this logbook to its default, empty state.
49 Standard_EXPORT void Clear();
51 Standard_EXPORT Standard_Boolean IsEmpty() const;
53 //! Sets the label L as a touched label in this logbook.
54 //! In other words, L is understood to have been modified by the end user.
55 void SetTouched (const TDF_Label& L);
57 //! Sets the label L as an impacted label in this logbook.
58 //! This method is called by execution of the function driver.
59 Standard_EXPORT void SetImpacted (const TDF_Label& L, const Standard_Boolean WithChildren = Standard_False);
61 //! Sets the label L as a valid label in this logbook.
62 Standard_EXPORT void SetValid (const TDF_Label& L, const Standard_Boolean WithChildren = Standard_False);
64 TDF_LabelMap& ChangeValid();
66 //! Returns True if the label L is touched or impacted. This method
67 //! is called by <TFunction_FunctionDriver::MustExecute>.
68 //! If <WithChildren> is set to true, the method checks
69 //! all the sublabels of <L> too.
70 //! next method to consult solving result
71 //! =====================================
72 Standard_EXPORT Standard_Boolean IsModified (const TDF_Label& L, const Standard_Boolean WithChildren = Standard_False) const;
75 //! Returns the map of touched labels in this logbook.
76 //! A touched label is the one modified by the end user.
77 const TDF_LabelMap& GetTouched() const;
80 //! Returns the map of impacted labels contained in this logbook.
81 const TDF_LabelMap& GetImpacted() const;
83 //! Returns the map of valid labels in this logbook.
84 const TDF_LabelMap& GetValid() const;
86 //! Sets if the execution failed
87 void Done (const Standard_Boolean status);
89 Standard_Boolean IsDone() const;
91 Standard_EXPORT Standard_OStream& Dump (Standard_OStream& stream) const;
106 TDF_LabelMap myTouched;
107 TDF_LabelMap myImpacted;
108 TDF_LabelMap myValid;
109 Standard_Boolean isDone;
115 #include <TFunction_Logbook.lxx>
121 #endif // _TFunction_Logbook_HeaderFile