0030686: Visualization, SelectMgr_ViewerSelector - sorting issues of transformation...
[occt.git] / src / TFunction / TFunction_IFunction.hxx
1 // Created on: 2008-01-21
2 // Created by: Vladislav ROMASHKO
3 // Copyright (c) 2008-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef _TFunction_IFunction_HeaderFile
17 #define _TFunction_IFunction_HeaderFile
18
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
22
23 #include <TDF_Label.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <TDF_LabelList.hxx>
26 #include <TFunction_ExecutionStatus.hxx>
27 #include <TFunction_DoubleMapOfIntegerLabel.hxx>
28 #include <Standard_Integer.hxx>
29 class TDF_Label;
30 class Standard_GUID;
31 class TFunction_Logbook;
32 class TFunction_Driver;
33 class TFunction_GraphNode;
34
35
36 //! Interface class for usage of Function Mechanism
37 class TFunction_IFunction 
38 {
39 public:
40
41   DEFINE_STANDARD_ALLOC
42
43   
44   //! Sets a new function attached to a label <L> with <ID>.
45   //! It creates a new TFunction_Function attribute initialized by the <ID>,
46   //! a new TFunction_GraphNode with an empty list of dependencies and
47   //! the status equal to TFunction_ES_WrongDefinition.
48   //! It registers the function in the scope of functions for this document.
49   Standard_EXPORT static Standard_Boolean NewFunction (const TDF_Label& L, const Standard_GUID& ID);
50   
51   //! Deletes a function attached to a label <L>.
52   //! It deletes a TFunction_Function attribute and a TFunction_GraphNode.
53   //! It deletes the functions from the scope of function of this document.
54   Standard_EXPORT static Standard_Boolean DeleteFunction (const TDF_Label& L);
55   
56   //! Updates dependencies for all functions of the scope.
57   //! It returns false in case of an error.
58   //! An empty constructor.
59   Standard_EXPORT static Standard_Boolean UpdateDependencies (const TDF_Label& Access);
60   
61   Standard_EXPORT TFunction_IFunction();
62   
63   //! A constructor.
64   //! Initializes the interface by the label of function.
65   Standard_EXPORT TFunction_IFunction(const TDF_Label& L);
66   
67   //! Initializes the interface by the label of function.
68   Standard_EXPORT void Init (const TDF_Label& L);
69   
70   //! Returns a label of the function.
71   Standard_EXPORT const TDF_Label& Label() const;
72   
73   //! Updates the dependencies of this function only.
74   Standard_EXPORT Standard_Boolean UpdateDependencies() const;
75   
76   //! The method fills-in the list by labels,
77   //! where the arguments of the function are located.
78   Standard_EXPORT void Arguments (TDF_LabelList& args) const;
79   
80   //! The method fills-in the list by labels,
81   //! where the results of the function are located.
82   Standard_EXPORT void Results (TDF_LabelList& res) const;
83   
84   //! Returns a list of previous functions.
85   Standard_EXPORT void GetPrevious (TDF_LabelList& prev) const;
86   
87   //! Returns a list of next functions.
88   Standard_EXPORT void GetNext (TDF_LabelList& prev) const;
89   
90   //! Returns the execution status of the function.
91   Standard_EXPORT TFunction_ExecutionStatus GetStatus() const;
92   
93   //! Defines an execution status for a function.
94   Standard_EXPORT void SetStatus (const TFunction_ExecutionStatus status) const;
95   
96   //! Returns the scope of all functions.
97   Standard_EXPORT const TFunction_DoubleMapOfIntegerLabel& GetAllFunctions() const;
98   
99   //! Returns the Logbook - keeper of modifications.
100   Standard_EXPORT Handle(TFunction_Logbook) GetLogbook() const;
101   
102   //! Returns a driver of the function.
103   Standard_EXPORT Handle(TFunction_Driver) GetDriver (const Standard_Integer thread = 0) const;
104   
105   //! Returns a graph node of the function.
106   Standard_EXPORT Handle(TFunction_GraphNode) GetGraphNode() const;
107
108
109
110
111 protected:
112
113
114
115
116
117 private:
118
119
120
121   TDF_Label myLabel;
122
123
124 };
125
126
127
128
129
130
131
132 #endif // _TFunction_IFunction_HeaderFile