Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:21

0001 // Created on: 2008-01-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_IFunction_HeaderFile
0017 #define _TFunction_IFunction_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <TDF_Label.hxx>
0024 #include <TDF_LabelList.hxx>
0025 #include <TFunction_ExecutionStatus.hxx>
0026 #include <TFunction_DoubleMapOfIntegerLabel.hxx>
0027 #include <Standard_Integer.hxx>
0028 class Standard_GUID;
0029 class TFunction_Logbook;
0030 class TFunction_Driver;
0031 class TFunction_GraphNode;
0032 
0033 
0034 //! Interface class for usage of Function Mechanism
0035 class TFunction_IFunction 
0036 {
0037 public:
0038 
0039   DEFINE_STANDARD_ALLOC
0040 
0041   
0042   //! Sets a new function attached to a label <L> with <ID>.
0043   //! It creates a new TFunction_Function attribute initialized by the <ID>,
0044   //! a new TFunction_GraphNode with an empty list of dependencies and
0045   //! the status equal to TFunction_ES_WrongDefinition.
0046   //! It registers the function in the scope of functions for this document.
0047   Standard_EXPORT static Standard_Boolean NewFunction (const TDF_Label& L, const Standard_GUID& ID);
0048   
0049   //! Deletes a function attached to a label <L>.
0050   //! It deletes a TFunction_Function attribute and a TFunction_GraphNode.
0051   //! It deletes the functions from the scope of function of this document.
0052   Standard_EXPORT static Standard_Boolean DeleteFunction (const TDF_Label& L);
0053   
0054   //! Updates dependencies for all functions of the scope.
0055   //! It returns false in case of an error.
0056   //! An empty constructor.
0057   Standard_EXPORT static Standard_Boolean UpdateDependencies (const TDF_Label& Access);
0058   
0059   Standard_EXPORT TFunction_IFunction();
0060   
0061   //! A constructor.
0062   //! Initializes the interface by the label of function.
0063   Standard_EXPORT TFunction_IFunction(const TDF_Label& L);
0064   
0065   //! Initializes the interface by the label of function.
0066   Standard_EXPORT void Init (const TDF_Label& L);
0067   
0068   //! Returns a label of the function.
0069   Standard_EXPORT const TDF_Label& Label() const;
0070   
0071   //! Updates the dependencies of this function only.
0072   Standard_EXPORT Standard_Boolean UpdateDependencies() const;
0073   
0074   //! The method fills-in the list by labels,
0075   //! where the arguments of the function are located.
0076   Standard_EXPORT void Arguments (TDF_LabelList& args) const;
0077   
0078   //! The method fills-in the list by labels,
0079   //! where the results of the function are located.
0080   Standard_EXPORT void Results (TDF_LabelList& res) const;
0081   
0082   //! Returns a list of previous functions.
0083   Standard_EXPORT void GetPrevious (TDF_LabelList& prev) const;
0084   
0085   //! Returns a list of next functions.
0086   Standard_EXPORT void GetNext (TDF_LabelList& prev) const;
0087   
0088   //! Returns the execution status of the function.
0089   Standard_EXPORT TFunction_ExecutionStatus GetStatus() const;
0090   
0091   //! Defines an execution status for a function.
0092   Standard_EXPORT void SetStatus (const TFunction_ExecutionStatus status) const;
0093   
0094   //! Returns the scope of all functions.
0095   Standard_EXPORT const TFunction_DoubleMapOfIntegerLabel& GetAllFunctions() const;
0096   
0097   //! Returns the Logbook - keeper of modifications.
0098   Standard_EXPORT Handle(TFunction_Logbook) GetLogbook() const;
0099   
0100   //! Returns a driver of the function.
0101   Standard_EXPORT Handle(TFunction_Driver) GetDriver (const Standard_Integer thread = 0) const;
0102   
0103   //! Returns a graph node of the function.
0104   Standard_EXPORT Handle(TFunction_GraphNode) GetGraphNode() const;
0105 
0106 
0107 
0108 
0109 protected:
0110 
0111 
0112 
0113 
0114 
0115 private:
0116 
0117 
0118 
0119   TDF_Label myLabel;
0120 
0121 
0122 };
0123 
0124 
0125 
0126 
0127 
0128 
0129 
0130 #endif // _TFunction_IFunction_HeaderFile