1 // Created on: 1993-01-09
2 // Created by: CKY / Contract Toubro-Larsen ( SIVA )
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 _IGESSolid_Loop_HeaderFile
18 #define _IGESSolid_Loop_HeaderFile
19 
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22 
23 #include <TColStd_HArray1OfInteger.hxx>
24 #include <IGESData_HArray1OfIGESEntity.hxx>
25 #include <IGESData_IGESEntity.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <Standard_Integer.hxx>
28 class IGESBasic_HArray1OfHArray1OfInteger;
29 class IGESBasic_HArray1OfHArray1OfIGESEntity;
30 
31 
32 class IGESSolid_Loop;
33 DEFINE_STANDARD_HANDLE(IGESSolid_Loop, IGESData_IGESEntity)
34 
35 //! defines Loop, Type <508> Form Number <1>
36 //! in package IGESSolid
37 //! A Loop entity specifies a bound of a face. It represents
38 //! a connected collection of face boundaries, seams, and
39 //! poles of a single face.
40 //!
41 //! From IGES-5.3, a Loop can be free with Form Number 0,
42 //! else it is a bound of a face (it is the default)
43 class IGESSolid_Loop : public IGESData_IGESEntity
44 {
45 
46 public:
47 
48 
49   Standard_EXPORT IGESSolid_Loop();
50 
51   //! This method is used to set the fields of the class Loop
52   //! - types              : 0 = Edge; 1 = Vertex
53   //! - edges              : Pointer to the EdgeList or VertexList
54   //! - index              : Index of the edge into the EdgeList
55   //! VertexList entity
56   //! - orient             : Orientation flag of the edge
57   //! - nbParameterCurves  : the number of parameter space curves
58   //! for each edge
59   //! - isoparametricFlags : the isoparametric flag of the
60   //! parameter space curve
61   //! - curves             : the parameter space curves
62   //! raises exception if length of types, edges, index, orient and
63   //! nbParameterCurves do not match or the length of
64   //! isoparametricFlags and curves do not match
65   Standard_EXPORT void Init (const Handle(TColStd_HArray1OfInteger)& types, const Handle(IGESData_HArray1OfIGESEntity)& edges, const Handle(TColStd_HArray1OfInteger)& index, const Handle(TColStd_HArray1OfInteger)& orient, const Handle(TColStd_HArray1OfInteger)& nbParameterCurves, const Handle(IGESBasic_HArray1OfHArray1OfInteger)& isoparametricFlags, const Handle(IGESBasic_HArray1OfHArray1OfIGESEntity)& curves);
66 
67   //! Tells if a Loop is a Bound (FN 1) else it is free (FN 0)
68   Standard_EXPORT Standard_Boolean IsBound() const;
69 
70   //! Sets or Unset the Bound Status (from Form Number)
71   //! Default is True
72   Standard_EXPORT void SetBound (const Standard_Boolean bound);
73 
74   //! returns the number of edge tuples
75   Standard_EXPORT Standard_Integer NbEdges() const;
76 
77   //! returns the type of Index'th edge (0 = Edge, 1 = Vertex)
78   //! raises exception if Index <= 0 or Index > NbEdges()
79   Standard_EXPORT Standard_Integer EdgeType (const Standard_Integer Index) const;
80 
81   //! return the EdgeList or VertexList corresponding to the Index
82   //! raises exception if Index <= 0 or Index > NbEdges()
83   Standard_EXPORT Handle(IGESData_IGESEntity) Edge (const Standard_Integer Index) const;
84 
85   //! returns the orientation flag corresponding to Index'th edge
86   //! raises exception if Index <= 0 or Index > NbEdges()
87   Standard_EXPORT Standard_Boolean Orientation (const Standard_Integer Index) const;
88 
89   //! return the number of parameter space curves associated with
90   //! Index'th Edge
91   //! raises exception if Index <= 0 or Index > NbEdges()
92   Standard_EXPORT Standard_Integer NbParameterCurves (const Standard_Integer Index) const;
93 
94   Standard_EXPORT Standard_Boolean IsIsoparametric (const Standard_Integer EdgeIndex, const Standard_Integer CurveIndex) const;
95 
96   //! returns the CurveIndex'th parameter space curve associated with
97   //! EdgeIndex'th edge
98   //! raises exception if EdgeIndex <= 0 or EdgeIndex > NbEdges() or
99   //! if CurveIndex <= 0 or CurveIndex > NbParameterCurves(EdgeIndex)
100   Standard_EXPORT Handle(IGESData_IGESEntity) ParametricCurve (const Standard_Integer EdgeIndex, const Standard_Integer CurveIndex) const;
101 
102   //! raises exception If num <= 0 or num > NbEdges()
103   Standard_EXPORT Standard_Integer ListIndex (const Standard_Integer num) const;
104 
105 
106 
107 
108   DEFINE_STANDARD_RTTIEXT(IGESSolid_Loop,IGESData_IGESEntity)
109 
110 protected:
111 
112 
113 
114 
115 private:
116 
117 
118   Handle(TColStd_HArray1OfInteger) theTypes;
119   Handle(IGESData_HArray1OfIGESEntity) theEdges;
120   Handle(TColStd_HArray1OfInteger) theIndex;
121   Handle(TColStd_HArray1OfInteger) theOrientationFlags;
122   Handle(TColStd_HArray1OfInteger) theNbParameterCurves;
123   Handle(IGESBasic_HArray1OfHArray1OfInteger) theIsoparametricFlags;
124   Handle(IGESBasic_HArray1OfHArray1OfIGESEntity) theCurves;
125 
126 
127 };
128 
129 
130 
131 
132 
133 
134 
135 #endif // _IGESSolid_Loop_HeaderFile
136