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

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

2 | -- Created by: Remi GILET | |

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

4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS | |

5 | -- | |

6 | -- The content of this file is subject to the Open CASCADE Technology Public | |

7 | -- License Version 6.5 (the "License"). You may not use the content of this file | |

8 | -- except in compliance with the License. Please obtain a copy of the License | |

9 | -- at http://www.opencascade.org and read it completely before using this file. | |

10 | -- | |

11 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its | |

12 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. | |

13 | -- | |

14 | -- The Original Code and all software distributed under the License is | |

15 | -- distributed on an "AS IS" basis, without warranty of any kind, and the | |

16 | -- Initial Developer hereby disclaims all such warranties, including without | |

17 | -- limitation, any warranties of merchantability, fitness for a particular | |

18 | -- purpose or non-infringement. Please see the License for the specific terms | |

19 | -- and conditions governing the rights and limitations under the License. | |

20 | ||

7fd59977 | 21 | |

22 | ||

23 | class Lin2dBisec | |

24 | ||

25 | from GccAna | |

26 | ||

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

44 | -- - consulting the result. | |

45 | ||

46 | uses Lin2d from gp, | |

47 | Pnt2d from gp, | |

48 | Array1OfReal from TColStd, | |

49 | Array1OfLin2d from TColgp, | |

50 | Array1OfPnt2d from TColgp | |

51 | ||

52 | raises OutOfRange from Standard, | |

53 | NotDone from StdFail | |

54 | ||

55 | is | |

56 | ||

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

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

59 | ||

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

61 | ||

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

63 | is static; | |

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

65 | ||

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

67 | raises NotDone | |

68 | is static; | |

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

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

71 | ||

72 | ThisSolution(me ; | |

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

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

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

76 | -- outside one. | |

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

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

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

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

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

82 | -- didn't succeed. | |

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

84 | -- number of solutions. | |

85 | raises OutOfRange, NotDone | |

86 | is static; | |

87 | ||

88 | Intersection1 (me ; | |

89 | Index : Integer from Standard; | |

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

91 | PntSol : out Pnt2d from gp ) | |

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

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

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

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

96 | -- number of solutions. | |

97 | raises OutOfRange, NotDone | |

98 | is static; | |

99 | ||

100 | ||

101 | Intersection2 (me ; | |

102 | Index : Integer from Standard; | |

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

104 | PntSol : out Pnt2d from gp ) | |

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

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

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

108 | -- didn't succeed. | |

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

110 | -- number of solutions. | |

111 | raises OutOfRange, NotDone | |

112 | is static; | |

113 | ||

114 | ||

115 | fields | |

116 | ||

117 | WellDone : Boolean from Standard; | |

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

119 | ||

120 | NbrSol : Integer from Standard; | |

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

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

123 | ||

124 | linsol : Array1OfLin2d from TColgp; | |

125 | ---Purpose : The solutions. | |

126 | ||

127 | pntint1sol : Array1OfPnt2d from TColgp; | |

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

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

130 | ||

131 | pntint2sol : Array1OfPnt2d from TColgp; | |

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

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

134 | ||

135 | par1sol : Array1OfReal from TColStd; | |

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

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

138 | ||

139 | par2sol : Array1OfReal from TColStd; | |

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

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

142 | ||

143 | pararg1 : Array1OfReal from TColStd; | |

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

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

146 | ||

147 | pararg2 : Array1OfReal from TColStd; | |

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

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

150 | ||

151 | end Lin2dBisec; |