Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-16 09:16:19

0001 // Created on: 1993-08-12
0002 // Created by: Frederic MAUPAS
0003 // Copyright (c) 1993-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 _APIHeaderSection_MakeHeader_HeaderFile
0018 #define _APIHeaderSection_MakeHeader_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Boolean.hxx>
0025 #include <Standard_Integer.hxx>
0026 #include <TCollection_HAsciiString.hxx>
0027 #include <NCollection_Array1.hxx>
0028 #include <NCollection_HArray1.hxx>
0029 class HeaderSection_FileName;
0030 class HeaderSection_FileSchema;
0031 class HeaderSection_FileDescription;
0032 class StepData_StepModel;
0033 class Interface_Protocol;
0034 class TCollection_HAsciiString;
0035 
0036 //! This class allows to consult and prepare/edit data stored in
0037 //! a Step Model Header
0038 class APIHeaderSection_MakeHeader
0039 {
0040 public:
0041   DEFINE_STANDARD_ALLOC
0042 
0043   //! Prepares a new MakeHeader from scratch
0044   Standard_EXPORT APIHeaderSection_MakeHeader(const int shapetype = 0);
0045 
0046   //! Prepares a MakeHeader from the content of a StepModel
0047   //! See IsDone to know if the Header is well defined
0048   Standard_EXPORT APIHeaderSection_MakeHeader(const occ::handle<StepData_StepModel>& model);
0049 
0050   //! Cancels the former definition and gives a FileName
0051   //! To be used when a Model has no well defined Header
0052   Standard_EXPORT void Init(const char* const nameval);
0053 
0054   //! Returns True if all data have been defined (see also
0055   //! HasFn, HasFs, HasFd)
0056   Standard_EXPORT bool IsDone() const;
0057 
0058   //! Creates an empty header for a new
0059   //! STEP model and allows the header fields to be completed.
0060   Standard_EXPORT void Apply(const occ::handle<StepData_StepModel>& model) const;
0061 
0062   //! Builds a Header, creates a new StepModel, then applies the
0063   //! Header to the StepModel
0064   //! The Schema Name is taken from the Protocol (if it inherits
0065   //! from StepData, else it is left in blanks)
0066   Standard_EXPORT occ::handle<StepData_StepModel> NewModel(
0067     const occ::handle<Interface_Protocol>& protocol) const;
0068 
0069   //! Checks whether there is a
0070   //! file_name entity. Returns True if there is one.
0071   Standard_EXPORT bool HasFn() const;
0072 
0073   //! Returns the file_name entity.
0074   //! Returns an empty entity if the file_name entity is not initialized.
0075   Standard_EXPORT occ::handle<HeaderSection_FileName> FnValue() const;
0076 
0077   Standard_EXPORT void SetName(const occ::handle<TCollection_HAsciiString>& aName);
0078 
0079   //! Returns the name attribute for the file_name entity.
0080   Standard_EXPORT occ::handle<TCollection_HAsciiString> Name() const;
0081 
0082   Standard_EXPORT void SetTimeStamp(const occ::handle<TCollection_HAsciiString>& aTimeStamp);
0083 
0084   //! Returns the value of the time_stamp attribute for the file_name entity.
0085   Standard_EXPORT occ::handle<TCollection_HAsciiString> TimeStamp() const;
0086 
0087   Standard_EXPORT void SetAuthor(
0088     const occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>& aAuthor);
0089 
0090   Standard_EXPORT void SetAuthorValue(const int                                    num,
0091                                       const occ::handle<TCollection_HAsciiString>& aAuthor);
0092 
0093   Standard_EXPORT occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>> Author()
0094     const;
0095 
0096   //! Returns the value of the name attribute for the file_name entity.
0097   Standard_EXPORT occ::handle<TCollection_HAsciiString> AuthorValue(const int num) const;
0098 
0099   //! Returns the number of values for the author attribute in the file_name entity.
0100   Standard_EXPORT int NbAuthor() const;
0101 
0102   Standard_EXPORT void SetOrganization(
0103     const occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>& aOrganization);
0104 
0105   Standard_EXPORT void SetOrganizationValue(
0106     const int                                    num,
0107     const occ::handle<TCollection_HAsciiString>& aOrganization);
0108 
0109   Standard_EXPORT occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>
0110                   Organization() const;
0111 
0112   //! Returns the value of attribute
0113   //! organization for the file_name entity.
0114   Standard_EXPORT occ::handle<TCollection_HAsciiString> OrganizationValue(const int num) const;
0115 
0116   //! Returns the number of values for
0117   //! the organization attribute in the file_name entity.
0118   Standard_EXPORT int NbOrganization() const;
0119 
0120   Standard_EXPORT void SetPreprocessorVersion(
0121     const occ::handle<TCollection_HAsciiString>& aPreprocessorVersion);
0122 
0123   //! Returns the name of the preprocessor_version for the file_name entity.
0124   Standard_EXPORT occ::handle<TCollection_HAsciiString> PreprocessorVersion() const;
0125 
0126   Standard_EXPORT void SetOriginatingSystem(
0127     const occ::handle<TCollection_HAsciiString>& aOriginatingSystem);
0128 
0129   Standard_EXPORT occ::handle<TCollection_HAsciiString> OriginatingSystem() const;
0130 
0131   Standard_EXPORT void SetAuthorisation(
0132     const occ::handle<TCollection_HAsciiString>& aAuthorisation);
0133 
0134   //! Returns the value of the authorization attribute for the file_name entity.
0135   Standard_EXPORT occ::handle<TCollection_HAsciiString> Authorisation() const;
0136 
0137   //! Checks whether there is a file_schema entity. Returns True if there is one.
0138   Standard_EXPORT bool HasFs() const;
0139 
0140   //! Returns the file_schema entity. Returns an empty entity if the file_schema entity is not
0141   //! initialized.
0142   Standard_EXPORT occ::handle<HeaderSection_FileSchema> FsValue() const;
0143 
0144   Standard_EXPORT void SetSchemaIdentifiers(
0145     const occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>&
0146       aSchemaIdentifiers);
0147 
0148   Standard_EXPORT void SetSchemaIdentifiersValue(
0149     const int                                    num,
0150     const occ::handle<TCollection_HAsciiString>& aSchemaIdentifier);
0151 
0152   Standard_EXPORT occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>
0153                   SchemaIdentifiers() const;
0154 
0155   //! Returns the value of the schema_identifier attribute for the file_schema entity.
0156   Standard_EXPORT occ::handle<TCollection_HAsciiString> SchemaIdentifiersValue(const int num) const;
0157 
0158   //! Returns the number of values for the schema_identifier attribute in the file_schema entity.
0159   Standard_EXPORT int NbSchemaIdentifiers() const;
0160 
0161   //! Add a subname of schema (if not yet in the list)
0162   Standard_EXPORT void AddSchemaIdentifier(
0163     const occ::handle<TCollection_HAsciiString>& aSchemaIdentifier);
0164 
0165   //! Checks whether there is a file_description entity. Returns True if there is one.
0166   Standard_EXPORT bool HasFd() const;
0167 
0168   //! Returns the file_description
0169   //! entity. Returns an empty entity if the file_description entity is not initialized.
0170   Standard_EXPORT occ::handle<HeaderSection_FileDescription> FdValue() const;
0171 
0172   Standard_EXPORT void SetDescription(
0173     const occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>& aDescription);
0174 
0175   Standard_EXPORT void SetDescriptionValue(
0176     const int                                    num,
0177     const occ::handle<TCollection_HAsciiString>& aDescription);
0178 
0179   Standard_EXPORT occ::handle<NCollection_HArray1<occ::handle<TCollection_HAsciiString>>>
0180                   Description() const;
0181 
0182   //! Returns the value of the
0183   //! description attribute for the file_description entity.
0184   Standard_EXPORT occ::handle<TCollection_HAsciiString> DescriptionValue(const int num) const;
0185 
0186   //! Returns the number of values for
0187   //! the file_description entity in the STEP file header.
0188   Standard_EXPORT int NbDescription() const;
0189 
0190   Standard_EXPORT void SetImplementationLevel(
0191     const occ::handle<TCollection_HAsciiString>& aImplementationLevel);
0192 
0193   //! Returns the value of the
0194   //! implementation_level attribute for the file_description entity.
0195   Standard_EXPORT occ::handle<TCollection_HAsciiString> ImplementationLevel() const;
0196 
0197 private:
0198   bool                                       done;
0199   occ::handle<HeaderSection_FileName>        fn;
0200   occ::handle<HeaderSection_FileSchema>      fs;
0201   occ::handle<HeaderSection_FileDescription> fd;
0202 };
0203 
0204 #endif // _APIHeaderSection_MakeHeader_HeaderFile