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

b311480e | 1 | -- Created on: 1991-03-29 |

2 | -- Created by: Remi GILET | |

3 | -- Copyright (c) 1991-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 | -- |

d5f74e42 | 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 | |

973c2be1 | 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 Circ2d2TanRad from GccGeo ( | |

18 | TheCurve as any; | |

19 | TheTool as any; | |

20 | TheQCurve as any; -- as QualifiedCurve from GccEnt | |

21 | -- (TheCurve) | |

22 | TheParGenCurve as any; -- as ParGenCurve from GccGeo | |

23 | -- (TheCurve) | |

24 | TheHParGenCurve as Transient; | |

25 | TheCurvePGTool as any; -- as CurvePGTool from GccGeo | |

26 | -- (Thecurve, | |

27 | -- TheTool, | |

28 | -- TheParGenCurve) | |

29 | TheIntConicCurve as any; -- as IntConicCurveOfGOffsetInter | |

30 | TheIntCurveCurve as any) -- as GOffsetInter from Geom2dInt | |

31 | -- (TheParGenCurve, | |

32 | -- TheCurvePGTool) | |

33 | ||

34 | ---Purpose: This class implements the algorithms used to | |

35 | -- create 2d circles tangent to one curve and a | |

36 | -- point/line/circle/curv and with a given radius. | |

37 | -- For each construction methods arguments are: | |

38 | -- - Two Qualified elements for tangency constrains. | |

39 | -- (for example EnclosedCirc if we want the | |

40 | -- solution inside the argument EnclosedCirc). | |

41 | -- - Two Reals. One (Radius) for the radius and the | |

42 | -- other (Tolerance) for the tolerance. | |

43 | -- Tolerance is only used for the limit cases. | |

44 | -- For example : | |

45 | -- We want to create a circle inside a circle C1 and | |

46 | -- inside a curve Cu2 with a radius Radius and a | |

47 | -- tolerance Tolerance. | |

48 | -- If we did not used Tolerance it is impossible to | |

49 | -- find a solution in the following case : Cu2 is | |

50 | -- inside C1 and there is no intersection point | |

51 | -- between the two elements. | |

52 | -- With Tolerance we will get a solution if the | |

53 | -- lowest distance between C1 and Cu2 is lower than or | |

54 | -- equal Tolerance. | |

55 | ||

56 | -- inherits Entity from Standard | |

57 | ||

58 | uses Pnt2d from gp, | |

59 | Circ2d from gp, | |

60 | Array1OfCirc2d from TColgp, | |

61 | Array1OfPnt2d from TColgp, | |

62 | QualifiedCirc from GccEnt, | |

63 | QualifiedLin from GccEnt, | |

64 | Array1OfReal from TColStd, | |

65 | Array1OfInteger from TColStd, | |

66 | Position from GccEnt, | |

67 | Array1OfPosition from GccEnt | |

68 | ||

69 | raises OutOfRange from Standard, | |

70 | BadQualifier from GccEnt, | |

71 | NotDone from StdFail, | |

72 | NegativeValue from Standard | |

73 | ||

74 | is | |

75 | ||

76 | Create(Qualified1 : QualifiedCirc from GccEnt ; | |

77 | Qualified2 : TheQCurve ; | |

78 | Radius : Real from Standard; | |

79 | Tolerance : Real from Standard) returns Circ2d2TanRad | |

80 | ---Purpose: This method implements the algorithms used to | |

81 | -- create 2d circles TANgent to a 2d circle and a curve | |

82 | -- with a radius of Radius. | |

83 | raises NegativeValue, BadQualifier; | |

84 | ---Purpose: It raises NegativeValue if Radius is lower than zero. | |

85 | ||

86 | Create(Qualified1 : QualifiedLin from GccEnt ; | |

87 | Qualified2 : TheQCurve ; | |

88 | Radius : Real from Standard; | |

89 | Tolerance : Real from Standard) returns Circ2d2TanRad | |

90 | ---Purpose: This method implements the algorithms used to | |

91 | -- create 2d circles TANgent to a 2d line and a curve | |

92 | -- with a radius of Radius. | |

93 | raises NegativeValue, BadQualifier; | |

94 | ---Purpose: It raises NegativeValue if Radius is lower than zero. | |

95 | ||

96 | Create(Qualified1 : TheQCurve ; | |

97 | Qualified2 : TheQCurve ; | |

98 | Radius : Real from Standard; | |

99 | Tolerance : Real from Standard) returns Circ2d2TanRad | |

100 | ---Purpose: This method implements the algorithms used to | |

101 | -- create 2d circles TANgent to two curves with | |

102 | -- a radius of Radius. | |

103 | raises NegativeValue, BadQualifier; | |

104 | ---Purpose: It raises NegativeValue if Radius is lower than zero. | |

105 | ||

106 | Create(Qualified1 : TheQCurve ; | |

107 | Point2 : Pnt2d from gp ; | |

108 | Radius : Real from Standard; | |

109 | Tolerance : Real from Standard) returns Circ2d2TanRad | |

110 | ---Purpose: This method implements the algorithms used to | |

111 | -- create 2d circles TANgent to a curve and a point | |

112 | -- with a radius of Radius. | |

113 | raises NegativeValue, BadQualifier; | |

114 | ---Purpose: It raises NegativeValue if Radius is lower than zero. | |

115 | ||

116 | -- -- .................................................................... | |

117 | ||

118 | IsDone(me) returns Boolean from Standard | |

119 | is static; | |

120 | ---Purpose: This method returns True if the algorithm succeeded. | |

121 | ||

122 | NbSolutions(me) returns Integer from Standard | |

123 | ---Purpose: This method returns the number of solutions. | |

124 | raises NotDone | |

125 | is static; | |

126 | ---Purpose: It raises NotDone if the algorithm failed. | |

127 | ||

128 | ThisSolution(me ; | |

129 | Index : Integer from Standard) returns Circ2d from gp | |

130 | ---Purpose: Returns the solution number Index. | |

131 | -- Be careful: the Index is only a way to get all the | |

132 | -- solutions, but is not associated to those outside the context | |

133 | -- of the algorithm-object. | |

134 | raises OutOfRange, NotDone | |

135 | is static; | |

136 | ---Purpose: It raises OutOfRange exception if Index is greater | |

137 | -- than the number of solutions. | |

138 | -- It raises NotDone if the construction algorithm did not | |

139 | -- succeed. | |

140 | ||

141 | WhichQualifier(me ; | |

142 | Index : Integer from Standard; | |

143 | Qualif1 : out Position from GccEnt ; | |

144 | Qualif2 : out Position from GccEnt ) | |

145 | raises OutOfRange, NotDone | |

146 | is static; | |

147 | ---Purpose: It returns the information about the qualifiers of | |

148 | -- the tangency arguments concerning the solution number Index. | |

149 | -- It returns the real qualifiers (the qualifiers given to the | |

150 | -- constructor method in case of enclosed, enclosing and outside | |

151 | -- and the qualifiers computedin case of unqualified). | |

152 | ||

153 | Tangency1(me ; | |

154 | Index : Integer from Standard; | |

155 | ParSol,ParArg : out Real from Standard; | |

156 | PntSol : out Pnt2d from gp ) | |

157 | ---Purpose: Returns information about the tangency point between the | |

158 | -- result number Index and the first argument. | |

159 | -- ParSol is the intrinsic parameter of the point PntSol on the solution. | |

160 | -- ParArg is the intrinsic parameter of the point PntSol on the first | |

161 | -- argument. | |

162 | raises OutOfRange, NotDone | |

163 | is static; | |

164 | ---Purpose: It raises OutOfRange if Index is greater than the number | |

165 | -- of solutions. | |

166 | -- It raises NotDone if the construction algorithm did not | |

167 | -- succeed. | |

168 | ||

169 | Tangency2(me ; | |

170 | Index : Integer from Standard; | |

171 | ParSol,ParArg : out Real from Standard; | |

172 | PntSol : out Pnt2d from gp ) | |

173 | ---Purpose: Returns information about the tangency point between the | |

174 | -- result number Index and the second argument. | |

175 | -- ParSol is the intrinsic parameter of the point PntSol on | |

176 | -- the solution. | |

177 | -- ParArg is the intrinsic parameter of the point PntArg on | |

178 | -- the second argument. | |

179 | raises OutOfRange, NotDone | |

180 | is static; | |

181 | ---Purpose: It raises OutOfRange if Index is greater than the number | |

182 | -- of solutions. | |

183 | -- It raises NotDone if the construction algorithm did not | |

184 | -- succeed. | |

185 | ||

186 | IsTheSame1(me ; | |

187 | Index : Integer from Standard) returns Boolean from Standard | |

188 | ---Purpose: Returns True if the solution number Index is equal to | |

189 | -- the first argument. | |

190 | raises OutOfRange, NotDone | |

191 | is static; | |

192 | ---Purpose: It raises OutOfRange if Index is greater than the number | |

193 | -- of solutions. | |

194 | -- It raises NotDone if the construction algorithm did not | |

195 | -- succeed. | |

196 | ||

197 | IsTheSame2(me ; | |

198 | Index : Integer from Standard) returns Boolean from Standard | |

199 | ---Purpose: Returns True if the solution number Index is equal to | |

200 | -- the second argument. | |

201 | raises OutOfRange, NotDone | |

202 | is static; | |

203 | ---Purpose: It raises OutOfRange if Index is greater than the number | |

204 | -- of solutions. | |

205 | -- It raises NotDone if the construction algorithm did not | |

206 | -- succeed. | |

207 | ||

208 | fields | |

209 | ||

210 | WellDone : Boolean from Standard; | |

211 | ---Purpose: True if the algorithm succeeded. | |

212 | ||

213 | NbrSol : Integer from Standard; | |

214 | ---Purpose: The number of possible solutions. We have to decide about | |

215 | -- the status of the multiple solutions... | |

216 | ||

217 | cirsol : Array1OfCirc2d from TColgp; | |

218 | -- The solutions. | |

219 | ||

220 | qualifier1 : Array1OfPosition from GccEnt; | |

221 | -- The qualifiers of the first argument. | |

222 | ||

223 | qualifier2 : Array1OfPosition from GccEnt; | |

224 | -- The qualifiers of the second argument. | |

225 | ||

226 | TheSame1 : Array1OfInteger from TColStd; | |

227 | ---Purpose: 1 if the solution and the first argument are the same | |

228 | -- (2 circles). | |

229 | -- If R1 is the radius of the first argument and Rsol the radius | |

230 | -- of the solution and dist the distance between the two centers, | |

231 | -- we consider the two circles are identical if R1+dist-Rsol is | |

232 | -- less than Tolerance. | |

233 | -- 0 in the other cases. | |

234 | ||

235 | TheSame2 : Array1OfInteger from TColStd; | |

236 | ---Purpose: 1 if the solution and the second argument are the same | |

237 | -- (2 circles). | |

238 | -- If R2 is the radius of the second argument and Rsol the radius | |

239 | -- of the solution and dist the distance between the two centers, | |

240 | -- we consider the two circles are identical if R2+dist-Rsol is | |

241 | -- less than Tolerance. | |

242 | -- 0 in the other cases. | |

243 | ||

244 | pnttg1sol : Array1OfPnt2d from TColgp; | |

245 | ---Purpose: The tangency point between the solution and the first | |

246 | -- argument on the solution. | |

247 | ||

248 | pnttg2sol : Array1OfPnt2d from TColgp; | |

249 | ---Purpose: The tangency point between the solution and the second | |

250 | -- argument on the solution. | |

251 | ||

252 | par1sol : Array1OfReal from TColStd; | |

253 | ---Purpose: The parameter of the tangency point between the solution | |

254 | -- and the first argument on the solution. | |

255 | ||

256 | par2sol : Array1OfReal from TColStd; | |

257 | ---Purpose: The parameter of the tangency point between the solution | |

258 | -- and the second argument on the solution. | |

259 | ||

260 | pararg1 : Array1OfReal from TColStd; | |

261 | ---Purpose: The parameter of the tangency point between the solution | |

262 | -- and the first argument on the first argument. | |

263 | ||

264 | pararg2 : Array1OfReal from TColStd; | |

265 | ---Purpose: The parameter of the tangency point between the solution | |

266 | -- and the second argument on the second argument. | |

267 | ||

268 | end Circ2d2TanRad; |