0028248: [Regression] HLR Algo result is retrieved from the last added shape only
[occt.git] / src / HLRBRep / HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx
CommitLineData
42cf5bc1 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
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 _HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter_HeaderFile
18#define _HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter_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#include <Standard_Address.hxx>
32class Standard_OutOfRange;
33class HLRBRep_CurveTool;
34class IntRes2d_Domain;
35class Bnd_Box2d;
36class gp_Pnt2d;
37
38
39
40class HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter : public Intf_Polygon2d
41{
42public:
43
44 DEFINE_STANDARD_ALLOC
45
46
36b9ff75 47 //! Compute a polygon on the domain of the curve.
42cf5bc1 48 Standard_EXPORT HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter(const Standard_Address& Curve, const Standard_Integer NbPnt, const IntRes2d_Domain& Domain, const Standard_Real Tol);
49
36b9ff75 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.
42cf5bc1 55 Standard_EXPORT void ComputeWithBox (const Standard_Address& 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
201c2208 63 //! Returns True if the polyline is closed.
64 virtual Standard_Boolean Closed () const Standard_OVERRIDE { return ClosedPolygon; }
65
36b9ff75 66 //! Give the number of Segments in the polyline.
42cf5bc1 67 virtual Standard_Integer NbSegments() const Standard_OVERRIDE;
68
36b9ff75 69 //! Returns the points of the segment <Index> in the Polygon.
42cf5bc1 70 Standard_EXPORT virtual void Segment (const Standard_Integer theIndex, gp_Pnt2d& theBegin, gp_Pnt2d& theEnd) const Standard_OVERRIDE;
71
36b9ff75 72 //! Returns the parameter (On the curve)
73 //! of the first point of the Polygon
42cf5bc1 74 Standard_Real InfParameter() const;
75
36b9ff75 76 //! Returns the parameter (On the curve)
77 //! of the last point of the Polygon
42cf5bc1 78 Standard_Real SupParameter() const;
79
80 Standard_EXPORT Standard_Boolean AutoIntersectionIsPossible() const;
81
36b9ff75 82 //! Give an approximation of the parameter on the curve
83 //! according to the discretization of the Curve.
42cf5bc1 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
93protected:
94
95
96
97
98
99private:
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 Standard_Address
117#define TheCurve_hxx <Standard_Address.hxx>
118#define TheCurveTool HLRBRep_CurveTool
119#define TheCurveTool_hxx <HLRBRep_CurveTool.hxx>
120#define IntCurve_Polygon2dGen HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter
121#define IntCurve_Polygon2dGen_hxx <HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.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 // _HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter_HeaderFile