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

b311480e | 1 | -- Created on: 1995-09-21 |

2 | -- Created by: Gerard GRAS | |

3 | -- Copyright (c) 1995-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 | -- Modified: TCL_G002 adds new draw methods DrawElement(...) and DrawVertex(...) |

22 | ||

7fd59977 | 23 | |

24 | class SetOfCurves from GGraphic2d inherits Line from Graphic2d | |

25 | ||

26 | ---Version: | |

27 | ||

28 | ---Purpose: The primitive SetOfCurves | |

29 | ||

30 | ---Keywords: Primitive, Curve | |

31 | ---Warning: This primitive must be use as possible for performance | |

32 | -- improvment but is drawn with a global line attributes | |

33 | -- for all the set. | |

34 | -- NOTE: than the method PickedIndex() permits to known | |

35 | -- the last picked curve in the set. | |

36 | ---References: | |

37 | ||

38 | uses | |

39 | Drawer from Graphic2d, | |

40 | GraphicObject from Graphic2d, | |

41 | SequenceOfCurve from TColGeom2d, | |

42 | Length from Quantity, | |

43 | Curve from Geom2d, | |

44 | SequenceOfShortReal from TShort, | |

45 | FStream from Aspect | |

46 | ||

47 | raises | |

48 | CurveDefinitionError from GGraphic2d, | |

49 | OutOfRange from Standard | |

50 | ||

51 | is | |

52 | ------------------------- | |

53 | -- Category: Constructors | |

54 | ------------------------- | |

55 | ||

56 | Create (aGraphicObject: GraphicObject from Graphic2d) | |

57 | returns mutable SetOfCurves from GGraphic2d; | |

58 | ---Level: Public | |

59 | ---Purpose: Creates an empty set of curves in the graphic | |

60 | -- object <aGraphicObject>. | |

61 | ---Category: Constructors | |

62 | ||

63 | Add(me : mutable; aCurve: Curve from Geom2d); | |

64 | ---Level: Public | |

65 | ---Purpose: Add a curve in the set | |

66 | ---Category: Update method | |

67 | ||

68 | Length(me) returns Integer from Standard; | |

69 | ---Level: Public | |

70 | ---Purpose: Returns the number of curves in the set. | |

71 | ---Category: Inquiry method | |

72 | ||

73 | Values(me; aRank: Integer from Standard) returns Curve from Geom2d | |

74 | ---Level: Public | |

75 | ---Purpose: Returns the curve of rank <aRank> from the set. | |

76 | ---Trigger: Raises OutOfRange if <aRank> is <1 or >Length() | |

77 | raises OutOfRange from Standard; | |

78 | ---Category: Inquiry method | |

79 | ||

80 | -------------------------- | |

81 | -- Category: Draw and Pick | |

82 | -------------------------- | |

83 | ||

84 | Draw (me : mutable; aDrawer: Drawer from Graphic2d) | |

85 | is static protected; | |

86 | ---Level: Internal | |

87 | ---Purpose: Draws the set of curves <me>. | |

88 | ||

89 | DrawElement( me : mutable; aDrawer: Drawer from Graphic2d; | |

90 | anIndex: Integer from Standard) | |

91 | is redefined protected; | |

92 | ---Level: Internal | |

93 | ---Purpose: Draws element <anIndex> of the set <me>. | |

94 | ||

95 | DrawVertex( me : mutable; aDrawer: Drawer from Graphic2d; | |

96 | anIndex: Integer from Standard) | |

97 | is redefined protected; | |

98 | ---Level: Internal | |

99 | ---Purpose: Draws vertex <anIndex> of the set <me>. | |

100 | ||

101 | Pick (me : mutable; X, Y: ShortReal from Standard; | |

102 | aPrecision: ShortReal from Standard; | |

103 | aDrawer: Drawer from Graphic2d) | |

104 | returns Boolean from Standard | |

105 | is static protected; | |

106 | ---Level: Internal | |

107 | ---Purpose: Returns Standard_True if one curve of the set <me> | |

108 | -- is picked, Standard_False if not. | |

109 | ---Warning: The PickIndex() method returns the rank of the picked | |

110 | -- curve if any. | |

111 | ||

112 | Save( me; aFStream: in out FStream from Aspect ) is virtual protected; | |

113 | ||

114 | fields | |

115 | myCurves: SequenceOfCurve from TColGeom2d; | |

116 | ||

117 | end SetOfCurves from GGraphic2d; |