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
9 -- under the terms of the GNU Lesser General Public 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 -- Updated: GG IMP230300 Add grid color parameters in constructor
18 -- and add new methods SetColors() & Colors()
20 deferred class Grid from Aspect
21 inherits TShared from MMgt
24 PlaneAngle, Length from Quantity,
25 GridDrawMode from Aspect,
29 Initialize(anXOrigin: Length from Quantity = 0.0;
30 anYOrigin: Length from Quantity = 0.0;
31 aRotationAngle: PlaneAngle from Quantity = 0;
32 aColor: Color from Quantity = Quantity_NOC_GRAY50;
33 aTenthColor: Color from Quantity = Quantity_NOC_GRAY70);
35 ---Purpose: creates a new grid. By default this grid is not
38 ---Category: grid definition methods
40 SetXOrigin(me: mutable; anOrigin: Length from Quantity)
43 ---Purpose: defines the x Origin of the grid.
45 SetYOrigin(me: mutable; anOrigin: Length from Quantity)
48 ---Purpose: defines the y Origin of the grid.
50 SetRotationAngle(me: mutable; anAngle: PlaneAngle from Quantity)
53 ---Purpose: defines the orientation of the the grid.
55 Rotate(me: mutable; anAngle: PlaneAngle from Quantity)
58 ---Purpose: Rotate the grid from a relative angle.
60 Translate(me: mutable; aDx, aDy: Length from Quantity)
63 ---Purpose: Translate the grid from a relative distance.
65 SetColors ( me : mutable;
66 aColor : Color from Quantity;
67 aTenthColor : Color from Quantity )
70 ---Purpose: Change the colors of the grid
72 ---Category: Pick methods
74 Hit(me; X,Y: Length from Quantity; gridX, gridY : out Length from Quantity)
77 ---Purpose: returns the point of the grid the closest to the point X,Y
78 -- if the grid is active. If the grid is not active returns
81 Compute(me; X,Y: Length from Quantity; gridX, gridY : out Length from Quantity)
84 ---Purpose: returns the point of the grid the closest to the point X,Y
85 ---Category: Managment methods.
90 ---Purpose: activates the grid. The Hit method will return
91 -- gridx and gridx computed according to the steps
94 Deactivate(me: mutable)
97 ---Purpose: deactivates the grid. The hit method will return
98 -- gridx and gridx as the enter value X & Y.
100 ---Category: inquire methods
102 XOrigin(me) returns Length from Quantity
105 ---Purpose: returns the x Origin of the grid.
107 YOrigin(me) returns Length from Quantity
110 ---Purpose: returns the x Origin of the grid.
113 RotationAngle(me) returns PlaneAngle from Quantity
116 ---Purpose: returns the x Angle of the grid.
119 IsActive(me) returns Boolean from Standard
122 ---Purpose: Returns TRUE when the grid is active.
124 Colors(me ; aColor,aTenthColor: out Color from Quantity)
127 ---Purpose: Returns the colors of the grid.
129 ---Category: display methods
131 SetDrawMode(me: mutable; aDrawMode: GridDrawMode from Aspect)
134 ---Purpose: Change the grid aspect.
136 DrawMode(me) returns GridDrawMode from Aspect
139 ---Purpose: Returns the grid aspect.
144 ---Purpose: Display the grid at screen.
149 ---Purpose: Erase the grid from screen.
152 returns Boolean from Standard
155 ---Purpose: Returns TRUE when the grid is displayed at screen.
157 UpdateDisplay(me: mutable)
158 is virtual protected;
160 ---Purpose: Updates the grid parameters.
169 myRotationAngle: PlaneAngle from Quantity is protected;
170 myXOrigin: Length from Quantity is protected;
171 myYOrigin: Length from Quantity is protected;
172 myColor: Color from Quantity is protected;
173 myTenthColor: Color from Quantity is protected;
174 myIsActive :Boolean from Standard;
175 myDrawMode: GridDrawMode from Aspect;
177 end Grid from Aspect;