Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:58

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 
0031 class IGESDefs_AttributeTable;
0032 DEFINE_STANDARD_HANDLE(IGESDefs_AttributeTable, IGESData_IGESEntity)
0033 
0034 //! defines IGES Attribute Table, Type <422> Form <0, 1>
0035 //! in package IGESDefs
0036 //! This class is used to represent an occurrence of
0037 //! Attribute Table. This Class may be independent
0038 //! or dependent or pointed at by other Entities.
0039 class IGESDefs_AttributeTable : public IGESData_IGESEntity
0040 {
0041 
0042 public:
0043 
0044   
0045   Standard_EXPORT IGESDefs_AttributeTable();
0046   
0047   //! This method is used to set the fields of the class
0048   //! AttributeTable
0049   //! - attributes : Attribute instances, created as
0050   //! (1,NbAttributes,1,NbRows)
0051   //! - NbRows = 1 is a particular case (Form 0)
0052   Standard_EXPORT void Init (const Handle(TColStd_HArray2OfTransient)& attributes);
0053   
0054   //! Sets a Definition as Structure information
0055   //! (works by calling InitMisc)
0056   Standard_EXPORT void SetDefinition (const Handle(IGESDefs_AttributeDef)& def);
0057   
0058   //! Return the Structure information in Directory Entry,
0059   //! casted as an AttributeDef
0060   Standard_EXPORT Handle(IGESDefs_AttributeDef) Definition() const;
0061   
0062   //! returns Number of Rows. Remark that it is always 1 if Form = 0
0063   //! It means that the list of Attributes (by their number, and for each
0064   //! one its type and ValueCount) is repeated <NbRows> times
0065   Standard_EXPORT Standard_Integer NbRows() const;
0066   
0067   //! returns Number of Attributes
0068   Standard_EXPORT Standard_Integer NbAttributes() const;
0069   
0070   //! returns the Type of an Attribute, given its No. : it is read in the
0071   //! Definition.
0072   //! (1 : Integer, 2 : Real, 3 : String, 4 : Entity, 6 : Logical)
0073   Standard_EXPORT Standard_Integer DataType (const Standard_Integer Atnum) const;
0074   
0075   //! returns the Count of Value for an Attribute, given its No. :
0076   //! it is read in the Definition.
0077   Standard_EXPORT Standard_Integer ValueCount (const Standard_Integer Atnum) const;
0078   
0079   Standard_EXPORT Handle(Standard_Transient) AttributeList (const Standard_Integer Attribnum, const Standard_Integer Rownum) const;
0080   
0081   //! Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Integer
0082   //! Error if Indices out of Range, or no Value defined, or not an Integer
0083   Standard_EXPORT Standard_Integer AttributeAsInteger (const Standard_Integer AtNum, const Standard_Integer Rownum, 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, const Standard_Integer Rownum, const Standard_Integer ValNum) const;
0088   
0089   //! Returns Attribute Value <AtNum, Rownum, rank ValNum> as an Integer
0090   Standard_EXPORT Handle(TCollection_HAsciiString) AttributeAsString (const Standard_Integer AtNum, const Standard_Integer Rownum, const Standard_Integer 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 Handle(IGESData_IGESEntity) AttributeAsEntity (const Standard_Integer AtNum, const Standard_Integer Rownum, const Standard_Integer ValNum) const;
0095   
0096   //! Returns Attribute Value <AtNum, Rownum, rank ValNum> as a Boolean
0097   //! Error if Indices out of Range, or no Value defined, or not a Logical
0098   Standard_EXPORT Standard_Boolean AttributeAsLogical (const Standard_Integer AtNum, const Standard_Integer Rownum, const Standard_Integer ValNum) const;
0099 
0100 
0101 
0102 
0103   DEFINE_STANDARD_RTTIEXT(IGESDefs_AttributeTable,IGESData_IGESEntity)
0104 
0105 protected:
0106 
0107 
0108 
0109 
0110 private:
0111 
0112 
0113   Handle(TColStd_HArray2OfTransient) theAttributes;
0114 
0115 
0116 };
0117 
0118 
0119 
0120 
0121 
0122 
0123 
0124 #endif // _IGESDefs_AttributeTable_HeaderFile