1 // Created on: 1993-01-13
2 // Created by: CKY / Contract Toubro-Larsen ( Deepak PRABHU )
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _IGESDefs_AttributeDef_HeaderFile
18 #define _IGESDefs_AttributeDef_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Integer.hxx>
24 #include <TColStd_HArray1OfInteger.hxx>
25 #include <TColStd_HArray1OfTransient.hxx>
26 #include <IGESData_IGESEntity.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <Standard_Real.hxx>
29 class TCollection_HAsciiString;
30 class IGESDefs_HArray1OfHArray1OfTextDisplayTemplate;
31 class Standard_DimensionMismatch;
32 class Standard_OutOfRange;
33 class Standard_NullObject;
34 class IGESGraph_TextDisplayTemplate;
35 class Standard_Transient;
36 class IGESData_IGESEntity;
39 class IGESDefs_AttributeDef;
40 DEFINE_STANDARD_HANDLE(IGESDefs_AttributeDef, IGESData_IGESEntity)
42 //! defines IGES Attribute Table Definition Entity,
43 //! Type <322> Form [0, 1, 2] in package IGESDefs.
44 //! This is class is used to support the concept of well
45 //! defined collection of attributes, whether it is a table
46 //! or a single row of attributes.
47 class IGESDefs_AttributeDef : public IGESData_IGESEntity
53 Standard_EXPORT IGESDefs_AttributeDef();
55 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);
57 //! Returns True if a Table Name is defined
58 Standard_EXPORT Standard_Boolean HasTableName() const;
60 //! returns the Attribute Table name, or comment
61 //! (default = null, no name : seeHasTableName)
62 Standard_EXPORT Handle(TCollection_HAsciiString) TableName() const;
64 //! returns the Attribute List Type
65 Standard_EXPORT Standard_Integer ListType() const;
67 //! returns the Number of Attributes
68 Standard_EXPORT Standard_Integer NbAttributes() const;
70 //! returns the num'th Attribute Type
71 //! raises exception if num <= 0 or num > NbAttributes()
72 Standard_EXPORT Standard_Integer AttributeType (const Standard_Integer num) const;
74 //! returns the num'th Attribute value data type
75 //! raises exception if num <= 0 or num > NbAttributes()
76 Standard_EXPORT Standard_Integer AttributeValueDataType (const Standard_Integer num) const;
78 //! returns the num'th Attribute value count
79 //! raises exception if num <= 0 or num > NbAttributes()
80 Standard_EXPORT Standard_Integer AttributeValueCount (const Standard_Integer num) const;
82 //! returns false if Values are defined (i.e. for Form = 1 or 2)
83 Standard_EXPORT Standard_Boolean HasValues() const;
85 //! returns false if TextDisplays are defined (i.e. for Form = 2)
86 Standard_EXPORT Standard_Boolean HasTextDisplay() const;
88 Standard_EXPORT Handle(IGESGraph_TextDisplayTemplate) AttributeTextDisplay (const Standard_Integer AttrNum, const Standard_Integer PointerNum) const;
90 //! Returns the List of Attributes <AttrNum>, as a Transient.
91 //! Its effective Type depends of the Type of Attribute :
92 //! HArray1OfInteger for Integer, Logical(0-1),
93 //! HArray1OfReal for Real, HArray1OfHSaciiString for String,
94 //! HArray1OfIGESEntity for Entity (Pointer)
95 //! See methods AttributeAs... for an accurate access
96 Standard_EXPORT Handle(Standard_Transient) AttributeList (const Standard_Integer AttrNum) const;
98 //! Returns Attribute Value <AttrNum, rank ValueNum> as an Integer
99 //! Error if Indices out of Range, or no Value defined, or not an Integer
100 Standard_EXPORT Standard_Integer AttributeAsInteger (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const;
102 //! Returns Attribute Value <AttrNum, rank ValueNum> as a Real
103 //! Error if Indices out of Range, or no Value defined, or not a Real
104 Standard_EXPORT Standard_Real AttributeAsReal (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const;
106 //! Returns Attribute Value <AttrNum, rank ValueNum> as an Integer
107 Standard_EXPORT Handle(TCollection_HAsciiString) AttributeAsString (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const;
109 //! Returns Attribute Value <AttrNum, rank ValueNum> as an Entity
110 //! Error if Indices out of Range, or no Value defined, or not a Entity
111 Standard_EXPORT Handle(IGESData_IGESEntity) AttributeAsEntity (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const;
113 //! Returns Attribute Value <AttrNum, rank ValueNum> as a Boolean
114 //! Error if Indices out of Range, or no Value defined, or not a Logical
115 Standard_EXPORT Standard_Boolean AttributeAsLogical (const Standard_Integer AttrNum, const Standard_Integer ValueNum) const;
120 DEFINE_STANDARD_RTTIEXT(IGESDefs_AttributeDef,IGESData_IGESEntity)
130 Handle(TCollection_HAsciiString) theName;
131 Standard_Integer theListType;
132 Handle(TColStd_HArray1OfInteger) theAttrTypes;
133 Handle(TColStd_HArray1OfInteger) theAttrValueDataTypes;
134 Handle(TColStd_HArray1OfInteger) theAttrValueCounts;
135 Handle(TColStd_HArray1OfTransient) theAttrValues;
136 Handle(IGESDefs_HArray1OfHArray1OfTextDisplayTemplate) theAttrValuePointers;
147 #endif // _IGESDefs_AttributeDef_HeaderFile