Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:06

0001 // Created on: 1992-02-11
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 _StepData_StepModel_HeaderFile
0018 #define _StepData_StepModel_HeaderFile
0019 
0020 #include <Interface_EntityList.hxx>
0021 #include <TColStd_HArray1OfInteger.hxx>
0022 #include <Interface_InterfaceModel.hxx>
0023 #include <Resource_FormatType.hxx>
0024 #include <StepData_Factors.hxx>
0025 #include <StepData_ConfParameters.hxx>
0026 
0027 class Standard_Transient;
0028 class Interface_EntityIterator;
0029 class Interface_Check;
0030 class TCollection_HAsciiString;
0031 
0032 class StepData_StepModel;
0033 DEFINE_STANDARD_HANDLE(StepData_StepModel, Interface_InterfaceModel)
0034 
0035 //! Gives access to
0036 //! - entities in a STEP file,
0037 //! - the STEP file header.
0038 class StepData_StepModel : public Interface_InterfaceModel
0039 {
0040 
0041 public:
0042 
0043   
0044   //! Creates an empty STEP model with an empty header.
0045   Standard_EXPORT StepData_StepModel();
0046   
0047   //! returns entity given its rank.
0048   //! Same as InterfaceEntity, but with a shorter name
0049   Standard_EXPORT Handle(Standard_Transient) Entity (const Standard_Integer num) const;
0050   
0051   //! gets header from another Model (uses Header Protocol)
0052   Standard_EXPORT void GetFromAnother (const Handle(Interface_InterfaceModel)& other) Standard_OVERRIDE;
0053   
0054   //! Returns a New Empty Model, same type as <me>, i.e. StepModel
0055   Standard_EXPORT Handle(Interface_InterfaceModel) NewEmptyModel() const Standard_OVERRIDE;
0056   
0057   //! returns Header entities under the form of an iterator
0058   Standard_EXPORT Interface_EntityIterator Header() const;
0059   
0060   //! says if a Header entity has a specified type
0061   Standard_EXPORT Standard_Boolean HasHeaderEntity (const Handle(Standard_Type)& atype) const;
0062   
0063   //! Returns Header entity with specified type, if there is
0064   Standard_EXPORT Handle(Standard_Transient) HeaderEntity (const Handle(Standard_Type)& atype) const;
0065   
0066   //! Clears the Header
0067   Standard_EXPORT void ClearHeader() Standard_OVERRIDE;
0068   
0069   //! Adds an Entity to the Header
0070   Standard_EXPORT void AddHeaderEntity (const Handle(Standard_Transient)& ent);
0071   
0072   //! Specific Check, checks Header Items with HeaderProtocol
0073   Standard_EXPORT virtual void VerifyCheck (Handle(Interface_Check)& ach) const Standard_OVERRIDE;
0074   
0075   //! Dumps the Header, with the Header Protocol of StepData.
0076   //! If the Header Protocol is not defined, for each Header Entity,
0077   //! prints its Type. Else sends the Header under the form of
0078   //! HEADER Section of an Ascii Step File
0079   //! <level> is not used because Header is not so big
0080   Standard_EXPORT void DumpHeader (Standard_OStream& S, const Standard_Integer level = 0) const Standard_OVERRIDE;
0081   
0082   //! erases specific labels, i.e. clears the map (entity-ident)
0083   Standard_EXPORT void ClearLabels() Standard_OVERRIDE;
0084   
0085   //! Attaches an ident to an entity to produce a label
0086   //! (does nothing if <ent> is not in <me>)
0087   Standard_EXPORT void SetIdentLabel (const Handle(Standard_Transient)& ent, const Standard_Integer ident);
0088   
0089   //! returns the label ident attached to an entity, 0 if not in me
0090   Standard_EXPORT Standard_Integer IdentLabel (const Handle(Standard_Transient)& ent) const;
0091   
0092   //! Prints label specific to STEP norm for a given entity, i.e.
0093   //! if a LabelIdent has been recorded, its value with '#', else
0094   //! the number in the model with '#' and between ()
0095   Standard_EXPORT void PrintLabel (const Handle(Standard_Transient)& ent, Standard_OStream& S) const Standard_OVERRIDE;
0096   
0097   //! Returns a string with the label attached to a given entity,
0098   //! same form as for PrintLabel
0099   Standard_EXPORT Handle(TCollection_HAsciiString) StringLabel (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
0100 
0101   //! Return the encoding of STEP file for converting names into UNICODE.
0102   //! Initialized from "read.step.codepage" variable by constructor, which is Resource_UTF8 by default.
0103   Resource_FormatType SourceCodePage() const { return InternalParameters.ReadCodePage; }
0104 
0105   //! Return the encoding of STEP file for converting names into UNICODE.
0106   void SetSourceCodePage (Resource_FormatType theCode) { InternalParameters.ReadCodePage = theCode; }
0107 
0108   //! Sets local length unit using for transfer process
0109   Standard_EXPORT void SetLocalLengthUnit(const Standard_Real theUnit);
0110 
0111   //! Returns local length unit using for transfer process (1 by default)
0112   Standard_EXPORT Standard_Real LocalLengthUnit() const;
0113 
0114   //! Sets length unit using for writing process
0115   Standard_EXPORT void SetWriteLengthUnit(const Standard_Real theUnit);
0116 
0117   //! Returns length unit using for writing process (1 by default)
0118   Standard_EXPORT Standard_Real WriteLengthUnit() const;
0119 
0120   //! Returns the unit initialization flag
0121   //! True - the unit was initialized
0122   //! False - the unit value was not initialized, the default value is used
0123   Standard_Boolean IsInitializedUnit() const { return myReadUnitIsInitialized; }
0124 
0125 public:
0126 
0127   StepData_ConfParameters InternalParameters;
0128 
0129   DEFINE_STANDARD_RTTIEXT(StepData_StepModel,Interface_InterfaceModel)
0130 
0131 protected:
0132 
0133 
0134 
0135 
0136 private:
0137 
0138 
0139   Interface_EntityList theheader;
0140   Handle(TColStd_HArray1OfInteger) theidnums;
0141   Standard_Boolean myReadUnitIsInitialized;
0142   Standard_Real myWriteUnit;
0143   Standard_Real myLocalLengthUnit;
0144 };
0145 
0146 
0147 
0148 
0149 
0150 
0151 
0152 #endif // _StepData_StepModel_HeaderFile