1 // Created on: 1992-10-14
2 // Created by: Christophe MARION
3 // Copyright (c) 1992-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 _HLRBRep_ThePolygonOfInterCSurf_HeaderFile
18 #define _HLRBRep_ThePolygonOfInterCSurf_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Bnd_Box.hxx>
25 #include <Standard_Real.hxx>
26 #include <Standard_Integer.hxx>
27 #include <TColgp_Array1OfPnt.hxx>
28 #include <Standard_Boolean.hxx>
29 #include <TColStd_HArray1OfReal.hxx>
30 #include <TColStd_Array1OfReal.hxx>
31 class Standard_OutOfRange;
33 class HLRBRep_LineTool;
39 class HLRBRep_ThePolygonOfInterCSurf
46 Standard_EXPORT HLRBRep_ThePolygonOfInterCSurf(const gp_Lin& Curve, const Standard_Integer NbPnt);
48 Standard_EXPORT HLRBRep_ThePolygonOfInterCSurf(const gp_Lin& Curve, const Standard_Real U1, const Standard_Real U2, const Standard_Integer NbPnt);
50 Standard_EXPORT HLRBRep_ThePolygonOfInterCSurf(const gp_Lin& Curve, const TColStd_Array1OfReal& Upars);
52 //! Give the bounding box of the polygon.
53 const Bnd_Box& Bounding() const { return TheBnd; }
55 Standard_Real DeflectionOverEstimation() const { return TheDeflection; }
57 void SetDeflectionOverEstimation (const Standard_Real x)
60 TheBnd.Enlarge (TheDeflection);
63 void Closed (const Standard_Boolean flag) { ClosedPolygon = flag; }
65 Standard_Boolean Closed() const { return Standard_False; } // -- Voir si le cas Closed est traitable
67 //! Give the number of Segments in the polyline.
68 Standard_Integer NbSegments() const { return NbPntIn - 1; }
70 //! Give the point of range Index in the Polygon.
71 const gp_Pnt& BeginOfSeg (const Standard_Integer theIndex) const { return ThePnts (theIndex); }
73 //! Give the point of range Index in the Polygon.
74 const gp_Pnt& EndOfSeg (const Standard_Integer theIndex) const { return ThePnts (theIndex + 1); }
76 //! Returns the parameter (On the curve)
77 //! of the first point of the Polygon
78 Standard_Real InfParameter() const { return Binf; }
80 //! Returns the parameter (On the curve)
81 //! of the last point of the Polygon
82 Standard_Real SupParameter() const { return Bsup; }
84 //! Give an approximation of the parameter on the curve
85 //! according to the discretization of the Curve.
86 Standard_EXPORT Standard_Real ApproxParamOnCurve (const Standard_Integer Index, const Standard_Real ParamOnLine) const;
88 Standard_EXPORT void Dump() const;
92 Standard_EXPORT void Init (const gp_Lin& Curve);
94 Standard_EXPORT void Init (const gp_Lin& Curve, const TColStd_Array1OfReal& Upars);
99 Standard_Real TheDeflection;
100 Standard_Integer NbPntIn;
101 TColgp_Array1OfPnt ThePnts;
102 Standard_Boolean ClosedPolygon;
105 Handle(TColStd_HArray1OfReal) myParams;
109 #endif // _HLRBRep_ThePolygonOfInterCSurf_HeaderFile