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.
21 -- Updated: GG IMP230300 Add grid color parameters in constructor
22 -- and add new methods SetColors() & Colors()
24 deferred class Grid from Aspect
25 inherits TShared from MMgt
28 PlaneAngle, Length from Quantity,
29 GridDrawMode from Aspect,
33 Initialize(anXOrigin: Length from Quantity = 0.0;
34 anYOrigin: Length from Quantity = 0.0;
35 aRotationAngle: PlaneAngle from Quantity = 0;
36 aColor: Color from Quantity = Quantity_NOC_GRAY50;
37 aTenthColor: Color from Quantity = Quantity_NOC_GRAY70);
39 ---Purpose: creates a new grid. By default this grid is not
42 ---Category: grid definition methods
44 SetXOrigin(me: mutable; anOrigin: Length from Quantity)
47 ---Purpose: defines the x Origin of the grid.
49 SetYOrigin(me: mutable; anOrigin: Length from Quantity)
52 ---Purpose: defines the y Origin of the grid.
54 SetRotationAngle(me: mutable; anAngle: PlaneAngle from Quantity)
57 ---Purpose: defines the orientation of the the grid.
59 Rotate(me: mutable; anAngle: PlaneAngle from Quantity)
62 ---Purpose: Rotate the grid from a relative angle.
64 Translate(me: mutable; aDx, aDy: Length from Quantity)
67 ---Purpose: Translate the grid from a relative distance.
69 SetColors ( me : mutable;
70 aColor : Color from Quantity;
71 aTenthColor : Color from Quantity )
74 ---Purpose: Change the colors of the grid
76 ---Category: Pick methods
78 Hit(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 -- if the grid is active. If the grid is not active returns
85 Compute(me; X,Y: Length from Quantity; gridX, gridY : out Length from Quantity)
88 ---Purpose: returns the point of the grid the closest to the point X,Y
89 ---Category: Managment methods.
94 ---Purpose: activates the grid. The Hit method will return
95 -- gridx and gridx computed according to the steps
98 Deactivate(me: mutable)
101 ---Purpose: deactivates the grid. The hit method will return
102 -- gridx and gridx as the enter value X & Y.
104 ---Category: inquire methods
106 XOrigin(me) returns Length from Quantity
109 ---Purpose: returns the x Origin of the grid.
111 YOrigin(me) returns Length from Quantity
114 ---Purpose: returns the x Origin of the grid.
117 RotationAngle(me) returns PlaneAngle from Quantity
120 ---Purpose: returns the x Angle of the grid.
123 IsActive(me) returns Boolean from Standard
126 ---Purpose: Returns TRUE when the grid is active.
128 Colors(me ; aColor,aTenthColor: out Color from Quantity)
131 ---Purpose: Returns the colors of the grid.
133 ---Category: display methods
135 SetDrawMode(me: mutable; aDrawMode: GridDrawMode from Aspect)
138 ---Purpose: Change the grid aspect.
140 DrawMode(me) returns GridDrawMode from Aspect
143 ---Purpose: Returns the grid aspect.
148 ---Purpose: Display the grid at screen.
153 ---Purpose: Erase the grid from screen.
156 returns Boolean from Standard
159 ---Purpose: Returns TRUE when the grid is displayed at screen.
161 UpdateDisplay(me: mutable)
162 is virtual protected;
164 ---Purpose: Updates the grid parameters.
173 myRotationAngle: PlaneAngle from Quantity is protected;
174 myXOrigin: Length from Quantity is protected;
175 myYOrigin: Length from Quantity is protected;
176 myColor: Color from Quantity is protected;
177 myTenthColor: Color from Quantity is protected;
178 myIsActive :Boolean from Standard;
179 myDrawMode: GridDrawMode from Aspect;
181 end Grid from Aspect;