7fd59977 |
1 | // File: IntCurve_Polygon2dGen.lxx |
2 | // Created: Thu 3 Jun 1993 |
3 | // Author: Laurent BUCHARD |
7fd59977 |
4 | |
5 | #include <Standard_OutOfRange.hxx> |
6 | |
7fd59977 |
7 | //====================================================================== |
8 | inline Standard_Real IntCurve_Polygon2dGen::DeflectionOverEstimation() const { |
9 | return(TheDeflection); |
10 | }//====================================================================== |
11 | inline void IntCurve_Polygon2dGen::SetDeflectionOverEstimation |
12 | (const Standard_Real x) { |
13 | TheDeflection = x; |
9530af27 |
14 | myBox.Enlarge(TheDeflection); |
7fd59977 |
15 | } |
16 | //====================================================================== |
17 | inline void IntCurve_Polygon2dGen::Closed(const Standard_Boolean flag) { |
18 | ClosedPolygon = flag; |
19 | } |
20 | //====================================================================== |
7fd59977 |
21 | inline Standard_Integer IntCurve_Polygon2dGen::NbSegments(void) const { |
22 | return((ClosedPolygon)? NbPntIn : NbPntIn-1); |
23 | } |
24 | //====================================================================== |
7fd59977 |
25 | inline Standard_Real IntCurve_Polygon2dGen::InfParameter() const { |
26 | return(TheParams.Value(TheIndex(1))); |
27 | } |
28 | //====================================================================== |
29 | inline Standard_Real IntCurve_Polygon2dGen::SupParameter() const { |
30 | return(TheParams.Value(TheIndex(NbPntIn))); |
31 | } |
32 | //====================================================================== |
33 | |
34 | //====================================================================== |
35 | inline Standard_Integer IntCurve_Polygon2dGen::CalculRegion(const Standard_Real x, |
36 | const Standard_Real y, |
37 | const Standard_Real x1, |
38 | const Standard_Real x2, |
39 | const Standard_Real y1, |
40 | const Standard_Real y2) const { |
41 | Standard_Integer r; |
42 | if(x<x1) { r=1; } else { if(x>x2) { r=2; } else { r=0; } } |
43 | if(y<y1) { r|=4; } else { if(y>y2) { r|=8; } } |
44 | return(r); |
45 | } |