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_Driver_HeaderFile
18 #define _TFunction_Driver_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TDF_Label.hxx>
24 #include <Standard_Transient.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Integer.hxx>
27 #include <TDF_LabelList.hxx>
29 class TFunction_Logbook;
32 class TFunction_Driver;
33 DEFINE_STANDARD_HANDLE(TFunction_Driver, Standard_Transient)
35 //! This driver class provide services around function
36 //! execution. One instance of this class is built for
37 //! the whole session. The driver is bound to the
38 //! DriverGUID in the DriverTable class.
39 //! It allows you to create classes which inherit from
40 //! this abstract class.
41 //! These subclasses identify the various algorithms
42 //! which can be applied to the data contained in the
43 //! attributes of sub-labels of a model.
44 //! A single instance of this class and each of its
45 //! subclasses is built for the whole session.
46 class TFunction_Driver : public Standard_Transient
52 //! Initializes the label L for this function prior to its execution.
53 Standard_EXPORT void Init (const TDF_Label& L);
55 //! Returns the label of the driver for this function.
56 TDF_Label Label() const;
58 //! Validates labels of a function in <log>.
59 //! This function is the one initialized in this function driver.
61 //! In regeneration mode, the solver must call this
62 //! method even if the function is not executed.
63 //! execution of function
64 //! =====================
65 Standard_EXPORT virtual void Validate (Handle(TFunction_Logbook)& log) const;
67 //! Analyzes the labels in the logbook log.
68 //! Returns true if attributes have been modified.
69 //! If the function label itself has been modified, the function must be executed.
70 Standard_EXPORT virtual Standard_Boolean MustExecute (const Handle(TFunction_Logbook)& log) const;
72 //! Executes the function in this function driver and
73 //! puts the impacted labels in the logbook log.
74 //! arguments & results of functions
75 //! ================================
76 Standard_EXPORT virtual Standard_Integer Execute (Handle(TFunction_Logbook)& log) const = 0;
78 //! The method fills-in the list by labels,
79 //! where the arguments of the function are located.
80 Standard_EXPORT virtual void Arguments (TDF_LabelList& args) const;
82 //! The method fills-in the list by labels,
83 //! where the results of the function are located.
84 Standard_EXPORT virtual void Results (TDF_LabelList& res) const;
89 DEFINE_STANDARD_RTTIEXT(TFunction_Driver,Standard_Transient)
94 //! initialisation of the driver
95 //! ============================
96 Standard_EXPORT TFunction_Driver();
109 #include <TFunction_Driver.lxx>
115 #endif // _TFunction_Driver_HeaderFile