Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-25 10:09:22

0001 // Created on: 1993-01-09
0002 // Created by: CKY / Contract Toubro-Larsen ( Arun MENON )
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 _IGESDefs_AttributeTable_HeaderFile
0018 #define _IGESDefs_AttributeTable_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 #include <NCollection_Array2.hxx>
0025 #include <NCollection_HArray2.hxx>
0026 #include <IGESData_IGESEntity.hxx>
0027 #include <Standard_Integer.hxx>
0028 class IGESDefs_AttributeDef;
0029 class Standard_Transient;
0030 class TCollection_HAsciiString;
0031 
0032 //! defines IGES Attribute Table, Type <422> Form <0, 1>
0033 //! in package IGESDefs
0034 //! This class is used to represent an occurrence of
0035 //! Attribute Table. This Class may be independent
0036 //! or dependent or pointed at by other Entities.
0037 class IGESDefs_AttributeTable : public IGESData_IGESEntity
0038 {
0039 
0040 public:
0041   Standard_EXPORT IGESDefs_AttributeTable();
0042 
0043   //! This method is used to set the fields of the class
0044   //! AttributeTable
0045   //! - attributes : Attribute instances, created as
0046   //! (1,NbAttributes,1,NbRows)
0047   //! - NbRows = 1 is a particular case (Form 0)
0048   Standard_EXPORT void Init(
0049     const occ::handle<NCollection_HArray2<occ::handle<Standard_Transient>>>& attributes);
0050 
0051   //! Sets a Definition as Structure information
0052   //! (works by calling InitMisc)
0053   Standard_EXPORT void SetDefinition(const occ::handle<IGESDefs_AttributeDef>& def);
0054 
0055   //! Return the Structure information in Directory Entry,
0056   //! casted as an AttributeDef
0057   Standard_EXPORT occ::handle<IGESDefs_AttributeDef> Definition() const;
0058 
0059   //! returns Number of Rows. Remark that it is always 1 if Form = 0
0060   //! It means that the list of Attributes (by their number, and for each
0061   //! one its type and ValueCount) is repeated <NbRows> times
0062   Standard_EXPORT int NbRows() const;
0063 
0064   //! returns Number of Attributes
0065   Standard_EXPORT int NbAttributes() const;
0066 
0067   //! returns the Type of an Attribute, given its No. : it is read in the
0068   //! Definition.
0069   //! (1 : Integer, 2 : Real, 3 : String, 4 : Entity, 6 : Logical)
0070   Standard_EXPORT int DataType(const int Atnum) const;
0071 
0072   //! returns the Count of Value for an Attribute, given its No. :
0073   //! it is read in the Definition.
0074   Standard_EXPORT int ValueCount(const int Atnum) const;
0075 
0076   Standard_EXPORT occ::handle<Standard_Transient> AttributeList(const int Attribnum,
0077                                                                 const int Rownum) const;
0078 
0079   //! Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Integer
0080   //! Error if Indices out of Range, or no Value defined, or not an Integer
0081   Standard_EXPORT int AttributeAsInteger(const int AtNum, const int Rownum, const int ValNum) const;
0082 
0083   //! Returns Attribute Value <AtNum, Rownum, rank ValNum> as a Real
0084   //! Error if Indices out of Range, or no Value defined, or not a Real
0085   Standard_EXPORT double AttributeAsReal(const int AtNum, const int Rownum, const int ValNum) const;
0086 
0087   //! Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Integer
0088   Standard_EXPORT occ::handle<TCollection_HAsciiString> AttributeAsString(const int AtNum,
0089                                                                           const int Rownum,
0090                                                                           const int ValNum) const;
0091 
0092   //! Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Entity
0093   //! Error if Indices out of Range, or no Value defined, or not an Entity
0094   Standard_EXPORT occ::handle<IGESData_IGESEntity> AttributeAsEntity(const int AtNum,
0095                                                                      const int Rownum,
0096                                                                      const int ValNum) const;
0097 
0098   //! Returns Attribute Value <AtNum, Rownum, rank ValNum> as a Boolean
0099   //! Error if Indices out of Range, or no Value defined, or not a Logical
0100   Standard_EXPORT bool AttributeAsLogical(const int AtNum,
0101                                           const int Rownum,
0102                                           const int ValNum) const;
0103 
0104   DEFINE_STANDARD_RTTIEXT(IGESDefs_AttributeTable, IGESData_IGESEntity)
0105 
0106 private:
0107   occ::handle<NCollection_HArray2<occ::handle<Standard_Transient>>> theAttributes;
0108 };
0109 
0110 #endif // _IGESDefs_AttributeTable_HeaderFile