0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / IGESDefs / IGESDefs_AssociativityDef.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _IGESDefs_AssociativityDef_HeaderFile
18 #define _IGESDefs_AssociativityDef_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <TColStd_HArray1OfInteger.hxx>
24 #include <IGESData_IGESEntity.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Boolean.hxx>
27 class IGESBasic_HArray1OfHArray1OfInteger;
28 class Standard_DimensionMismatch;
29 class Standard_OutOfRange;
30
31
32 class IGESDefs_AssociativityDef;
33 DEFINE_STANDARD_HANDLE(IGESDefs_AssociativityDef, IGESData_IGESEntity)
34
35 //! defines IGES Associativity Definition Entity, Type <302>
36 //! Form <5001 - 9999> in package IGESDefs.
37 //! This class permits the preprocessor to define an
38 //! associativity schema. i.e., by using it preprocessor
39 //! defines the type of relationship.
40 class IGESDefs_AssociativityDef : public IGESData_IGESEntity
41 {
42
43 public:
44
45   
46   Standard_EXPORT IGESDefs_AssociativityDef();
47   
48   //! This method is used to set the fields of the class
49   //! AssociativityDef
50   //! - requirements : Back Pointers requirements
51   //! - orders       : Class Orders
52   //! - numItems     : Number of Items per Class
53   //! - items        : Items in each class
54   //! raises exception if lengths of the arrays are not the same.
55   Standard_EXPORT void Init (const Handle(TColStd_HArray1OfInteger)& requirements, const Handle(TColStd_HArray1OfInteger)& orders, const Handle(TColStd_HArray1OfInteger)& numItems, const Handle(IGESBasic_HArray1OfHArray1OfInteger)& items);
56   
57   Standard_EXPORT void SetFormNumber (const Standard_Integer form);
58   
59   //! returns the Number of class definitions
60   Standard_EXPORT Standard_Integer NbClassDefs() const;
61   
62   //! returns 1 if the theBackPointerReqs(ClassNum) = 1
63   //! returns 0 if the theBackPointerReqs(ClassNum) = 2
64   //! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
65   Standard_EXPORT Standard_Boolean IsBackPointerReq (const Standard_Integer ClassNum) const;
66   
67   //! returns 1 or 2
68   //! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
69   Standard_EXPORT Standard_Integer BackPointerReq (const Standard_Integer ClassNum) const;
70   
71   //! returns 1 if theClassOrders(ClassNum) = 1 (ordered class)
72   //! returns 0 if theClassOrders(ClassNum) = 2 (unordered class)
73   //! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
74   Standard_EXPORT Standard_Boolean IsOrdered (const Standard_Integer ClassNum) const;
75   
76   //! returns 1 or 2
77   //! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
78   Standard_EXPORT Standard_Integer ClassOrder (const Standard_Integer ClassNum) const;
79   
80   //! returns no. of items per class entry
81   //! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
82   Standard_EXPORT Standard_Integer NbItemsPerClass (const Standard_Integer ClassNum) const;
83   
84   //! returns ItemNum'th Item of ClassNum'th Class
85   //! raises exception if
86   //! ClassNum <= 0 or ClassNum > NbClassDefs()
87   //! ItemNum <= 0 or ItemNum > NbItemsPerClass(ClassNum)
88   Standard_EXPORT Standard_Integer Item (const Standard_Integer ClassNum, const Standard_Integer ItemNum) const;
89
90
91
92
93   DEFINE_STANDARD_RTTIEXT(IGESDefs_AssociativityDef,IGESData_IGESEntity)
94
95 protected:
96
97
98
99
100 private:
101
102
103   Handle(TColStd_HArray1OfInteger) theBackPointerReqs;
104   Handle(TColStd_HArray1OfInteger) theClassOrders;
105   Handle(TColStd_HArray1OfInteger) theNbItemsPerClass;
106   Handle(IGESBasic_HArray1OfHArray1OfInteger) theItems;
107
108
109 };
110
111
112
113
114
115
116
117 #endif // _IGESDefs_AssociativityDef_HeaderFile