Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-26 09:16:45

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_IGESReaderData_HeaderFile
0018 #define _IGESData_IGESReaderData_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <IGESData_IGESType.hxx>
0024 #include <TColStd_HSequenceOfHAsciiString.hxx>
0025 #include <IGESData_GlobalSection.hxx>
0026 #include <IGESData_Array1OfDirPart.hxx>
0027 #include <IGESData_ReadStage.hxx>
0028 #include <Interface_FileReaderData.hxx>
0029 #include <Standard_Integer.hxx>
0030 #include <Standard_CString.hxx>
0031 #include <Interface_ParamType.hxx>
0032 class Interface_ParamSet;
0033 class Interface_Check;
0034 class IGESData_DirPart;
0035 
0036 class IGESData_IGESReaderData;
0037 DEFINE_STANDARD_HANDLE(IGESData_IGESReaderData, Interface_FileReaderData)
0038 
0039 //! specific FileReaderData for IGES
0040 //! contains header as GlobalSection, and for each Entity, its
0041 //! directory part as DirPart, list of Parameters as ParamSet
0042 //! Each Item has a DirPart, plus classically a ParamSet and the
0043 //! correspondent recognized Entity (inherited from FileReaderData)
0044 //! Parameters are accessed through specific objects, ParamReaders
0045 class IGESData_IGESReaderData : public Interface_FileReaderData
0046 {
0047 
0048 public:
0049   //! creates IGESReaderData correctly dimensioned (for arrays)
0050   //! <nbe> count of entities, that is, half nb of directory lines
0051   //! <nbp> : count of parameters
0052   Standard_EXPORT IGESData_IGESReaderData(const Standard_Integer nbe, const Standard_Integer nbp);
0053 
0054   //! adds a start line to start section
0055   Standard_EXPORT void AddStartLine(const Standard_CString aval);
0056 
0057   //! Returns the Start Section in once
0058   Standard_EXPORT Handle(TColStd_HSequenceOfHAsciiString) StartSection() const;
0059 
0060   //! adds a parameter to global section's parameter list
0061   Standard_EXPORT void AddGlobal(const Interface_ParamType atype, const Standard_CString aval);
0062 
0063   //! reads header (as GlobalSection) content from the ParamSet
0064   //! after it has been filled by successive calls to AddGlobal
0065   Standard_EXPORT void SetGlobalSection();
0066 
0067   //! returns header as GlobalSection
0068   Standard_EXPORT const IGESData_GlobalSection& GlobalSection() const;
0069 
0070   //! fills a DirPart, designated by its rank (that is, (N+1)/2 if N
0071   //! is its first number in section D)
0072   Standard_EXPORT void SetDirPart(const Standard_Integer num,
0073                                   const Standard_Integer i1,
0074                                   const Standard_Integer i2,
0075                                   const Standard_Integer i3,
0076                                   const Standard_Integer i4,
0077                                   const Standard_Integer i5,
0078                                   const Standard_Integer i6,
0079                                   const Standard_Integer i7,
0080                                   const Standard_Integer i8,
0081                                   const Standard_Integer i9,
0082                                   const Standard_Integer i10,
0083                                   const Standard_Integer i11,
0084                                   const Standard_Integer i12,
0085                                   const Standard_Integer i13,
0086                                   const Standard_Integer i14,
0087                                   const Standard_Integer i15,
0088                                   const Standard_Integer i16,
0089                                   const Standard_Integer i17,
0090                                   const Standard_CString res1,
0091                                   const Standard_CString res2,
0092                                   const Standard_CString label,
0093                                   const Standard_CString subs);
0094 
0095   //! returns DirPart identified by record no (half Dsect number)
0096   Standard_EXPORT const IGESData_DirPart& DirPart(const Standard_Integer num) const;
0097 
0098   //! returns values recorded in directory part n0 <num>
0099   Standard_EXPORT void DirValues(const Standard_Integer num,
0100                                  Standard_Integer&      i1,
0101                                  Standard_Integer&      i2,
0102                                  Standard_Integer&      i3,
0103                                  Standard_Integer&      i4,
0104                                  Standard_Integer&      i5,
0105                                  Standard_Integer&      i6,
0106                                  Standard_Integer&      i7,
0107                                  Standard_Integer&      i8,
0108                                  Standard_Integer&      i9,
0109                                  Standard_Integer&      i10,
0110                                  Standard_Integer&      i11,
0111                                  Standard_Integer&      i12,
0112                                  Standard_Integer&      i13,
0113                                  Standard_Integer&      i14,
0114                                  Standard_Integer&      i15,
0115                                  Standard_Integer&      i16,
0116                                  Standard_Integer&      i17,
0117                                  Standard_CString&      res1,
0118                                  Standard_CString&      res2,
0119                                  Standard_CString&      label,
0120                                  Standard_CString&      subs) const;
0121 
0122   //! returns "type" and "form" info from a directory part
0123   Standard_EXPORT IGESData_IGESType DirType(const Standard_Integer num) const;
0124 
0125   //! Returns count of recorded Entities (i.e. size of Directory)
0126   Standard_EXPORT virtual Standard_Integer NbEntities() const Standard_OVERRIDE;
0127 
0128   //! determines next suitable record from num; that is num+1 except
0129   //! for last one which gives 0
0130   Standard_EXPORT Standard_Integer
0131     FindNextRecord(const Standard_Integer num) const Standard_OVERRIDE;
0132 
0133   //! determines reference numbers in EntityNumber fields (called by
0134   //! SetEntities from IGESReaderTool)
0135   //! works on "Integer" type Parameters, because IGES does not
0136   //! distinguish Integer and Entity Refs : every Integer which is
0137   //! odd and less than twice NbRecords can be an Entity Ref ...
0138   //! (Ref Number is then (N+1)/2 if N is the Integer Value)
0139   Standard_EXPORT void SetEntityNumbers();
0140 
0141   //! Returns the recorded Global Check
0142   Standard_EXPORT Handle(Interface_Check) GlobalCheck() const;
0143 
0144   //! allows to set a default line weight, will be later applied at
0145   //! load time, on Entities which have no specified line weight
0146   Standard_EXPORT void SetDefaultLineWeight(const Standard_Real defw);
0147 
0148   //! Returns the recorded Default Line Weight, if there is
0149   //! (else, returns 0)
0150   Standard_EXPORT Standard_Real DefaultLineWeight() const;
0151 
0152   DEFINE_STANDARD_RTTIEXT(IGESData_IGESReaderData, Interface_FileReaderData)
0153 
0154 protected:
0155 private:
0156   IGESData_IGESType                       thectyp;
0157   Handle(TColStd_HSequenceOfHAsciiString) thestar;
0158   Handle(Interface_ParamSet)              theparh;
0159   IGESData_GlobalSection                  thehead;
0160   IGESData_Array1OfDirPart                thedirs;
0161   IGESData_ReadStage                      thestep;
0162   Standard_Real                           thedefw;
0163   Handle(Interface_Check)                 thechk;
0164 };
0165 
0166 #endif // _IGESData_IGESReaderData_HeaderFile