Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-04 09:14:52

0001 // Created on: 1993-01-13
0002 // Created by: CKY / Contract Toubro-Larsen ( Deepak PRABHU )
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_AttributeDef_HeaderFile
0018 #define _IGESDefs_AttributeDef_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <NCollection_Array1.hxx>
0025 #include <NCollection_HArray1.hxx>
0026 #include <Standard_Transient.hxx>
0027 #include <IGESData_IGESEntity.hxx>
0028 class TCollection_HAsciiString;
0029 class IGESDefs_HArray1OfHArray1OfTextDisplayTemplate;
0030 class IGESGraph_TextDisplayTemplate;
0031 class Standard_Transient;
0032 
0033 //! defines IGES Attribute Table Definition Entity,
0034 //! Type <322> Form [0, 1, 2] in package IGESDefs.
0035 //! This is class is used to support the concept of well
0036 //! defined collection of attributes, whether it is a table
0037 //! or a single row of attributes.
0038 class IGESDefs_AttributeDef : public IGESData_IGESEntity
0039 {
0040 
0041 public:
0042   Standard_EXPORT IGESDefs_AttributeDef();
0043 
0044   Standard_EXPORT void Init(
0045     const occ::handle<TCollection_HAsciiString>&                             aName,
0046     const int                                                                aListType,
0047     const occ::handle<NCollection_HArray1<int>>&                             attrTypes,
0048     const occ::handle<NCollection_HArray1<int>>&                             attrValueDataTypes,
0049     const occ::handle<NCollection_HArray1<int>>&                             attrValueCounts,
0050     const occ::handle<NCollection_HArray1<occ::handle<Standard_Transient>>>& attrValues,
0051     const occ::handle<IGESDefs_HArray1OfHArray1OfTextDisplayTemplate>&       attrValuePointers);
0052 
0053   //! Returns True if a Table Name is defined
0054   Standard_EXPORT bool HasTableName() const;
0055 
0056   //! returns the Attribute Table name, or comment
0057   //! (default = null, no name : seeHasTableName)
0058   Standard_EXPORT occ::handle<TCollection_HAsciiString> TableName() const;
0059 
0060   //! returns the Attribute List Type
0061   Standard_EXPORT int ListType() const;
0062 
0063   //! returns the Number of Attributes
0064   Standard_EXPORT int NbAttributes() const;
0065 
0066   //! returns the num'th Attribute Type
0067   //! raises exception if num <= 0 or num > NbAttributes()
0068   Standard_EXPORT int AttributeType(const int num) const;
0069 
0070   //! returns the num'th Attribute value data type
0071   //! raises exception if num <= 0 or num > NbAttributes()
0072   Standard_EXPORT int AttributeValueDataType(const int num) const;
0073 
0074   //! returns the num'th Attribute value count
0075   //! raises exception if num <= 0 or num > NbAttributes()
0076   Standard_EXPORT int AttributeValueCount(const int num) const;
0077 
0078   //! returns false if Values are defined (i.e. for Form = 1 or 2)
0079   Standard_EXPORT bool HasValues() const;
0080 
0081   //! returns false if TextDisplays are defined (i.e. for Form = 2)
0082   Standard_EXPORT bool HasTextDisplay() const;
0083 
0084   Standard_EXPORT occ::handle<IGESGraph_TextDisplayTemplate> AttributeTextDisplay(
0085     const int AttrNum,
0086     const int PointerNum) const;
0087 
0088   //! Returns the List of Attributes <AttrNum>, as a Transient.
0089   //! Its effective Type depends of the Type of Attribute :
0090   //! HArray1OfInteger for Integer, Logical(0-1),
0091   //! HArray1OfReal for Real, HArray1OfHSaciiString for String,
0092   //! HArray1OfIGESEntity for Entity (Pointer)
0093   //! See methods AttributeAs... for an accurate access
0094   Standard_EXPORT occ::handle<Standard_Transient> AttributeList(const int AttrNum) const;
0095 
0096   //! Returns Attribute Value <AttrNum, rank ValueNum> as an Integer
0097   //! Error if Indices out of Range, or no Value defined, or not an Integer
0098   Standard_EXPORT int AttributeAsInteger(const int AttrNum, const int ValueNum) const;
0099 
0100   //! Returns Attribute Value <AttrNum, rank ValueNum> as a Real
0101   //! Error if Indices out of Range, or no Value defined, or not a Real
0102   Standard_EXPORT double AttributeAsReal(const int AttrNum, const int ValueNum) const;
0103 
0104   //! Returns Attribute Value <AttrNum, rank ValueNum> as an Integer
0105   Standard_EXPORT occ::handle<TCollection_HAsciiString> AttributeAsString(const int AttrNum,
0106                                                                           const int ValueNum) const;
0107 
0108   //! Returns Attribute Value <AttrNum, rank ValueNum> as an Entity
0109   //! Error if Indices out of Range, or no Value defined, or not a Entity
0110   Standard_EXPORT occ::handle<IGESData_IGESEntity> AttributeAsEntity(const int AttrNum,
0111                                                                      const int ValueNum) const;
0112 
0113   //! Returns Attribute Value <AttrNum, rank ValueNum> as a Boolean
0114   //! Error if Indices out of Range, or no Value defined, or not a Logical
0115   Standard_EXPORT bool AttributeAsLogical(const int AttrNum, const int ValueNum) const;
0116 
0117   DEFINE_STANDARD_RTTIEXT(IGESDefs_AttributeDef, IGESData_IGESEntity)
0118 
0119 private:
0120   occ::handle<TCollection_HAsciiString>                             theName;
0121   int                                                               theListType;
0122   occ::handle<NCollection_HArray1<int>>                             theAttrTypes;
0123   occ::handle<NCollection_HArray1<int>>                             theAttrValueDataTypes;
0124   occ::handle<NCollection_HArray1<int>>                             theAttrValueCounts;
0125   occ::handle<NCollection_HArray1<occ::handle<Standard_Transient>>> theAttrValues;
0126   occ::handle<IGESDefs_HArray1OfHArray1OfTextDisplayTemplate>       theAttrValuePointers;
0127 };
0128 
0129 #endif // _IGESDefs_AttributeDef_HeaderFile