Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:58

0001 // Created on: 1992-04-06
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 _IGESData_IGESReaderTool_HeaderFile
0018 #define _IGESData_IGESReaderTool_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 <Standard_Integer.hxx>
0027 #include <IGESData_IGESType.hxx>
0028 #include <IGESData_ReadStage.hxx>
0029 #include <Interface_FileReaderTool.hxx>
0030 class Interface_ParamList;
0031 class IGESData_FileRecognizer;
0032 class Interface_Check;
0033 class IGESData_IGESReaderData;
0034 class IGESData_Protocol;
0035 class Standard_Transient;
0036 class Interface_InterfaceModel;
0037 class IGESData_IGESEntity;
0038 class IGESData_DirPart;
0039 class IGESData_ParamReader;
0040 
0041 
0042 //! specific FileReaderTool for IGES
0043 //! Parameters are accessed through specific objects, ParamReaders
0044 class IGESData_IGESReaderTool  : public Interface_FileReaderTool
0045 {
0046 public:
0047 
0048   DEFINE_STANDARD_ALLOC
0049 
0050   
0051   //! creates IGESReaderTool to work with an IGESReaderData and an
0052   //! IGES Protocol.
0053   //! Actually, no Lib is used
0054   Standard_EXPORT IGESData_IGESReaderTool(const Handle(IGESData_IGESReaderData)& reader, const Handle(IGESData_Protocol)& protocol);
0055   
0056   //! binds empty entities to records, works with the Protocol
0057   //! (from IGESData) stored and later used
0058   //! RQ : Actually, sets DNum into IGES Entities
0059   //! Also loads the list of parameters for ParamReader
0060   Standard_EXPORT void Prepare (const Handle(IGESData_FileRecognizer)& reco);
0061   
0062   //! recognizes records by asking Protocol (on data of DirType)
0063   Standard_EXPORT Standard_Boolean Recognize (const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) Standard_OVERRIDE;
0064   
0065   //! fills model's header, that is, its GlobalSection
0066   Standard_EXPORT void BeginRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE;
0067   
0068   //! fills an entity, given record no; works by calling ReadDirPart
0069   //! then ReadParams (with help of a ParamReader), then if required
0070   //! ReadProps and ReadAssocs, from IGESEntity
0071   //! Returns True if no fail has been recorded
0072   Standard_EXPORT Standard_Boolean AnalyseRecord (const Standard_Integer num, const Handle(Standard_Transient)& anent, Handle(Interface_Check)& acheck) Standard_OVERRIDE;
0073   
0074   //! after reading entities, true line weights can be computed
0075   Standard_EXPORT virtual void EndRead (const Handle(Interface_InterfaceModel)& amodel) Standard_OVERRIDE;
0076   
0077   //! Reads directory part components from file; DP is the literal
0078   //! directory part, IR detains entities referenced by DP
0079   Standard_EXPORT void ReadDir (const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, const IGESData_DirPart& DP, Handle(Interface_Check)& ach) const;
0080   
0081   //! Performs Reading of own Parameters for each IGESEntity
0082   //! Works with the ReaderLib loaded with ReadWriteModules for IGES
0083   //! In case of failure, tries UndefinedEntity from IGES
0084   Standard_EXPORT void ReadOwnParams (const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const;
0085   
0086   //! Reads Property List, if there is (if not, does nothing)
0087   //! criterium is : current parameter of PR remains inside params
0088   //! list, and Stage is "Own"
0089   //! Current parameter must be a positive integer, which value
0090   //! gives the length of the list; else, a Fail is produced (into
0091   //! Check of PR) and reading process is stopped
0092   Standard_EXPORT void ReadProps (const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const;
0093   
0094   //! Reads Associativity List, if there is (if not, does nothing)
0095   //! criterium is : current parameter of PR remains inside params
0096   //! list, and Stage is "Own"
0097   //! Same conditions as above; in addition, no parameter must be
0098   //! let after the list once read
0099   //! Note that "Associated" entities are not declared "Shared"
0100   Standard_EXPORT void ReadAssocs (const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const;
0101 
0102 
0103 
0104 
0105 protected:
0106 
0107 
0108 
0109 
0110 
0111 private:
0112 
0113 
0114 
0115   Handle(Interface_ParamList) thelist;
0116   Handle(IGESData_FileRecognizer) thereco;
0117   Interface_GeneralLib theglib;
0118   Interface_ReaderLib therlib;
0119   Standard_Integer thecnum;
0120   IGESData_IGESType thectyp;
0121   IGESData_ReadStage thestep;
0122   Handle(Interface_Check) thechk;
0123   Standard_Integer thegradweight;
0124   Standard_Real themaxweight;
0125   Standard_Real thedefweight;
0126 
0127 
0128 };
0129 
0130 
0131 
0132 
0133 
0134 
0135 
0136 #endif // _IGESData_IGESReaderTool_HeaderFile