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

b311480e | 1 | -- Created on: 1993-07-06 |

2 | -- Created by: Yves FRICAUD | |

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

47cbf134 | 17 | class BisectingLocus from BRepMAT2d |

7fd59977 | 18 | |

19 | ---Purpose : BisectingLocus generates and contains the Bisecting_Locus | |

20 | -- of a set of lines from Geom2d, defined by <ExploSet>. | |

21 | -- | |

22 | -- If the set of lines contains closed lines: | |

23 | -- ------------------------------------------ | |

24 | -- These lines cut the plane in areas. | |

25 | -- One map can be computed for each area. | |

26 | -- | |

27 | -- Bisecting locus computes a map in an area. | |

28 | -- The area is defined by a side (MAT_Left,MAT_Right) | |

29 | -- on one of the closed lines. | |

30 | -- | |

31 | -- If the set of lines contains only open lines: | |

32 | -- -------------------------------------------- | |

33 | -- the map recovers all the plane. | |

34 | -- | |

35 | -- Warning: Assume the orientation of the closed lines are | |

36 | -- compatible. | |

37 | -- | |

38 | -- Assume the explo contains only lines located in the | |

39 | -- area where the bisecting locus will be computed. | |

40 | -- | |

41 | -- Assume a line don't cross itself or an other line. | |

42 | -- | |

43 | -- Remark: | |

44 | -- the curves coming from the explorer can be | |

45 | -- decomposed in different parts. It the case for the | |

46 | -- curves other than circles or lines. | |

47 | -- | |

48 | -- The map of bisecting locus is described by a graph. | |

49 | -- - The BasicsElements correspond to elements on | |

47cbf134 | 50 | -- the figure described by the Explorer from BRepMAT2d. |

7fd59977 | 51 | -- - The Arcs correspond to the bisectors. |

52 | -- - The Nodes are the extremities of the arcs. | |

53 | ||

54 | uses | |

c19dd45e | 55 | JoinType from GeomAbs, |

7fd59977 | 56 | Graph from MAT, |

57 | Arc from MAT, | |

58 | BasicElt from MAT, | |

59 | Node from MAT, | |

60 | Side from MAT, | |

61 | DataMapOfIntegerBasicElt from MAT, | |

62 | DataMapOfBiIntInteger from MAT2d, | |

63 | Bisec from Bisector, | |

64 | Geometry from Geom2d, | |

65 | Pnt2d from gp, | |

47cbf134 | 66 | Tool2d from MAT2d, |

67 | Explorer from BRepMAT2d | |

7fd59977 | 68 | |

69 | is | |

47cbf134 | 70 | Create returns BisectingLocus from BRepMAT2d; |

7fd59977 | 71 | |

72 | ---Category: Construction. | |

73 | ||

74 | Compute (me : in out ; | |

47cbf134 | 75 | anExplo : in out Explorer from BRepMAT2d; |

7fd59977 | 76 | LineIndex : Integer = 1; |

6a442250 | 77 | aSide : Side from MAT = MAT_Left; |

c19dd45e | 78 | aJoinType : JoinType from GeomAbs = GeomAbs_Arc; |

6a442250 | 79 | IsOpenResult : Boolean = Standard_False) |

7fd59977 | 80 | --- Purpose : Computation of the Bisector_Locus in a set of Lines |

81 | -- defined in <anExplo>. | |

82 | -- The bisecting locus are computed on the side <aSide> | |

83 | -- from the line <LineIndex> in <anExplo>. | |

84 | is static; | |

85 | ||

86 | ---Category: Querying. | |

87 | ||

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

89 | ---Purpose: Returns True if Compute has succeeded. | |

90 | is static; | |

91 | ||

92 | Graph(me) returns Graph from MAT | |

93 | --- Purpose : Returns <theGraph> of <me>. | |

94 | is static; | |

95 | ||

96 | NumberOfContours (me) | |

97 | ---Purpose: Returns the number of contours. | |

98 | returns Integer from Standard | |

99 | is static; | |

100 | ||

101 | NumberOfElts( me ; IndLine : Integer) | |

102 | ---Purpose: Returns the number of BasicElts on the line | |

103 | -- <IndLine>. | |

104 | returns Integer from Standard | |

105 | is static; | |

106 | ||

107 | NumberOfSections (me; IndLine : Integer; Index : Integer) | |

108 | ---Purpose: Returns the number of sections of a curve. | |

109 | -- this curve is the Indexth curve in the IndLineth contour | |

110 | -- given by anExplo. | |

111 | -- | |

112 | returns Integer from Standard | |

113 | is static; | |

114 | ||

115 | BasicElt ( me ; IndLine : Integer ; Index : Integer) | |

116 | ---Purpose: Returns the BasicElts located at the position | |

117 | -- <Index> on the contour designed by <IndLine>. | |

118 | -- Remark: the BasicElts on a contour are sorted. | |

119 | -- | |

120 | returns BasicElt from MAT | |

121 | is static; | |

122 | ||

123 | GeomElt(me ; aBasicElt : BasicElt from MAT) | |

124 | --- Purpose : Returns the geometry linked to the <BasicElt>. | |

125 | returns Geometry from Geom2d | |

126 | is static; | |

127 | ||

128 | GeomElt(me ; aNode : Node from MAT) | |

129 | --- Purpose : Returns the geometry of type <gp> linked to | |

130 | -- the <Node>. | |

131 | returns Pnt2d from gp | |

132 | is static; | |

133 | ||

134 | GeomBis(me ; anArc : Arc from MAT ; Reverse :in out Boolean from Standard) | |

135 | --- Purpose : Returns the geometry of type <Bissec> | |

136 | -- linked to the arc <ARC>. | |

137 | -- <Reverse> is False when the FirstNode of <anArc> | |

138 | -- correspond to the first point of geometry. | |

139 | -- | |

140 | returns Bisec from Bisector | |

141 | is static; | |

142 | ||

143 | ---Category: private methods. | |

144 | ||

145 | Fusion(me : in out) | |

146 | is static private; | |

147 | ||

148 | RenumerationAndFusion | |

149 | (me : in out; | |

150 | IndexLine : Integer; | |

151 | LengthLine : Integer; | |

152 | IndexLast : in out Integer; | |

153 | NewMap : in out DataMapOfIntegerBasicElt from MAT) | |

154 | is static private; | |

155 | ||

156 | fields | |

157 | ||

158 | theGraph : Graph from MAT; | |

159 | theTool : Tool2d from MAT2d; | |

160 | isDone : Boolean from Standard; | |

161 | nbSect : DataMapOfBiIntInteger from MAT2d; | |

162 | nbContours : Integer from Standard; | |

163 | ||

164 | end BisectingLocus; | |

165 | ||

166 |