1 // Created on: 2008-06-21
2 // Created by: Vladislav ROMASHKO
3 // Copyright (c) 2008-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _TFunction_GraphNode_HeaderFile
17 #define _TFunction_GraphNode_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
22 #include <TColStd_MapOfInteger.hxx>
23 #include <TFunction_ExecutionStatus.hxx>
24 #include <TDF_Attribute.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Integer.hxx>
27 #include <Standard_OStream.hxx>
31 class TDF_RelocationTable;
35 class TFunction_GraphNode;
36 DEFINE_STANDARD_HANDLE(TFunction_GraphNode, TDF_Attribute)
38 //! Provides links between functions.
39 class TFunction_GraphNode : public TDF_Attribute
47 //! Finds or Creates a graph node attribute at the label <L>.
48 //! Returns the attribute.
49 Standard_EXPORT static Handle(TFunction_GraphNode) Set (const TDF_Label& L);
51 //! Returns the GUID for GraphNode attribute.
54 //! Constructor (empty).
55 Standard_EXPORT static const Standard_GUID& GetID();
57 Standard_EXPORT TFunction_GraphNode();
59 //! Defines a reference to the function as a previous one.
60 Standard_EXPORT Standard_Boolean AddPrevious (const Standard_Integer funcID);
62 //! Defines a reference to the function as a previous one.
63 Standard_EXPORT Standard_Boolean AddPrevious (const TDF_Label& func);
65 //! Removes a reference to the function as a previous one.
66 Standard_EXPORT Standard_Boolean RemovePrevious (const Standard_Integer funcID);
68 //! Removes a reference to the function as a previous one.
69 Standard_EXPORT Standard_Boolean RemovePrevious (const TDF_Label& func);
71 //! Returns a map of previous functions.
72 Standard_EXPORT const TColStd_MapOfInteger& GetPrevious() const;
74 //! Clears a map of previous functions.
75 Standard_EXPORT void RemoveAllPrevious();
77 //! Defines a reference to the function as a next one.
78 Standard_EXPORT Standard_Boolean AddNext (const Standard_Integer funcID);
80 //! Defines a reference to the function as a next one.
81 Standard_EXPORT Standard_Boolean AddNext (const TDF_Label& func);
83 //! Removes a reference to the function as a next one.
84 Standard_EXPORT Standard_Boolean RemoveNext (const Standard_Integer funcID);
86 //! Removes a reference to the function as a next one.
87 Standard_EXPORT Standard_Boolean RemoveNext (const TDF_Label& func);
89 //! Returns a map of next functions.
90 Standard_EXPORT const TColStd_MapOfInteger& GetNext() const;
92 //! Clears a map of next functions.
93 Standard_EXPORT void RemoveAllNext();
95 //! Returns the execution status of the function.
96 Standard_EXPORT TFunction_ExecutionStatus GetStatus() const;
98 //! Defines an execution status for a function.
99 //! Implementation of Attribute methods
100 //! ===================================
101 Standard_EXPORT void SetStatus (const TFunction_ExecutionStatus status);
103 Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
105 Standard_EXPORT virtual void Restore (const Handle(TDF_Attribute)& with) Standard_OVERRIDE;
107 Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& into, const Handle(TDF_RelocationTable)& RT) const Standard_OVERRIDE;
109 Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
111 Standard_EXPORT virtual void References (const Handle(TDF_DataSet)& aDataSet) const Standard_OVERRIDE;
113 Standard_EXPORT virtual Standard_OStream& Dump (Standard_OStream& anOS) const Standard_OVERRIDE;
118 DEFINE_STANDARD_RTTIEXT(TFunction_GraphNode,TDF_Attribute)
128 TColStd_MapOfInteger myPrevious;
129 TColStd_MapOfInteger myNext;
130 TFunction_ExecutionStatus myStatus;
141 #endif // _TFunction_GraphNode_HeaderFile