Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1992-02-11
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _StepData_StepReaderTool_HeaderFile
0018 #define _StepData_StepReaderTool_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Interface_GeneralLib.hxx>
0025 #include <Interface_ReaderLib.hxx>
0026 #include <Interface_FileReaderTool.hxx>
0027 #include <Standard_Integer.hxx>
0028 class StepData_FileRecognizer;
0029 class StepData_StepReaderData;
0030 class StepData_Protocol;
0031 class Interface_Check;
0032 class Standard_Transient;
0033 class Interface_InterfaceModel;
0034 
0035 
0036 //! Specific FileReaderTool for Step; works with FileReaderData
0037 //! provides references evaluation, plus access to literal data
0038 //! and specific methods defined by FileReaderTool
0039 //! Remarks : works with a ReaderLib to load Entities
0040 class StepData_StepReaderTool  : public Interface_FileReaderTool
0041 {
0042 public:
0043 
0044   DEFINE_STANDARD_ALLOC
0045 
0046   
0047   //! creates StepReaderTool to work with a StepReaderData according
0048   //! to a Step Protocol. Defines the ReaderLib at this time
0049   Standard_EXPORT StepData_StepReaderTool(const Handle(StepData_StepReaderData)& reader, const Handle(StepData_Protocol)& protocol);
0050   
0051   //! Bounds empty entities to records, uses default Recognition
0052   //! provided by ReaderLib and ReaderModule. Also calls computation
0053   //! of references (SetEntityNumbers from StepReaderData)
0054   //! Works only on data entities (skips header)
0055   //! <optimize> given False allows to test some internal algorithms
0056   //! which are normally avoided (see also StepReaderData)
0057   Standard_EXPORT void Prepare (const Standard_Boolean optimize = Standard_True);
0058   
0059   //! Bounds empty entities to records, works with a specific
0060   //! FileRecognizer, stored and later used in Recognize
0061   //! Works only on data entities (skips header)
0062   //! <optimize : same as above
0063   Standard_EXPORT void Prepare (const Handle(StepData_FileRecognizer)& reco, const Standard_Boolean optimize = Standard_True);
0064   
0065   //! recognizes records, by asking either ReaderLib (default) or
0066   //! FileRecognizer (if defined) to do so. <ach> is to call
0067   //! RecognizeByLib
0068   Standard_EXPORT Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) Standard_OVERRIDE;
0069   
0070   //! bounds empty entities and sub-lists to header records
0071   //! works like Prepare + SetEntityNumbers, but for header
0072   //! (N.B.: in Header, no Ident and no reference)
0073   //! FileRecognizer is to specify Entities which are allowed to be
0074   //! defined in the Header (not every type can be)
0075   Standard_EXPORT void PrepareHeader (const Handle(StepData_FileRecognizer)& reco);
0076   
0077   //! fills model's header; that is, gives to it Header entities
0078   //! and commands their loading. Also fills StepModel's Global
0079   //! Check from StepReaderData's GlobalCheck
0080   Standard_EXPORT void BeginRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE;
0081   
0082   //! fills an entity, given record no; works by using a ReaderLib
0083   //! to load each entity, which must be a Transient
0084   //! Actually, returned value is True if no fail, False else
0085   Standard_EXPORT Standard_Boolean AnalyseRecord (const Standard_Integer num, const Handle(Standard_Transient)& anent, Handle(Interface_Check)& acheck) Standard_OVERRIDE;
0086   
0087   //! Ends file reading after reading all the entities
0088   //! Here, it binds in the model, Idents to Entities (for checks)
0089   Standard_EXPORT virtual void EndRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE;
0090 
0091 
0092 
0093 
0094 protected:
0095 
0096 
0097 
0098 
0099 
0100 private:
0101 
0102 
0103 
0104   Handle(StepData_FileRecognizer) thereco;
0105   Interface_GeneralLib theglib;
0106   Interface_ReaderLib therlib;
0107 
0108 
0109 };
0110 
0111 
0112 
0113 
0114 
0115 
0116 
0117 #endif // _StepData_StepReaderTool_HeaderFile