Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1993-09-06
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1993-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_ReadWriteModule_HeaderFile
0018 #define _IGESData_ReadWriteModule_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Interface_ReaderModule.hxx>
0024 #include <Standard_Integer.hxx>
0025 class Interface_FileReaderData;
0026 class Interface_Check;
0027 class Standard_Transient;
0028 class IGESData_IGESEntity;
0029 class IGESData_IGESReaderData;
0030 class IGESData_ParamReader;
0031 class IGESData_IGESWriter;
0032 
0033 
0034 class IGESData_ReadWriteModule;
0035 DEFINE_STANDARD_HANDLE(IGESData_ReadWriteModule, Interface_ReaderModule)
0036 
0037 //! Defines basic File Access Module, under the control of
0038 //! IGESReaderTool for Reading and IGESWriter for Writing :
0039 //! Specific actions concern : Read and Write Own Parameters of
0040 //! an IGESEntity.
0041 //! The common parts (Directory Entry, Lists of Associativities
0042 //! and Properties) are processed by IGESReaderTool & IGESWriter
0043 //!
0044 //! Each sub-class of ReadWriteModule is used in conjunction with
0045 //! a sub-class of Protocol from IGESData and processes several
0046 //! types of IGESEntity (typically, them of a package) :
0047 //! The Protocol gives a unique positive integer Case Number for
0048 //! each type of IGESEntity it recognizes, the corresponding
0049 //! ReadWriteModule processes an Entity by using the Case Number
0050 //! to known what is to do
0051 //! On Reading, the general service NewVoid is used to create an
0052 //! IGES Entity the first time
0053 //!
0054 //! Warning : Works with an IGESReaderData which stores "DE parts" of Items
0055 class IGESData_ReadWriteModule : public Interface_ReaderModule
0056 {
0057 
0058 public:
0059 
0060   
0061   //! Translates the Type of record <num> in <data> to a positive
0062   //! Case Number, or 0 if failed.
0063   //! Works with IGESReaderData which provides Type & Form Numbers,
0064   //! and calls CaseIGES (see below)
0065   Standard_EXPORT Standard_Integer CaseNum (const Handle(Interface_FileReaderData)& data, const Standard_Integer num) const Standard_OVERRIDE;
0066   
0067   //! Defines Case Numbers corresponding to the Entity Types taken
0068   //! into account by a sub-class of ReadWriteModule (hence, each
0069   //! sub-class of ReadWriteModule has to redefine this method)
0070   //! Called by CaseNum. Its result will then be used to call
0071   //! Read, etc ...
0072   Standard_EXPORT virtual Standard_Integer CaseIGES (const Standard_Integer typenum, const Standard_Integer formnum) const = 0;
0073   
0074   //! General Read Function. See IGESReaderTool for more info
0075   Standard_EXPORT void Read (const Standard_Integer CN, const Handle(Interface_FileReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
0076   
0077   //! Reads own parameters from file for an Entity; <PR> gives
0078   //! access to them, <IR> detains parameter types and values
0079   //! For each class, there must be a specific action provided
0080   //! Note that Properties and Associativities Lists are Read by
0081   //! specific methods (see below), they are called under control
0082   //! of reading process (only one call) according Stage recorded
0083   //! in ParamReader
0084   Standard_EXPORT virtual void ReadOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const = 0;
0085   
0086   //! Writes own parameters to IGESWriter; defined for each class
0087   //! (to be redefined for other IGES ReadWriteModules)
0088   //! Warning : Properties and Associativities are directly managed by
0089   //! WriteIGES, must not be sent by this method
0090   Standard_EXPORT virtual void WriteOwnParams (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, IGESData_IGESWriter& IW) const = 0;
0091 
0092 
0093 
0094 
0095   DEFINE_STANDARD_RTTIEXT(IGESData_ReadWriteModule,Interface_ReaderModule)
0096 
0097 protected:
0098 
0099 
0100 
0101 
0102 private:
0103 
0104 
0105 
0106 
0107 };
0108 
0109 
0110 
0111 
0112 
0113 
0114 
0115 #endif // _IGESData_ReadWriteModule_HeaderFile