b311480e |
1 | -- Created on: 1995-03-02 |
2 | -- Created by: Jean-Louis Frenkel |
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 | |
22 | class RectangularGrid from Aspect |
23 | inherits Grid from Aspect |
24 | |
25 | uses |
26 | PlaneAngle, Length from Quantity |
27 | |
28 | raises |
29 | NegativeValue,NullValue,NumericError from Standard |
30 | |
31 | is |
32 | |
33 | Create(aXStep, aYStep: Length from Quantity; |
34 | anXOrigin: Length from Quantity = 0; |
35 | anYOrigin: Length from Quantity = 0; |
36 | aFirstAngle: PlaneAngle from Quantity = 0; |
37 | aSecondAngle: PlaneAngle from Quantity = 0; |
38 | aRotationAngle: PlaneAngle from Quantity = 0) |
39 | returns mutable RectangularGrid from Aspect |
40 | ---Purpose: creates a new grid. By default this grid is not |
41 | -- active. |
42 | -- The first angle is given relatively to the horizontal. |
43 | -- The second angle is given relatively to the vertical. |
44 | raises NumericError from Standard; |
45 | ---Warning: raises NumericError from Standard if the two |
46 | -- networks are parallel. |
47 | |
48 | ---Category: grid definition methods |
49 | |
50 | |
51 | SetXStep(me: mutable; aStep: Length from Quantity) |
52 | ---Purpose: defines the x step of the grid. |
53 | raises NegativeValue,NullValue from Standard |
54 | ---Warning: raises an exception is the step is not strictly positive. |
55 | is static; |
56 | |
57 | SetYStep(me: mutable; aStep: Length from Quantity) |
58 | ---Purpose: defines the y step of the grid. |
59 | raises NegativeValue,NullValue from Standard |
60 | ---Warning: raises an exception is the step is not strictly positive. |
61 | is static; |
62 | |
63 | SetAngle(me: mutable; anAngle1: PlaneAngle from Quantity; |
64 | anAngle2: PlaneAngle from Quantity) |
65 | ---Purpose: defines the angle of the second network |
66 | -- the fist angle is given relatively to the horizontal. |
67 | -- the second angle is given relatively to the vertical. |
68 | raises NumericError from Standard |
69 | ---Warning: raises NumericError from Standard if the two |
70 | -- line networks are parallel. |
71 | is static; |
72 | |
73 | SetGridValues(me: mutable; XOrigin, YOrigin: Length from Quantity; |
74 | XStep, YStep: Length from Quantity; |
75 | RotationAngle: PlaneAngle from Quantity) |
76 | is static; |
77 | |
78 | ---Category: Pick methods |
79 | -- |
80 | Compute(me; X,Y: Length from Quantity; gridX, gridY : out Length from Quantity) |
81 | ---Purpose: returns the point of the grid the closest to the point X,Y |
82 | is static; |
83 | |
84 | |
85 | |
86 | ---Category: inquire methods |
87 | |
88 | XStep(me) returns Length from Quantity |
89 | ---Purpose: returns the x step of the grid. |
90 | is static; |
91 | |
92 | YStep(me) returns Length from Quantity |
93 | ---Purpose: returns the x step of the grid. |
94 | is static; |
95 | |
96 | FirstAngle(me) returns PlaneAngle from Quantity |
97 | ---Purpose: returns the x Angle of the grid, relatively to the horizontal. |
98 | is static; |
99 | |
100 | SecondAngle(me) returns PlaneAngle from Quantity |
101 | ---Purpose: returns the y Angle of the grid, relatively to the vertical. |
102 | is static; |
103 | |
104 | |
105 | |
106 | |
107 | ---Category: private methods. |
108 | |
109 | |
110 | Init(me: mutable) |
111 | is redefined static; |
112 | |
113 | CheckAngle(me;alpha,beta: PlaneAngle from Quantity) |
114 | returns Boolean from Standard |
115 | is static private; |
116 | |
117 | fields |
118 | |
119 | myXStep: Length from Quantity; |
120 | myYStep: Length from Quantity; |
121 | myFirstAngle: PlaneAngle from Quantity; |
122 | mySecondAngle: PlaneAngle from Quantity; |
123 | a1,b1,c1: Real from Standard; |
124 | a2,b2,c2: Real from Standard; |
125 | |
126 | |
127 | end RectangularGrid from Aspect; |