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

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

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

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 | class Lin2dBisec | |

18 | ||

19 | from GccAna | |

20 | ||

21 | ---Purpose: Describes functions for building bisecting lines between two 2D lines. | |

22 | -- A bisecting line between two lines is such that each of its | |

23 | -- points is at the same distance from the two lines. | |

24 | -- If the two lines are secant, there are two orthogonal | |

25 | -- bisecting lines which share the angles made by the two | |

26 | -- straight lines in two equal parts. If D1 and D2 are the | |

27 | -- unit vectors of the two straight lines, those of the two | |

28 | -- bisecting lines are collinear with the following vectors: | |

29 | -- - D1 + D2 for the "internal" bisecting line, | |

30 | -- - D1 - D2 for the "external" bisecting line. | |

31 | -- If the two lines are parallel, the (unique) bisecting line is | |

32 | -- the straight line equidistant from the two straight lines. If | |

33 | -- the two straight lines are coincident, the algorithm | |

34 | -- returns the first straight line as the solution. | |

35 | -- A Lin2dTanObl object provides a framework for: | |

36 | -- - defining the construction of the bisecting lines, | |

37 | -- - implementing the construction algorithm, and | |

38 | -- - consulting the result. | |

39 | ||

40 | uses Lin2d from gp, | |

41 | Pnt2d from gp, | |

42 | Array1OfReal from TColStd, | |

43 | Array1OfLin2d from TColgp, | |

44 | Array1OfPnt2d from TColgp | |

45 | ||

46 | raises OutOfRange from Standard, | |

47 | NotDone from StdFail | |

48 | ||

49 | is | |

50 | ||

51 | Create(Lin1 : Lin2d from gp ; | |

52 | Lin2 : Lin2d from gp ) returns Lin2dBisec; | |

53 | ||

54 | ---Purpose: Constructs bisecting lines between the two lines Lin1 and Lin2. | |

55 | ||

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

57 | is static; | |

58 | ---Purpose: Returns True when the algorithm succeded. | |

59 | ||

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

61 | raises NotDone | |

62 | is static; | |

63 | ---Purpose: Returns the number of solutions and raise NotDone if | |

64 | -- the constructor wasn't called before. | |

65 | ||

66 | ThisSolution(me ; | |

67 | Index : Integer from Standard) returns Lin2d | |

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

69 | -- The first solution is the inside one and the second is the | |

70 | -- outside one. | |

71 | -- For the first solution the direction is D1+D2 (D1 is | |

72 | -- the direction of the first argument and D2 the | |

73 | -- direction of the second argument). | |

74 | -- For the second solution the direction is D1-D2. | |

75 | -- Raises NotDone if the construction algorithm | |

76 | -- didn't succeed. | |

77 | -- It raises OutOfRange if Index is greater than the | |

78 | -- number of solutions. | |

79 | raises OutOfRange, NotDone | |

80 | is static; | |

81 | ||

82 | Intersection1 (me ; | |

83 | Index : Integer from Standard; | |

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

85 | PntSol : out Pnt2d from gp ) | |

86 | ---Purpose: Returns informations about the intersection point between | |

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

88 | -- Raises NotDone if the construction algorithm didn't succeed. | |

89 | -- It raises OutOfRange if Index is greater than the | |

90 | -- number of solutions. | |

91 | raises OutOfRange, NotDone | |

92 | is static; | |

93 | ||

94 | ||

95 | Intersection2 (me ; | |

96 | Index : Integer from Standard; | |

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

98 | PntSol : out Pnt2d from gp ) | |

99 | ---Purpose: Returns informations about the intersection point between | |

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

101 | -- Raises NotDone if the construction algorithm | |

102 | -- didn't succeed. | |

103 | -- It raises OutOfRange if Index is greater than the | |

104 | -- number of solutions. | |

105 | raises OutOfRange, NotDone | |

106 | is static; | |

107 | ||

108 | ||

109 | fields | |

110 | ||

111 | WellDone : Boolean from Standard; | |

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

113 | ||

114 | NbrSol : Integer from Standard; | |

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

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

117 | ||

118 | linsol : Array1OfLin2d from TColgp; | |

119 | ---Purpose : The solutions. | |

120 | ||

121 | pntint1sol : Array1OfPnt2d from TColgp; | |

122 | ---Purpose: The tangency point between the solution and the | |

123 | -- first argument on the solution. | |

124 | ||

125 | pntint2sol : Array1OfPnt2d from TColgp; | |

126 | ---Purpose: The tangency point between the solution and the | |

127 | -- second argument on the solution. | |

128 | ||

129 | par1sol : Array1OfReal from TColStd; | |

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

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

132 | ||

133 | par2sol : Array1OfReal from TColStd; | |

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

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

136 | ||

137 | pararg1 : Array1OfReal from TColStd; | |

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

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

140 | ||

141 | pararg2 : Array1OfReal from TColStd; | |

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

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

144 | ||

145 | end Lin2dBisec; |