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
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.
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.
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.
22 class RectangularGrid from Aspect
23 inherits Grid from Aspect
26 PlaneAngle, Length from Quantity
29 NegativeValue,NullValue,NumericError from Standard
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
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.
48 ---Category: grid definition methods
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.
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.
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.
73 SetGridValues(me: mutable; XOrigin, YOrigin: Length from Quantity;
74 XStep, YStep: Length from Quantity;
75 RotationAngle: PlaneAngle from Quantity)
78 ---Category: Pick methods
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
86 ---Category: inquire methods
88 XStep(me) returns Length from Quantity
89 ---Purpose: returns the x step of the grid.
92 YStep(me) returns Length from Quantity
93 ---Purpose: returns the x step of the grid.
96 FirstAngle(me) returns PlaneAngle from Quantity
97 ---Purpose: returns the x Angle of the grid, relatively to the horizontal.
100 SecondAngle(me) returns PlaneAngle from Quantity
101 ---Purpose: returns the y Angle of the grid, relatively to the vertical.
107 ---Category: private methods.
113 CheckAngle(me;alpha,beta: PlaneAngle from Quantity)
114 returns Boolean from Standard
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;
127 end RectangularGrid from Aspect;