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

b311480e | 1 | -- Created on: 1993-05-14 |

2 | -- Created by: Laurent PAINNOT | |

3 | -- Copyright (c) 1993-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 ComputeCLine from Approx | |

368cdde6 | 18 | (MultiLine as any) |

ff8178ef | 19 | ---Purpose: Approximate a continous MultiLine with a cutting. |

20 | -- The Tool of the line is the tool from AppCont. | |

7fd59977 | 21 | |

22 | uses ParametrizationType from Approx, | |

23 | SequenceOfReal from TColStd, | |

24 | HArray1OfReal from TColStd, | |

25 | SequenceOfMultiCurve from AppParCurves, | |

26 | MultiCurve from AppParCurves, | |

27 | Constraint from AppParCurves, | |

28 | Vector from math | |

29 | ||

30 | ||

7fd59977 | 31 | is |

32 | ||

33 | ||

34 | Create(Line: MultiLine; | |

35 | degreemin: Integer = 3; | |

36 | degreemax: Integer = 8; | |

37 | Tolerance3d: Real = 1.0e-5; | |

38 | Tolerance2d: Real = 1.0e-5; | |

39 | cutting: Boolean = Standard_False; | |

40 | FirstC: Constraint = AppParCurves_TangencyPoint; | |

41 | LastC: Constraint = AppParCurves_TangencyPoint) | |

42 | ||

43 | ---Purpose: The MultiLine <Line> will be approximated until tolerances | |

44 | -- will be reached. | |

45 | -- The approximation will be done from degreemin to degreemax | |

46 | -- with a cutting if the corresponding boolean is True. | |

47 | ||

48 | returns ComputeCLine; | |

49 | ||

50 | ||

51 | ||

52 | ||

53 | Create(degreemin: Integer = 3; | |

54 | degreemax: Integer = 8; | |

55 | Tolerance3d: Real = 1.0e-05; | |

56 | Tolerance2d: Real = 1.0e-05; | |

57 | cutting: Boolean = Standard_False; | |

58 | FirstC: Constraint = AppParCurves_TangencyPoint; | |

59 | LastC: Constraint = AppParCurves_TangencyPoint) | |

60 | ||

61 | ---Purpose: Initializes the fields of the algorithm. | |

62 | ||

63 | returns ComputeCLine; | |

64 | ||

65 | ||

66 | Perform(me: in out; Line: MultiLine) | |

67 | ---Purpose: runs the algorithm after having initialized the fields. | |

68 | ||

69 | is static; | |

70 | ||

71 | ||

72 | Compute(me: in out; Line: MultiLine; Ufirst, Ulast: Real; | |

73 | TheTol3d, TheTol2d: in out Real) | |

74 | ---Purpose: is internally used by the algorithms. | |

75 | ||

76 | returns Boolean | |

77 | is static private; | |

78 | ||

79 | ||

80 | SetDegrees(me: in out; degreemin, degreemax: Integer) | |

81 | ---Purpose: changes the degrees of the approximation. | |

82 | ||

83 | is static; | |

84 | ||

85 | ||

86 | SetTolerances(me: in out; Tolerance3d, Tolerance2d: Real) | |

87 | ---Purpose: Changes the tolerances of the approximation. | |

88 | ||

89 | is static; | |

90 | ||

91 | ||

92 | SetConstraints(me: in out; FirstC, LastC: Constraint) | |

93 | ---Purpose: Changes the constraints of the approximation. | |

94 | ||

95 | is static; | |

96 | ||

97 | ||

98 | IsAllApproximated(me) | |

99 | ---Purpose: returns False if at a moment of the approximation, | |

100 | -- the status NoApproximation has been sent by the user | |

101 | -- when more points were needed. | |

102 | ||

103 | returns Boolean | |

104 | is static; | |

105 | ||

106 | IsToleranceReached(me) | |

107 | ---Purpose: returns False if the status NoPointsAdded has been sent. | |

108 | ||

109 | returns Boolean | |

110 | is static; | |

111 | ||

112 | ||

113 | Error(me; Index: Integer; tol3d: in out Real; tol2d: in out Real) | |

114 | ---Purpose: returns the tolerances 2d and 3d of the <Index> MultiCurve. | |

115 | ||

116 | is static; | |

117 | ||

118 | ||

119 | NbMultiCurves(me) | |

120 | ---Purpose: Returns the number of MultiCurve doing the approximation | |

121 | -- of the MultiLine. | |

122 | returns Integer | |

123 | is static; | |

124 | ||

125 | ||

126 | Value(me; Index: Integer = 1) | |

127 | ---Purpose: returns the approximation MultiCurve of range <Index>. | |

128 | ||

129 | returns MultiCurve from AppParCurves; | |

130 | ||

131 | ||

132 | Parameters(me; Index: Integer; firstp, lastp: in out Real) | |

133 | ---purpose: returns the first and last parameters of the | |

134 | -- <Index> MultiCurve. | |

135 | is static; | |

136 | ||

137 | ||

138 | fields | |

139 | ||

140 | ||

141 | myMultiCurves: SequenceOfMultiCurve from AppParCurves; | |

142 | myfirstparam: SequenceOfReal from TColStd; | |

143 | mylastparam: SequenceOfReal from TColStd; | |

144 | TheMultiCurve: MultiCurve from AppParCurves; | |

145 | alldone: Boolean; | |

146 | tolreached: Boolean; | |

147 | Tolers3d: SequenceOfReal from TColStd; | |

148 | Tolers2d: SequenceOfReal from TColStd; | |

149 | mydegremin: Integer; | |

150 | mydegremax: Integer; | |

151 | mytol3d: Real; | |

152 | mytol2d: Real; | |

153 | currenttol3d: Real; | |

154 | currenttol2d: Real; | |

155 | mycut: Boolean; | |

156 | myfirstC: Constraint; | |

368cdde6 | 157 | mylastC: Constraint; |

7fd59977 | 158 | |

159 | ||

160 | end ComputeCLine; |