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