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