Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/IGESData_IGESReaderData.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 <TCollection_HAsciiString.hxx>
0025 #include <NCollection_Sequence.hxx>
0026 #include <NCollection_HSequence.hxx>
0027 #include <IGESData_GlobalSection.hxx>
0028 #include <IGESData_DirPart.hxx>
0029 #include <NCollection_Array1.hxx>
0030 #include <IGESData_ReadStage.hxx>
0031 #include <Interface_FileReaderData.hxx>
0032 #include <Standard_Integer.hxx>
0033 #include <Standard_CString.hxx>
0034 #include <Interface_ParamType.hxx>
0035 class Interface_ParamSet;
0036 class Interface_Check;
0037 class IGESData_DirPart;
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 int nbe, const int nbp);
0053 
0054   //! adds a start line to start section
0055   Standard_EXPORT void AddStartLine(const char* const aval);
0056 
0057   //! Returns the Start Section in once
0058   Standard_EXPORT occ::handle<NCollection_HSequence<occ::handle<TCollection_HAsciiString>>>
0059                   StartSection() const;
0060 
0061   //! adds a parameter to global section's parameter list
0062   Standard_EXPORT void AddGlobal(const Interface_ParamType atype, const char* const aval);
0063 
0064   //! reads header (as GlobalSection) content from the ParamSet
0065   //! after it has been filled by successive calls to AddGlobal
0066   Standard_EXPORT void SetGlobalSection();
0067 
0068   //! returns header as GlobalSection
0069   Standard_EXPORT const IGESData_GlobalSection& GlobalSection() const;
0070 
0071   //! fills a DirPart, designated by its rank (that is, (N+1)/2 if N
0072   //! is its first number in section D)
0073   Standard_EXPORT void SetDirPart(const int         num,
0074                                   const int         i1,
0075                                   const int         i2,
0076                                   const int         i3,
0077                                   const int         i4,
0078                                   const int         i5,
0079                                   const int         i6,
0080                                   const int         i7,
0081                                   const int         i8,
0082                                   const int         i9,
0083                                   const int         i10,
0084                                   const int         i11,
0085                                   const int         i12,
0086                                   const int         i13,
0087                                   const int         i14,
0088                                   const int         i15,
0089                                   const int         i16,
0090                                   const int         i17,
0091                                   const char* const res1,
0092                                   const char* const res2,
0093                                   const char* const label,
0094                                   const char* const subs);
0095 
0096   //! returns DirPart identified by record no (half Dsect number)
0097   Standard_EXPORT const IGESData_DirPart& DirPart(const int num) const;
0098 
0099   //! returns values recorded in directory part n0 <num>
0100   Standard_EXPORT void DirValues(const int num,
0101                                  int&      i1,
0102                                  int&      i2,
0103                                  int&      i3,
0104                                  int&      i4,
0105                                  int&      i5,
0106                                  int&      i6,
0107                                  int&      i7,
0108                                  int&      i8,
0109                                  int&      i9,
0110                                  int&      i10,
0111                                  int&      i11,
0112                                  int&      i12,
0113                                  int&      i13,
0114                                  int&      i14,
0115                                  int&      i15,
0116                                  int&      i16,
0117                                  int&      i17,
0118                                  char*     res1,
0119                                  char*     res2,
0120                                  char*     label,
0121                                  char*     subs) const;
0122 
0123   //! returns "type" and "form" info from a directory part
0124   Standard_EXPORT IGESData_IGESType DirType(const int num) const;
0125 
0126   //! Returns count of recorded Entities (i.e. size of Directory)
0127   Standard_EXPORT int NbEntities() const override;
0128 
0129   //! determines next suitable record from num; that is num+1 except
0130   //! for last one which gives 0
0131   Standard_EXPORT int FindNextRecord(const int num) const 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 occ::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 double defw);
0147 
0148   //! Returns the recorded Default Line Weight, if there is
0149   //! (else, returns 0)
0150   Standard_EXPORT double DefaultLineWeight() const;
0151 
0152   DEFINE_STANDARD_RTTIEXT(IGESData_IGESReaderData, Interface_FileReaderData)
0153 
0154 private:
0155   IGESData_IGESType                                                         thectyp;
0156   occ::handle<NCollection_HSequence<occ::handle<TCollection_HAsciiString>>> thestar;
0157   occ::handle<Interface_ParamSet>                                           theparh;
0158   IGESData_GlobalSection                                                    thehead;
0159   NCollection_Array1<IGESData_DirPart>                                      thedirs;
0160   IGESData_ReadStage                                                        thestep;
0161   double                                                                    thedefw;
0162   occ::handle<Interface_Check>                                              thechk;
0163 };
0164 
0165 #endif // _IGESData_IGESReaderData_HeaderFile