Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-29 08:16:18

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 <TColStd_HArray2OfTransient.hxx>
0024 #include <IGESData_IGESEntity.hxx>
0025 #include <Standard_Integer.hxx>
0026 class IGESDefs_AttributeDef;
0027 class Standard_Transient;
0028 class TCollection_HAsciiString;
0029 
0030 class IGESDefs_AttributeTable;
0031 DEFINE_STANDARD_HANDLE(IGESDefs_AttributeTable, IGESData_IGESEntity)
0032 
0033 //! defines IGES Attribute Table, Type <422> Form <0, 1>
0034 //! in package IGESDefs
0035 //! This class is used to represent an occurrence of
0036 //! Attribute Table. This Class may be independent
0037 //! or dependent or pointed at by other Entities.
0038 class IGESDefs_AttributeTable : public IGESData_IGESEntity
0039 {
0040 
0041 public:
0042   Standard_EXPORT IGESDefs_AttributeTable();
0043 
0044   //! This method is used to set the fields of the class
0045   //! AttributeTable
0046   //! - attributes : Attribute instances, created as
0047   //! (1,NbAttributes,1,NbRows)
0048   //! - NbRows = 1 is a particular case (Form 0)
0049   Standard_EXPORT void Init(const Handle(TColStd_HArray2OfTransient)& attributes);
0050 
0051   //! Sets a Definition as Structure information
0052   //! (works by calling InitMisc)
0053   Standard_EXPORT void SetDefinition(const Handle(IGESDefs_AttributeDef)& def);
0054 
0055   //! Return the Structure information in Directory Entry,
0056   //! casted as an AttributeDef
0057   Standard_EXPORT 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 Standard_Integer NbRows() const;
0063 
0064   //! returns Number of Attributes
0065   Standard_EXPORT Standard_Integer 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 Standard_Integer DataType(const Standard_Integer 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 Standard_Integer ValueCount(const Standard_Integer Atnum) const;
0075 
0076   Standard_EXPORT Handle(Standard_Transient) AttributeList(const Standard_Integer Attribnum,
0077                                                            const Standard_Integer 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 Standard_Integer AttributeAsInteger(const Standard_Integer AtNum,
0082                                                       const Standard_Integer Rownum,
0083                                                       const Standard_Integer ValNum) const;
0084 
0085   //! Returns Attribute Value <AtNum, Rownum, rank ValNum> as a Real
0086   //! Error if Indices out of Range, or no Value defined, or not a Real
0087   Standard_EXPORT Standard_Real AttributeAsReal(const Standard_Integer AtNum,
0088                                                 const Standard_Integer Rownum,
0089                                                 const Standard_Integer ValNum) const;
0090 
0091   //! Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Integer
0092   Standard_EXPORT Handle(TCollection_HAsciiString) AttributeAsString(
0093     const Standard_Integer AtNum,
0094     const Standard_Integer Rownum,
0095     const Standard_Integer ValNum) const;
0096 
0097   //! Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Entity
0098   //! Error if Indices out of Range, or no Value defined, or not an Entity
0099   Standard_EXPORT Handle(IGESData_IGESEntity) AttributeAsEntity(
0100     const Standard_Integer AtNum,
0101     const Standard_Integer Rownum,
0102     const Standard_Integer ValNum) const;
0103 
0104   //! Returns Attribute Value <AtNum, Rownum, rank ValNum> as a Boolean
0105   //! Error if Indices out of Range, or no Value defined, or not a Logical
0106   Standard_EXPORT Standard_Boolean AttributeAsLogical(const Standard_Integer AtNum,
0107                                                       const Standard_Integer Rownum,
0108                                                       const Standard_Integer ValNum) const;
0109 
0110   DEFINE_STANDARD_RTTIEXT(IGESDefs_AttributeTable, IGESData_IGESEntity)
0111 
0112 protected:
0113 private:
0114   Handle(TColStd_HArray2OfTransient) theAttributes;
0115 };
0116 
0117 #endif // _IGESDefs_AttributeTable_HeaderFile