1 // Created on: 1992-06-04
2 // Created by: Jacques GOUSSARD
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 _Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter_HeaderFile
18 #define _Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Real.hxx>
25 #include <Standard_Integer.hxx>
26 #include <TColgp_Array1OfPnt2d.hxx>
27 #include <TColStd_Array1OfReal.hxx>
28 #include <TColStd_Array1OfInteger.hxx>
29 #include <Standard_Boolean.hxx>
30 #include <Intf_Polygon2d.hxx>
31 class Standard_OutOfRange;
32 class Adaptor2d_Curve2d;
33 class Geom2dInt_Geom2dCurveTool;
34 class IntRes2d_Domain;
40 class Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter : public Intf_Polygon2d
47 //! Compute a polygon on the domain of the curve.
48 Standard_EXPORT Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter(const Adaptor2d_Curve2d& Curve, const Standard_Integer NbPnt, const IntRes2d_Domain& Domain, const Standard_Real Tol);
50 //! The current polygon is modified if most
51 //! of the points of the polygon are are
52 //! outside the box <OtherBox>. In this
53 //! situation, bounds are computed to build
54 //! a polygon inside or near the OtherBox.
55 Standard_EXPORT void ComputeWithBox (const Adaptor2d_Curve2d& Curve, const Bnd_Box2d& OtherBox);
57 virtual Standard_Real DeflectionOverEstimation() const Standard_OVERRIDE;
59 void SetDeflectionOverEstimation (const Standard_Real x);
61 void Closed (const Standard_Boolean clos);
63 //! Returns True if the polyline is closed.
64 virtual Standard_Boolean Closed () const Standard_OVERRIDE { return ClosedPolygon; }
66 //! Give the number of Segments in the polyline.
67 virtual Standard_Integer NbSegments() const Standard_OVERRIDE;
69 //! Returns the points of the segment <Index> in the Polygon.
70 Standard_EXPORT virtual void Segment (const Standard_Integer theIndex, gp_Pnt2d& theBegin, gp_Pnt2d& theEnd) const Standard_OVERRIDE;
72 //! Returns the parameter (On the curve)
73 //! of the first point of the Polygon
74 Standard_Real InfParameter() const;
76 //! Returns the parameter (On the curve)
77 //! of the last point of the Polygon
78 Standard_Real SupParameter() const;
80 Standard_EXPORT Standard_Boolean AutoIntersectionIsPossible() const;
82 //! Give an approximation of the parameter on the curve
83 //! according to the discretization of the Curve.
84 Standard_EXPORT Standard_Real ApproxParamOnCurve (const Standard_Integer Index, const Standard_Real ParamOnLine) const;
86 Standard_Integer CalculRegion (const Standard_Real x, const Standard_Real y, const Standard_Real x1, const Standard_Real x2, const Standard_Real y1, const Standard_Real y2) const;
88 Standard_EXPORT void Dump() const;
103 Standard_Real TheDeflection;
104 Standard_Integer NbPntIn;
105 Standard_Integer TheMaxNbPoints;
106 TColgp_Array1OfPnt2d ThePnts;
107 TColStd_Array1OfReal TheParams;
108 TColStd_Array1OfInteger TheIndex;
109 Standard_Boolean ClosedPolygon;
116 #define TheCurve Adaptor2d_Curve2d
117 #define TheCurve_hxx <Adaptor2d_Curve2d.hxx>
118 #define TheCurveTool Geom2dInt_Geom2dCurveTool
119 #define TheCurveTool_hxx <Geom2dInt_Geom2dCurveTool.hxx>
120 #define IntCurve_Polygon2dGen Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter
121 #define IntCurve_Polygon2dGen_hxx <Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx>
123 #include <IntCurve_Polygon2dGen.lxx>
128 #undef TheCurveTool_hxx
129 #undef IntCurve_Polygon2dGen
130 #undef IntCurve_Polygon2dGen_hxx
135 #endif // _Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter_HeaderFile