1 // Created on: 1993-01-09
2 // Created by: CKY / Contract Toubro-Larsen (Anand NATRAJAN)
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_GenericData_HeaderFile
18 #define _IGESDefs_GenericData_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_Real.hxx>
28 #include <Standard_Boolean.hxx>
29 class TCollection_HAsciiString;
30 class Standard_DimensionMismatch;
31 class Standard_OutOfRange;
32 class Standard_NullObject;
33 class Standard_Transient;
34 class IGESData_IGESEntity;
37 class IGESDefs_GenericData;
38 DEFINE_STANDARD_HANDLE(IGESDefs_GenericData, IGESData_IGESEntity)
40 //! defines IGES Generic Data, Type <406> Form <27>
41 //! in package IGESDefs
42 //! Used to communicate information defined by the system
43 //! operator while creating the model. The information is
44 //! system specific and does not map into one of the
45 //! predefined properties or associativities. Properties
46 //! and property values can be defined by multiple
47 //! instances of this property.
48 class IGESDefs_GenericData : public IGESData_IGESEntity
54 Standard_EXPORT IGESDefs_GenericData();
56 //! This method is used to set the fields of the class
58 //! - nbPropVal : Number of property values
59 //! - aName : Property Name
60 //! - allTypes : Property Types
61 //! - allValues : Property Values
62 Standard_EXPORT void Init (const Standard_Integer nbPropVal, const Handle(TCollection_HAsciiString)& aName, const Handle(TColStd_HArray1OfInteger)& allTypes, const Handle(TColStd_HArray1OfTransient)& allValues);
64 //! returns the number of property values
65 Standard_EXPORT Standard_Integer NbPropertyValues() const;
67 //! returns property name
68 Standard_EXPORT Handle(TCollection_HAsciiString) Name() const;
70 //! returns the number of TYPE/VALUE pairs
71 Standard_EXPORT Standard_Integer NbTypeValuePairs() const;
73 //! returns the Index'th property value data type
74 //! raises exception if Index <= 0 or Index > NbTypeValuePairs()
75 Standard_EXPORT Standard_Integer Type (const Standard_Integer Index) const;
77 //! HArray1OfInteger (length 1), HArray1OfReal (length 1) for
78 //! Integer, Real, Boolean (= Integer 0/1),
79 //! HAsciiString for String (the value itself),
80 //! IGESEntity for Entity (the value itself)
81 Standard_EXPORT Handle(Standard_Transient) Value (const Standard_Integer Index) const;
83 //! Returns Attribute Value <AttrNum, rank ValueNum> as an Integer
84 //! Error if Index out of Range, or not an Integer
85 Standard_EXPORT Standard_Integer ValueAsInteger (const Standard_Integer ValueNum) const;
87 //! Returns Attribute Value <AttrNum, rank ValueNum> as a Real
88 //! Error if Index out of Range, or not a Real
89 Standard_EXPORT Standard_Real ValueAsReal (const Standard_Integer ValueNum) const;
91 //! Returns Attribute Value <AttrNum, rank ValueNum> as an Integer
92 Standard_EXPORT Handle(TCollection_HAsciiString) ValueAsString (const Standard_Integer ValueNum) const;
94 //! Returns Attribute Value <AttrNum, rank ValueNum> as an Entity
95 //! Error if Index out of Range, or not a Entity
96 Standard_EXPORT Handle(IGESData_IGESEntity) ValueAsEntity (const Standard_Integer ValueNum) const;
98 //! Returns Attribute Value <AttrNum, rank ValueNum> as a Boolean
99 //! Error if Index out of Range, or not a Logical
100 Standard_EXPORT Standard_Boolean ValueAsLogical (const Standard_Integer ValueNum) const;
105 DEFINE_STANDARD_RTTIEXT(IGESDefs_GenericData,IGESData_IGESEntity)
115 Standard_Integer theNbPropertyValues;
116 Handle(TCollection_HAsciiString) theName;
117 Handle(TColStd_HArray1OfInteger) theTypes;
118 Handle(TColStd_HArray1OfTransient) theValues;
129 #endif // _IGESDefs_GenericData_HeaderFile