Back to home page

EIC code displayed by LXR

 
 

    


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

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