b311480e |
1 | -- Created on: 1993-03-23 |
2 | -- Created by: GG |
3 | -- Copyright (c) 1993-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
7fd59977 |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
7fd59977 |
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. |
7fd59977 |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class WidthMap from Aspect inherits TShared from MMgt |
18 | |
19 | ---Version: 0.0 |
20 | |
21 | ---Purpose: This class defines a WidthMap object. |
ff8178ef |
22 | -- Associates an index and a line width entry. |
7fd59977 |
23 | ---Keywords: |
24 | ---Warning: |
25 | ---References: |
26 | |
27 | uses |
28 | WidthOfLine from Aspect, |
29 | WidthMapEntry from Aspect, |
30 | SequenceOfWidthMapEntry from Aspect, |
31 | Length from Quantity |
32 | |
33 | raises |
34 | BadAccess from Aspect |
35 | |
36 | is |
37 | Create |
6e33d3ce |
38 | returns WidthMap from Aspect; |
7fd59977 |
39 | ---Level: Public |
40 | ---Purpose: Creates a width map. |
41 | |
42 | AddEntry (me : mutable; AnEntry : WidthMapEntry from Aspect) |
43 | ---Level: Public |
44 | ---Purpose: Adds an entry in the Width map <me>. |
45 | -- Warning: Raises BadAccess if WidthMap size is exceeded. |
46 | raises BadAccess from Aspect; |
47 | |
48 | AddEntry (me : mutable; aStyle : WidthOfLine from Aspect) |
49 | returns Integer from Standard; |
50 | ---Level: Public |
51 | ---Purpose: Search an identical line width entry in the width map <me> |
52 | -- and returns the WidthMapEntry Index if exist. |
53 | -- Or add a new entry and returns the computed WidthMapEntry index used. |
54 | |
55 | AddEntry (me : mutable; aStyle : Length from Quantity) |
56 | returns Integer from Standard; |
57 | ---Level: Public |
58 | ---Purpose: Search an identical line width entry in the width map <me> |
59 | -- and returns the WidthMapEntry Index if exist. |
60 | -- Or add a new entry and returns the computed WidthMapEntry index used. |
61 | |
62 | Size( me ) returns Integer from Standard is static; |
63 | ---Level: Public |
64 | ---Purpose: Returns the Allocated widthmap Size |
65 | |
66 | Index( me ; aWidthmapIndex : Integer ) returns Integer from Standard |
67 | ---Level: Public |
68 | ---Purpose: Returns the WidthMapEntry.Index of the WidthMap |
69 | -- at rank <aWidthmapIndex> . |
70 | raises BadAccess from Aspect is static; |
71 | ---Trigger: Raises BadAccess if the index less than 1 or |
72 | -- greater than Size. |
73 | |
74 | Entry ( me ; |
75 | AnIndex : Integer from Standard ) |
76 | returns WidthMapEntry from Aspect |
77 | ---Level: Public |
78 | ---Purpose: Returns the Width map entry with the index <AnIndex>. |
79 | -- Warning: Raises BadAccess if the index less than 1 or |
80 | -- greater than Size. |
81 | raises BadAccess from Aspect is static; |
82 | |
83 | Dump ( me ) ; |
84 | ---Level: Internal |
85 | |
86 | fields |
87 | mydata : SequenceOfWidthMapEntry from Aspect is protected; |
88 | |
89 | end WidthMap ; |