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_AssociativityDef_HeaderFile
18 #define _IGESDefs_AssociativityDef_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TColStd_HArray1OfInteger.hxx>
24 #include <IGESData_IGESEntity.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Boolean.hxx>
27 class IGESBasic_HArray1OfHArray1OfInteger;
30 class IGESDefs_AssociativityDef;
31 DEFINE_STANDARD_HANDLE(IGESDefs_AssociativityDef, IGESData_IGESEntity)
33 //! defines IGES Associativity Definition Entity, Type <302>
34 //! Form <5001 - 9999> in package IGESDefs.
35 //! This class permits the preprocessor to define an
36 //! associativity schema. i.e., by using it preprocessor
37 //! defines the type of relationship.
38 class IGESDefs_AssociativityDef : public IGESData_IGESEntity
44 Standard_EXPORT IGESDefs_AssociativityDef();
46 //! This method is used to set the fields of the class
48 //! - requirements : Back Pointers requirements
49 //! - orders : Class Orders
50 //! - numItems : Number of Items per Class
51 //! - items : Items in each class
52 //! raises exception if lengths of the arrays are not the same.
53 Standard_EXPORT void Init (const Handle(TColStd_HArray1OfInteger)& requirements, const Handle(TColStd_HArray1OfInteger)& orders, const Handle(TColStd_HArray1OfInteger)& numItems, const Handle(IGESBasic_HArray1OfHArray1OfInteger)& items);
55 Standard_EXPORT void SetFormNumber (const Standard_Integer form);
57 //! returns the Number of class definitions
58 Standard_EXPORT Standard_Integer NbClassDefs() const;
60 //! returns 1 if the theBackPointerReqs(ClassNum) = 1
61 //! returns 0 if the theBackPointerReqs(ClassNum) = 2
62 //! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
63 Standard_EXPORT Standard_Boolean IsBackPointerReq (const Standard_Integer ClassNum) const;
66 //! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
67 Standard_EXPORT Standard_Integer BackPointerReq (const Standard_Integer ClassNum) const;
69 //! returns 1 if theClassOrders(ClassNum) = 1 (ordered class)
70 //! returns 0 if theClassOrders(ClassNum) = 2 (unordered class)
71 //! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
72 Standard_EXPORT Standard_Boolean IsOrdered (const Standard_Integer ClassNum) const;
75 //! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
76 Standard_EXPORT Standard_Integer ClassOrder (const Standard_Integer ClassNum) const;
78 //! returns no. of items per class entry
79 //! raises exception if ClassNum <= 0 or ClassNum > NbClassDefs()
80 Standard_EXPORT Standard_Integer NbItemsPerClass (const Standard_Integer ClassNum) const;
82 //! returns ItemNum'th Item of ClassNum'th Class
83 //! raises exception if
84 //! ClassNum <= 0 or ClassNum > NbClassDefs()
85 //! ItemNum <= 0 or ItemNum > NbItemsPerClass(ClassNum)
86 Standard_EXPORT Standard_Integer Item (const Standard_Integer ClassNum, const Standard_Integer ItemNum) const;
91 DEFINE_STANDARD_RTTIEXT(IGESDefs_AssociativityDef,IGESData_IGESEntity)
101 Handle(TColStd_HArray1OfInteger) theBackPointerReqs;
102 Handle(TColStd_HArray1OfInteger) theClassOrders;
103 Handle(TColStd_HArray1OfInteger) theNbItemsPerClass;
104 Handle(IGESBasic_HArray1OfHArray1OfInteger) theItems;
115 #endif // _IGESDefs_AssociativityDef_HeaderFile