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

b311480e | 1 | -- Created on: 1996-12-03 |

2 | -- Created by: Arnaud BOUZY/Odile Olivier | |

3 | -- Copyright (c) 1996-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 | class LengthDimension from AIS inherits Relation from AIS | |

23 | ||

24 | ---Purpose: A framework to display lengths. | |

25 | -- These can be lengths along a face or edge, or | |

26 | -- between two faces or two edges. | |

27 | -- The value of the length is given in a text figuring in this display. | |

28 | ||

29 | uses Shape from TopoDS, | |

30 | Face from TopoDS, | |

31 | Presentation from Prs3d, | |

32 | PresentationManager3d from PrsMgr, | |

33 | Selection from SelectMgr, | |

34 | Dir from gp, | |

35 | Pnt from gp, | |

36 | Projector from Prs3d, | |

128cc8df | 37 | Transformation from Geom, |

7fd59977 | 38 | ExtendedString from TCollection, |

39 | Plane from Geom, | |

40 | TypeOfDist from AIS, | |

41 | ArrowSide from DsgPrs, | |

42 | KindOfDimension from AIS, | |

43 | Drawer from Prs3d, | |

44 | Edge from TopoDS, | |

45 | Box from Bnd, | |

46 | Drawer from AIS, | |

47 | Vertex from TopoDS | |

48 | is | |

49 | ||

50 | ||

51 | ||

52 | Create (aFirstFace : Face from TopoDS; | |

53 | aSecondFace : Face from TopoDS; | |

54 | aVal : Real from Standard; -- is defined while first compute, may be any Real | |

55 | aText : ExtendedString from TCollection) | |

56 | ---Purpose: Constructs a length display object defined by the first | |

57 | -- face aFShape, the second face aSShape, the dimension aVal, and the text aText. | |

58 | ||

59 | returns mutable LengthDimension from AIS; | |

60 | ||

61 | Create (aFirstFace : Face from TopoDS; | |

62 | aSecondFace : Face from TopoDS; | |

63 | aVal : Real from Standard; -- is defined while first compute, may be any Real | |

64 | aText : ExtendedString from TCollection; | |

65 | aPosition : Pnt from gp; | |

66 | aSymbolPrs : ArrowSide from DsgPrs; | |

67 | anArrowSize : Real from Standard = 0.0) | |

68 | ---Purpose: Constructs a length display object defined by the first | |

69 | -- face aFShape, the second face aSShape, the | |

70 | -- dimension aVal, the position aPosition, the arrow | |

71 | -- aSymbolPrs with the size anArrowSize and the text aText. | |

72 | returns mutable LengthDimension from AIS; | |

73 | ||

74 | Create (Face : Face from TopoDS; | |

75 | Edge : Edge from TopoDS; | |

76 | Val : Real from Standard; | |

77 | Text : ExtendedString from TCollection) | |

78 | ---Purpose: Constructs a length display object defined by the first | |

79 | -- edge or vertex aFShape, the second edge or vertex | |

80 | -- aSShape, the dimension aVal,and the plane aPlane. | |

81 | returns mutable LengthDimension from AIS; | |

82 | ||

83 | Create (aFShape : Shape from TopoDS; | |

84 | aSShape : Shape from TopoDS; | |

85 | aPlane : Plane from Geom; | |

86 | aVal : Real from Standard; | |

87 | aText : ExtendedString from TCollection) | |

88 | ---Purpose: -- Constructs a length display object defined by the first | |

89 | -- edge or vertex aFShape, the second edge or vertex | |

90 | -- aSShape, the dimension aVal,and the plane aPlane. | |

91 | returns mutable LengthDimension from AIS; | |

92 | ||

93 | Create (aFShape : Shape from TopoDS; | |

94 | aSShape : Shape from TopoDS; | |

95 | aPlane : Plane from Geom; | |

96 | aVal : Real from Standard; | |

97 | aText : ExtendedString from TCollection; | |

98 | aPosition : Pnt from gp; | |

99 | aSymbolPrs : ArrowSide from DsgPrs; | |

100 | aTypeDist : TypeOfDist from AIS; | |

101 | anArrowSize : Real from Standard = 0.0) | |

102 | ---Purpose: Constructs a length display object defined by the first | |

103 | -- edge or vertex aFShape, the second edge or vertex | |

104 | -- aSShape, the dimension aVal, the position aPosition, | |

105 | -- the type of distance aTypeDist, the type of arrow | |

106 | -- aSymbolPrs with the size anArrowSize, and the plane aPlane. | |

107 | returns mutable LengthDimension from AIS; | |

108 | ||

109 | SetFirstShape( me: mutable; aFShape : Shape from TopoDS ) | |

110 | is redefined static; | |

111 | ||

112 | SetSecondShape( me: mutable; aSShape : Shape from TopoDS ) | |

113 | is redefined static; | |

114 | ||

115 | KindOfDimension(me) | |

116 | returns KindOfDimension from AIS | |

117 | is redefined; | |

118 | ---Purpose: Indicates that we are concerned with a length. | |

119 | ||

120 | IsMovable(me) returns Boolean from Standard | |

121 | is redefined; | |

122 | ---Purpose: Returns true if the length dimension is movable. | |

123 | ||

124 | TypeOfDist (me) | |

125 | ---C++: inline | |

126 | --- Purpose: | |

127 | -- Returns the type of distance of the length primitive. | |

128 | returns TypeOfDist from AIS | |

129 | is static; | |

130 | ||

131 | SetTypeOfDist(me: mutable;aTypeDist: TypeOfDist from AIS) | |

132 | ---C++: inline | |

133 | --- Purpose: | |

134 | -- Returns true if the length dimension is movable. | |

135 | is static; | |

136 | ||

137 | ||

138 | -- Methods from PresentableObject | |

139 | ||

140 | Compute(me : mutable; | |

141 | aPresentationManager : PresentationManager3d from PrsMgr; | |

142 | aPresentation : mutable Presentation from Prs3d; | |

143 | aMode : Integer from Standard= 0) | |

144 | is redefined private; | |

145 | ||

146 | Compute(me : mutable; | |

147 | aProjector : Projector from Prs3d; | |

148 | aPresentation : mutable Presentation from Prs3d) | |

149 | is redefined static private; | |

150 | ||

7fd59977 | 151 | Compute(me : mutable; |

152 | aProjector : Projector from Prs3d; | |

153 | aTrsf : Transformation from Geom; | |

154 | aPresentation : mutable Presentation from Prs3d) | |

155 | is redefined; | |

156 | ---Purpose: computes the presentation according to a point of view | |

157 | -- given by <aProjector>. | |

158 | -- To be Used when the associated degenerated Presentations | |

159 | -- have been transformed by <aTrsf> which is not a Pure | |

160 | -- Translation. The HLR Prs can't be deducted automatically | |

161 | -- WARNING :<aTrsf> must be applied | |

162 | -- to the object to display before computation !!! | |

163 | ||

164 | ||

165 | -- Methods from SelectableObject | |

166 | ||

167 | ComputeSelection(me : mutable; | |

168 | aSelection : mutable Selection from SelectMgr; | |

169 | aMode : Integer from Standard) | |

170 | is redefined private; | |

171 | ||

172 | ||

173 | ||

174 | -- Computation private methods | |

175 | ||

176 | ComputeOneFaceLength(me : mutable; | |

177 | aPresentation : mutable Presentation from Prs3d) | |

178 | is private; | |

179 | ||

180 | ComputeOneEdgeLength(me : mutable; | |

181 | aPresentation : mutable Presentation from Prs3d) | |

182 | is private; | |

183 | ||

184 | ComputeTwoFacesLength(me: mutable; | |

185 | aPresentation : mutable Presentation from Prs3d) | |

186 | is private; | |

187 | ||

188 | ||

189 | ComputeEdgeFaceLength (me: mutable; | |

190 | aPresentation : mutable Presentation from Prs3d) | |

191 | is private; | |

192 | ||

193 | ||

194 | ComputeTwoEdgesLength (myclass; | |

195 | aPresentation : mutable Presentation from Prs3d; | |

196 | aDrawer : Drawer from AIS; | |

197 | aText : ExtendedString from TCollection; | |

198 | ArrowSize : Real from Standard; | |

199 | FirstEdge : Edge from TopoDS; | |

200 | SecondEdge : Edge from TopoDS; | |

201 | Plane : Plane from Geom; | |

202 | AutomaticPos : Boolean from Standard; | |

203 | IsSetBndBox : Boolean from Standard; | |

204 | BndBox : Box from Bnd; | |

205 | ExtShape : out Integer from Standard; | |

206 | Val : out Real from Standard; | |

207 | DirAttach : out Dir from gp; | |

208 | Position : out Pnt from gp; | |

209 | FirstAttach : out Pnt from gp; | |

210 | SecondAttach : out Pnt from gp; | |

211 | SymbolPrs : out ArrowSide from DsgPrs ); | |

212 | ||

213 | ComputeOneEdgeOneVertexLength(myclass; | |

214 | aPresentation : mutable Presentation from Prs3d; | |

215 | aDrawer : Drawer from AIS; | |

216 | aText : ExtendedString from TCollection; | |

217 | ArrowSize : Real from Standard; | |

218 | FirstShape : Shape from TopoDS; | |

219 | SecondShape : Shape from TopoDS; | |

220 | Plane : Plane from Geom; | |

221 | AutomaticPos : Boolean from Standard; | |

222 | IsSetBndBox : Boolean from Standard; | |

223 | BndBox : Box from Bnd; | |

224 | ExtShape : out Integer from Standard; | |

225 | Val : out Real from Standard; | |

226 | DirAttach : out Dir from gp; | |

227 | Position : out Pnt from gp; | |

228 | FirstAttach : out Pnt from gp; | |

229 | SecondAttach : out Pnt from gp; | |

230 | SymbolPrs : out ArrowSide from DsgPrs ); | |

231 | ||

232 | ComputeTwoVerticesLength(myclass; | |

233 | aPresentation : mutable Presentation from Prs3d; | |

234 | aDrawer : Drawer from AIS; | |

235 | aText : ExtendedString from TCollection; | |

236 | ArrowSize : Real from Standard; | |

237 | FirstVertex : Vertex from TopoDS; | |

238 | SecondVertex : Vertex from TopoDS; | |

239 | Plane : Plane from Geom; | |

240 | AutomaticPos : Boolean from Standard; | |

241 | IsSetBndBox : Boolean from Standard; | |

242 | BndBox : Box from Bnd; | |

243 | TypeDist : TypeOfDist from AIS; | |

244 | ExtShape : out Integer from Standard; | |

245 | Val : out Real from Standard; | |

246 | DirAttach : out Dir from gp; | |

247 | Position : out Pnt from gp; | |

248 | FirstAttach : out Pnt from gp; | |

249 | SecondAttach : out Pnt from gp; | |

250 | SymbolPrs : out ArrowSide from DsgPrs ); | |

251 | ||

252 | ||

253 | -- | |

254 | -- Computation Selection private methods | |

255 | -- | |

256 | ||

257 | ComputeFaceSelection(me : mutable; | |

258 | aSelection : mutable Selection from SelectMgr) | |

259 | is private; | |

260 | ||

261 | ComputeEdgeVertexSelection( me : mutable; | |

262 | aSelection : mutable Selection from SelectMgr) | |

263 | is private; | |

264 | ||

265 | ||

266 | fields | |

267 | ||

268 | myNbShape : Integer from Standard; | |

269 | myFAttach : Pnt from gp; | |

270 | mySAttach : Pnt from gp; | |

271 | myDirAttach: Dir from gp; | |

272 | myTypeDist : TypeOfDist from AIS; | |

273 | ||

274 | end LengthDimension; |