Warnings on vc14 were eliminated
[occt.git] / src / Geom2dInt / Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx
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
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 _Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter_HeaderFile
18 #define _Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
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;
35 class Bnd_Box2d;
36 class gp_Pnt2d;
37
38
39
40 class Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter  : public Intf_Polygon2d
41 {
42 public:
43
44   DEFINE_STANDARD_ALLOC
45
46   
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);
49   
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);
56   
57     virtual Standard_Real DeflectionOverEstimation() const Standard_OVERRIDE;
58   
59     void SetDeflectionOverEstimation (const Standard_Real x);
60   
61     void Closed (const Standard_Boolean clos);
62   
63   //! Returns True if the polyline is closed.
64     virtual Standard_Boolean Closed () const Standard_OVERRIDE { return ClosedPolygon; }
65   
66   //! Give the number of Segments in the polyline.
67     virtual Standard_Integer NbSegments() const Standard_OVERRIDE;
68   
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;
71   
72   //! Returns the parameter (On the curve)
73   //! of the first point of the Polygon
74     Standard_Real InfParameter() const;
75   
76   //! Returns the parameter (On the curve)
77   //! of the last point of the Polygon
78     Standard_Real SupParameter() const;
79   
80   Standard_EXPORT Standard_Boolean AutoIntersectionIsPossible() const;
81   
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;
85   
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;
87   
88   Standard_EXPORT void Dump() const;
89
90
91
92
93 protected:
94
95
96
97
98
99 private:
100
101
102
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;
110   Standard_Real Binf;
111   Standard_Real Bsup;
112
113
114 };
115
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>
122
123 #include <IntCurve_Polygon2dGen.lxx>
124
125 #undef TheCurve
126 #undef TheCurve_hxx
127 #undef TheCurveTool
128 #undef TheCurveTool_hxx
129 #undef IntCurve_Polygon2dGen
130 #undef IntCurve_Polygon2dGen_hxx
131
132
133
134
135 #endif // _Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter_HeaderFile