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