Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-18 09:21:54

0001 // Created on: 2000-09-29
0002 // Created by: Andrey BETENEV
0003 // Copyright (c) 2000-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 _STEPConstruct_Tool_HeaderFile
0017 #define _STEPConstruct_Tool_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <Standard_Boolean.hxx>
0024 class XSControl_WorkSession;
0025 class Transfer_FinderProcess;
0026 class Transfer_TransientProcess;
0027 class Interface_HGraph;
0028 class Interface_InterfaceModel;
0029 class Interface_Graph;
0030 
0031 //! Provides basic functionalities for tools which are intended
0032 //! for encoding/decoding specific STEP constructs
0033 //!
0034 //! It is initialized by WorkSession and allows easy access to
0035 //! its fields and internal data such as Model, TP and FP
0036 //!
0037 //! NOTE: Call to method Graph() with True (or for a first time,
0038 //! if you have updated the model since last computation of model)
0039 //! can take a time, so it is recommended to avoid creation of
0040 //! this (and derived) tool multiple times
0041 class STEPConstruct_Tool
0042 {
0043 public:
0044   DEFINE_STANDARD_ALLOC
0045 
0046   //! Creates an empty tool
0047   Standard_EXPORT STEPConstruct_Tool();
0048 
0049   //! Creates a tool and loads it with worksession
0050   Standard_EXPORT STEPConstruct_Tool(const occ::handle<XSControl_WorkSession>& WS);
0051 
0052   //! Returns currently loaded WorkSession
0053   const occ::handle<XSControl_WorkSession>& WS() const;
0054 
0055   //! Returns current model (Null if not loaded)
0056   occ::handle<Interface_InterfaceModel> Model() const;
0057 
0058   //! Returns current graph (recomputing if necessary)
0059   const Interface_Graph& Graph(const bool recompute = false) const;
0060 
0061   //! Returns TransientProcess (reading; Null if not loaded)
0062   const occ::handle<Transfer_TransientProcess>& TransientProcess() const;
0063 
0064   //! Returns FinderProcess (writing; Null if not loaded)
0065   const occ::handle<Transfer_FinderProcess>& FinderProcess() const;
0066 
0067 protected:
0068   //! Load worksession; returns True if succeeded
0069   //! Returns False if either FinderProcess of TransientProcess
0070   //! cannot be obtained or are Null
0071   Standard_EXPORT bool SetWS(const occ::handle<XSControl_WorkSession>& WS);
0072 
0073 private:
0074   occ::handle<XSControl_WorkSession>     myWS;
0075   occ::handle<Transfer_FinderProcess>    myFinderProcess;
0076   occ::handle<Transfer_TransientProcess> myTransientProcess;
0077   occ::handle<Interface_HGraph>          myHGraph;
0078 };
0079 
0080 #include <STEPConstruct_Tool.lxx>
0081 
0082 #endif // _STEPConstruct_Tool_HeaderFile