Commit | Line | Data |
---|---|---|

b311480e | 1 | -- Created on: 1992-10-19 |

2 | -- Created by: Laurent BUCHARD | |

3 | -- Copyright (c) 1992-1999 Matra Datavision | |

973c2be1 | 4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |

b311480e | 5 | -- |

973c2be1 | 6 | -- This file is part of Open CASCADE Technology software library. |

b311480e | 7 | -- |

973c2be1 | 8 | -- This library is free software; you can redistribute it and / or modify it |

9 | -- under the terms of the GNU Lesser General Public 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. | |

b311480e | 13 | -- |

973c2be1 | 14 | -- Alternatively, this file may be used under the terms of Open CASCADE |

15 | -- commercial license or contractual agreement. | |

7fd59977 | 16 | |

17 | generic class Polygon2dGen from IntCurve ( | |

18 | TheCurve as any; | |

19 | TheCurveTool as any) -- as CurveTool from IntCurve(TheCurve) | |

20 | ||

21 | ---Purpose: Describe a polyline as a topology to compute the | |

22 | -- interference beetween two polylines 2 dimension. | |

7fd59977 | 23 | |

24 | ---Level: Internal | |

25 | ||

9530af27 | 26 | inherits Polygon2d from Intf |

27 | ||

7fd59977 | 28 | uses Pnt2d from gp, |

29 | Box2d from Bnd, | |

30 | Array1OfPnt2d from TColgp, | |

9530af27 | 31 | Array1OfReal from TColStd, |

32 | Array1OfInteger from TColStd, | |

33 | Domain from IntRes2d | |

7fd59977 | 34 | |

35 | raises OutOfRange from Standard | |

36 | ||

7fd59977 | 37 | is |

38 | ||

39 | Create (Curve : TheCurve; | |

40 | NbPnt : Integer from Standard; | |

41 | Domain : Domain from IntRes2d; | |

42 | Tol : Real from Standard) | |

43 | ||

44 | ---Purpose: Compute a polygon on the domain of the curve. | |

45 | ||

46 | ||

47 | returns Polygon2dGen from IntCurve; | |

48 | ||

49 | Create (Curve : TheCurve; | |

50 | NbPnt : Integer from Standard; | |

51 | Domain : Domain from IntRes2d; | |

52 | Tol : Real from Standard; | |

53 | OtherBox : Box2d from Bnd) | |

54 | ||

55 | ---Purpose: Compute a polygon on the domain of the | |

56 | -- curve. parameters of the begin and | |

57 | -- end of the curve (and its polygon) are | |

58 | -- adjusted to lie in the OtherBox. | |

59 | ||

60 | returns Polygon2dGen from IntCurve; | |

61 | ||

62 | ||

63 | ComputeWithBox(me : in out; | |

64 | Curve : TheCurve; | |

65 | OtherBox : Box2d from Bnd) | |

66 | ||

67 | ---Purpose: The current polygon is modified if most | |

68 | -- of the points of the polygon are are | |

69 | -- outside the box <OtherBox>. In this | |

70 | -- situation, bounds are computed to build | |

71 | -- a polygon inside or near the OtherBox. | |

72 | is static; | |

73 | ||

7fd59977 | 74 | DeflectionOverEstimation(me) |

75 | returns Real from Standard | |

76 | ---C++: inline | |

9530af27 | 77 | is redefined virtual; |

7fd59977 | 78 | |

79 | SetDeflectionOverEstimation(me: in out; x:Real from Standard) | |

80 | ---C++: inline | |

81 | is static; | |

82 | ||

83 | Closed (me : in out; clos : Boolean from Standard) | |

84 | ---C++: inline | |

85 | is static; | |

86 | ||

7fd59977 | 87 | NbSegments (me) |

88 | returns Integer | |

89 | ---C++: inline | |

9530af27 | 90 | is redefined virtual; |

7fd59977 | 91 | ---Purpose: Give the number of Segments in the polyline. |

9530af27 | 92 | |

93 | Segment (me; theIndex : in Integer from Standard; | |

94 | theBegin, theEnd : in out Pnt2d from gp) | |

95 | raises OutOfRange from Standard is redefined virtual; | |

96 | ---Purpose: Returns the points of the segment <Index> in the Polygon. | |

7fd59977 | 97 | |

98 | -- Implementation : | |

99 | ||

100 | ||

101 | InfParameter(me) | |

102 | ||

103 | ---Purpose: Returns the parameter (On the curve) | |

104 | -- of the first point of the Polygon | |

105 | ||

106 | returns Real from Standard | |

107 | ---C++: inline | |

108 | is static; | |

109 | ||

110 | SupParameter(me) | |

111 | ||

112 | ---Purpose: Returns the parameter (On the curve) | |

113 | -- of the last point of the Polygon | |

114 | ||

115 | returns Real from Standard | |

116 | ---C++: inline | |

117 | is static; | |

118 | ||

119 | ||

120 | AutoIntersectionIsPossible(me) | |

121 | returns Boolean from Standard | |

122 | is static; | |

123 | ||

124 | ApproxParamOnCurve(me; | |

125 | Index : in Integer from Standard; | |

126 | ParamOnLine : in Real from Standard) | |

127 | ||

128 | returns Real from Standard | |

129 | ||

130 | raises OutOfRange from Standard | |

131 | is static; | |

132 | ||

133 | ---Purpose: Give an approximation of the parameter on the curve | |

134 | -- according to the discretization of the Curve. | |

135 | ||

136 | ||

137 | CalculRegion (me; | |

138 | x : Real from Standard ; | |

139 | y : Real from Standard ; | |

140 | x1 : Real from Standard ; | |

141 | x2 : Real from Standard ; | |

142 | y1 : Real from Standard ; | |

143 | y2 : Real from Standard ) | |

144 | returns Integer from Standard ; | |

145 | ---C++: inline | |

146 | ||

147 | Dump (me) | |

148 | is static; | |

149 | ||

150 | ||

9530af27 | 151 | fields TheDeflection : Real from Standard; |

7fd59977 | 152 | NbPntIn : Integer from Standard; |

9530af27 | 153 | TheMaxNbPoints: Integer from Standard; |

7fd59977 | 154 | ThePnts : Array1OfPnt2d from TColgp; |

9530af27 | 155 | TheParams : Array1OfReal from TColStd; |

156 | TheIndex : Array1OfInteger from TColStd; | |

157 | ClosedPolygon : Boolean from Standard; | |

158 | ||

7fd59977 | 159 | --- To compute an approximate parameter on the Curve |

160 | -- | |

161 | Binf : Real from Standard; | |

162 | Bsup : Real from Standard; | |

7fd59977 | 163 | |

164 | end Polygon2dGen; |