Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-12 09:19:01

0001 // Created on: 2008-06-21
0002 // Created by: Vladislav ROMASHKO
0003 // Copyright (c) 2008-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _TFunction_GraphNode_HeaderFile
0017 #define _TFunction_GraphNode_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_Type.hxx>
0021 
0022 #include <Standard_Integer.hxx>
0023 #include <NCollection_Map.hxx>
0024 #include <TFunction_ExecutionStatus.hxx>
0025 #include <TDF_Attribute.hxx>
0026 #include <Standard_OStream.hxx>
0027 class TDF_Label;
0028 class Standard_GUID;
0029 class TDF_RelocationTable;
0030 class TDF_DataSet;
0031 
0032 //! Provides links between functions.
0033 class TFunction_GraphNode : public TDF_Attribute
0034 {
0035 
0036 public:
0037   //! Static methods
0038   //! ==============
0039   //! Finds or Creates a graph node attribute at the label <L>.
0040   //! Returns the attribute.
0041   Standard_EXPORT static occ::handle<TFunction_GraphNode> Set(const TDF_Label& L);
0042 
0043   //! Returns the GUID for GraphNode attribute.
0044   //! Instant methods
0045   //! ===============
0046   //! Constructor (empty).
0047   Standard_EXPORT static const Standard_GUID& GetID();
0048 
0049   Standard_EXPORT TFunction_GraphNode();
0050 
0051   //! Defines a reference to the function as a previous one.
0052   Standard_EXPORT bool AddPrevious(const int funcID);
0053 
0054   //! Defines a reference to the function as a previous one.
0055   Standard_EXPORT bool AddPrevious(const TDF_Label& func);
0056 
0057   //! Removes a reference to the function as a previous one.
0058   Standard_EXPORT bool RemovePrevious(const int funcID);
0059 
0060   //! Removes a reference to the function as a previous one.
0061   Standard_EXPORT bool RemovePrevious(const TDF_Label& func);
0062 
0063   //! Returns a map of previous functions.
0064   Standard_EXPORT const NCollection_Map<int>& GetPrevious() const;
0065 
0066   //! Clears a map of previous functions.
0067   Standard_EXPORT void RemoveAllPrevious();
0068 
0069   //! Defines a reference to the function as a next one.
0070   Standard_EXPORT bool AddNext(const int funcID);
0071 
0072   //! Defines a reference to the function as a next one.
0073   Standard_EXPORT bool AddNext(const TDF_Label& func);
0074 
0075   //! Removes a reference to the function as a next one.
0076   Standard_EXPORT bool RemoveNext(const int funcID);
0077 
0078   //! Removes a reference to the function as a next one.
0079   Standard_EXPORT bool RemoveNext(const TDF_Label& func);
0080 
0081   //! Returns a map of next functions.
0082   Standard_EXPORT const NCollection_Map<int>& GetNext() const;
0083 
0084   //! Clears a map of next functions.
0085   Standard_EXPORT void RemoveAllNext();
0086 
0087   //! Returns the execution status of the function.
0088   Standard_EXPORT TFunction_ExecutionStatus GetStatus() const;
0089 
0090   //! Defines an execution status for a function.
0091   //! Implementation of Attribute methods
0092   //! ===================================
0093   Standard_EXPORT void SetStatus(const TFunction_ExecutionStatus status);
0094 
0095   Standard_EXPORT const Standard_GUID& ID() const override;
0096 
0097   Standard_EXPORT void Restore(const occ::handle<TDF_Attribute>& with) override;
0098 
0099   Standard_EXPORT void Paste(const occ::handle<TDF_Attribute>&       into,
0100                              const occ::handle<TDF_RelocationTable>& RT) const override;
0101 
0102   Standard_EXPORT occ::handle<TDF_Attribute> NewEmpty() const override;
0103 
0104   Standard_EXPORT void References(const occ::handle<TDF_DataSet>& aDataSet) const override;
0105 
0106   Standard_EXPORT Standard_OStream& Dump(Standard_OStream& anOS) const override;
0107 
0108   DEFINE_STANDARD_RTTIEXT(TFunction_GraphNode, TDF_Attribute)
0109 
0110 private:
0111   NCollection_Map<int>      myPrevious;
0112   NCollection_Map<int>      myNext;
0113   TFunction_ExecutionStatus myStatus;
0114 };
0115 
0116 #endif // _TFunction_GraphNode_HeaderFile