1 -- Created on: 1995-03-02
2 -- Created by: Jean-Louis Frenkel
3 -- Copyright (c) 1995-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
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
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 deferred class Grid from Aspect
18 inherits TShared from MMgt
21 PlaneAngle, Length from Quantity,
22 GridDrawMode from Aspect,
26 Initialize(anXOrigin: Length from Quantity = 0.0;
27 anYOrigin: Length from Quantity = 0.0;
28 aRotationAngle: PlaneAngle from Quantity = 0;
29 aColor: Color from Quantity = Quantity_NOC_GRAY50;
30 aTenthColor: Color from Quantity = Quantity_NOC_GRAY70);
32 ---Purpose: creates a new grid. By default this grid is not
35 ---Category: grid definition methods
37 SetXOrigin(me: mutable; anOrigin: Length from Quantity)
40 ---Purpose: defines the x Origin of the grid.
42 SetYOrigin(me: mutable; anOrigin: Length from Quantity)
45 ---Purpose: defines the y Origin of the grid.
47 SetRotationAngle(me: mutable; anAngle: PlaneAngle from Quantity)
50 ---Purpose: defines the orientation of the the grid.
52 Rotate(me: mutable; anAngle: PlaneAngle from Quantity)
55 ---Purpose: Rotate the grid from a relative angle.
57 Translate(me: mutable; aDx, aDy: Length from Quantity)
60 ---Purpose: Translate the grid from a relative distance.
62 SetColors ( me : mutable;
63 aColor : Color from Quantity;
64 aTenthColor : Color from Quantity )
67 ---Purpose: Change the colors of the grid
69 ---Category: Pick methods
71 Hit(me; X,Y: Length from Quantity; gridX, gridY : out Length from Quantity)
74 ---Purpose: returns the point of the grid the closest to the point X,Y
75 -- if the grid is active. If the grid is not active returns
78 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 ---Category: Managment methods.
87 ---Purpose: activates the grid. The Hit method will return
88 -- gridx and gridx computed according to the steps
91 Deactivate(me: mutable)
94 ---Purpose: deactivates the grid. The hit method will return
95 -- gridx and gridx as the enter value X & Y.
97 ---Category: inquire methods
99 XOrigin(me) returns Length from Quantity
102 ---Purpose: returns the x Origin of the grid.
104 YOrigin(me) returns Length from Quantity
107 ---Purpose: returns the x Origin of the grid.
110 RotationAngle(me) returns PlaneAngle from Quantity
113 ---Purpose: returns the x Angle of the grid.
116 IsActive(me) returns Boolean from Standard
119 ---Purpose: Returns TRUE when the grid is active.
121 Colors(me ; aColor,aTenthColor: out Color from Quantity)
124 ---Purpose: Returns the colors of the grid.
126 ---Category: display methods
128 SetDrawMode(me: mutable; aDrawMode: GridDrawMode from Aspect)
131 ---Purpose: Change the grid aspect.
133 DrawMode(me) returns GridDrawMode from Aspect
136 ---Purpose: Returns the grid aspect.
141 ---Purpose: Display the grid at screen.
146 ---Purpose: Erase the grid from screen.
149 returns Boolean from Standard
152 ---Purpose: Returns TRUE when the grid is displayed at screen.
154 UpdateDisplay(me: mutable)
155 is virtual protected;
157 ---Purpose: Updates the grid parameters.
166 myRotationAngle: PlaneAngle from Quantity is protected;
167 myXOrigin: Length from Quantity is protected;
168 myYOrigin: Length from Quantity is protected;
169 myColor: Color from Quantity is protected;
170 myTenthColor: Color from Quantity is protected;
171 myIsActive :Boolean from Standard;
172 myDrawMode: GridDrawMode from Aspect;
174 end Grid from Aspect;