Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-16 09:17:31

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_IGESModel_HeaderFile
0018 #define _IGESData_IGESModel_HeaderFile
0019 
0020 #include <IGESData_GlobalSection.hxx>
0021 #include <Interface_InterfaceModel.hxx>
0022 
0023 class IGESData_IGESEntity;
0024 class Interface_Check;
0025 class Standard_Transient;
0026 class TCollection_HAsciiString;
0027 
0028 //! Defines the file header and
0029 //! entities for IGES files. These headers and entities result from
0030 //! a complete data translation using the IGES data exchange processor.
0031 //! Each entity is contained in a single model only and has a
0032 //! unique identifier. You can access this identifier using the method Number.
0033 //! Gives an access to the general data in the Start and the Global
0034 //! sections of an IGES file.
0035 //! The IGES file includes the following sections:
0036 //! -Start,
0037 //! -Global,
0038 //! -Directory Entry,
0039 //! -Parameter Data,
0040 //! -Terminate
0041 class IGESData_IGESModel : public Interface_InterfaceModel
0042 {
0043 
0044 public:
0045   Standard_EXPORT IGESData_IGESModel();
0046 
0047   //! Erases all data specific to IGES file Header (Start + Global)
0048   Standard_EXPORT void ClearHeader() override;
0049 
0050   //! Prints the IGES file header
0051   //! (Start and Global Sections) to the log file. The integer
0052   //! parameter is intended to be used as a level indicator but is not used at present.
0053   Standard_EXPORT void DumpHeader(Standard_OStream& S, const int level = 0) const override;
0054 
0055   //! Returns Model's Start Section (list of comment lines)
0056   Standard_EXPORT occ::handle<NCollection_HSequence<occ::handle<TCollection_HAsciiString>>>
0057                   StartSection() const;
0058 
0059   //! Returns the count of recorded Start Lines
0060   Standard_EXPORT int NbStartLines() const;
0061 
0062   //! Returns a line from the IGES file
0063   //! Start section by specifying its number. An empty string is
0064   //! returned if the number given is out of range, the range being
0065   //! from 1 to NbStartLines.
0066   Standard_EXPORT const char* StartLine(const int num) const;
0067 
0068   //! Clears the IGES file Start Section
0069   Standard_EXPORT void ClearStartSection();
0070 
0071   //! Sets a new Start section from a list of strings.
0072   //! If copy is false, the Start section will be shared. Any
0073   //! modifications made to the strings later on, will have an effect on
0074   //! the Start section. If copy is true (default value),
0075   //! an independent copy of the strings is created and used as
0076   //! the Start section. Any modifications made to the strings
0077   //! later on, will have no effect on the Start section.
0078   Standard_EXPORT void SetStartSection(
0079     const occ::handle<NCollection_HSequence<occ::handle<TCollection_HAsciiString>>>& list,
0080     const bool                                                                       copy = true);
0081 
0082   //! Adds a new string to the existing
0083   //! Start section at the end if atnum is 0 or not given, or before
0084   //! atnumth line.
0085   Standard_EXPORT void AddStartLine(const char* const line, const int atnum = 0);
0086 
0087   //! Returns the Global section of the IGES file.
0088   const IGESData_GlobalSection& GlobalSection() const { return theheader; }
0089 
0090   //! Returns the Global section of the IGES file.
0091   IGESData_GlobalSection& ChangeGlobalSection() { return theheader; }
0092 
0093   //! Sets the Global section of the IGES file.
0094   Standard_EXPORT void SetGlobalSection(const IGESData_GlobalSection& header);
0095 
0096   //! Sets some of the Global section
0097   //! parameters with the values defined by the translation
0098   //! parameters. param may be:
0099   //! - receiver (value read in XSTEP.iges.header.receiver),
0100   //! - author (value read in XSTEP.iges.header.author),
0101   //! - company (value read in XSTEP.iges.header.company).
0102   //! The default value for param is an empty string.
0103   //! Returns True when done and if param is given, False if param is
0104   //! unknown or empty. Note: Set the unit in the IGES
0105   //! file Global section via IGESData_BasicEditor class.
0106   Standard_EXPORT bool ApplyStatic(const char* const param = "");
0107 
0108   //! Returns an IGES entity given by its rank number.
0109   Standard_EXPORT occ::handle<IGESData_IGESEntity> Entity(const int num) const;
0110 
0111   //! Returns the equivalent DE Number for an Entity, i.e.
0112   //! 2*Number(ent)-1 , or 0 if <ent> is unknown from <me>
0113   //! This DE Number is used for File Writing for instance
0114   Standard_EXPORT int DNum(const occ::handle<IGESData_IGESEntity>& ent) const;
0115 
0116   //! gets Header (GlobalSection) from another Model
0117   Standard_EXPORT void GetFromAnother(const occ::handle<Interface_InterfaceModel>& other) override;
0118 
0119   //! Returns a New Empty Model, same type as <me> i.e. IGESModel
0120   Standard_EXPORT occ::handle<Interface_InterfaceModel> NewEmptyModel() const override;
0121 
0122   //! Checks that the IGES file Global
0123   //! section contains valid data that conforms to the IGES specifications.
0124   Standard_EXPORT void VerifyCheck(occ::handle<Interface_Check>& ach) const override;
0125 
0126   //! Sets LineWeights of contained Entities according header data
0127   //! (MaxLineWeight and LineWeightGrad) or to a default value for
0128   //! undefined weights
0129   Standard_EXPORT void SetLineWeights(const double defw);
0130 
0131   //! erases specific labels, i.e. does nothing
0132   Standard_EXPORT void ClearLabels() override;
0133 
0134   //! Prints label specific to IGES norm for a given entity, i.e.
0135   //! its directory entry number (2*Number-1)
0136   Standard_EXPORT void PrintLabel(const occ::handle<Standard_Transient>& ent,
0137                                   Standard_OStream&                      S) const override;
0138 
0139   //! Prints label specific to IGES norm for a given -- --
0140   //! entity, i.e. its directory entry number (2*Number-1)
0141   //! in the log file format.
0142   Standard_EXPORT void PrintToLog(const occ::handle<Standard_Transient>& ent,
0143                                   Standard_OStream&                      S) const override;
0144 
0145   //! Prints label specific to IGES norm for a given entity, i.e.
0146   //! its directory entry number (2*Number-1)
0147   Standard_EXPORT void PrintInfo(const occ::handle<Standard_Transient>& ent,
0148                                  Standard_OStream&                      S) const;
0149 
0150   //! Returns a string with the label attached to a given entity,
0151   //! i.e. a string "Dnn" with nn = directory entry number (2*N-1)
0152   Standard_EXPORT occ::handle<TCollection_HAsciiString> StringLabel(
0153     const occ::handle<Standard_Transient>& ent) const override;
0154 
0155   DEFINE_STANDARD_RTTIEXT(IGESData_IGESModel, Interface_InterfaceModel)
0156 
0157 private:
0158   occ::handle<NCollection_HSequence<occ::handle<TCollection_HAsciiString>>> thestart;
0159   IGESData_GlobalSection                                                    theheader;
0160 };
0161 
0162 #endif // _IGESData_IGESModel_HeaderFile