1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 // Updated: GG IMP230300 Add grid color parameters in constructor
15 // and add new methods SetColors() & Colors()
17 #include <Aspect_Grid.ixx>
20 Aspect_Grid::Aspect_Grid(
21 const Quantity_Length anXOrigin,
22 const Quantity_Length anYOrigin,
23 const Quantity_PlaneAngle anAngle,
24 const Quantity_Color& aColor,
25 const Quantity_Color& aTenthColor)
26 : myRotationAngle(anAngle),
30 myTenthColor(aTenthColor),
31 myIsActive(Standard_False),
32 myDrawMode(Aspect_GDM_Lines)
37 void Aspect_Grid::SetXOrigin(const Quantity_Length anOrigin) {
43 void Aspect_Grid::SetYOrigin(const Quantity_Length anOrigin) {
49 void Aspect_Grid::SetRotationAngle(const Quantity_Length anAngle){
52 myRotationAngle = anAngle;
56 void Aspect_Grid::Rotate(const Quantity_PlaneAngle anAngle) {
57 myRotationAngle += anAngle;
61 void Aspect_Grid::Translate(const Quantity_Length aDx,
62 const Quantity_Length aDy) {
69 void Aspect_Grid::SetColors(const Quantity_Color& aColor,
70 const Quantity_Color& aTenthColor) {
72 myTenthColor = aTenthColor;
76 void Aspect_Grid::Colors(Quantity_Color& aColor,
77 Quantity_Color& aTenthColor) const {
79 aTenthColor = myTenthColor;
82 void Aspect_Grid::Hit(const Quantity_Length X,
83 const Quantity_Length Y,
84 Quantity_Length& gridX,
85 Quantity_Length& gridY) const {
87 Compute(X,Y,gridX,gridY);}
93 void Aspect_Grid::Activate () {
94 myIsActive = Standard_True;
97 void Aspect_Grid::Deactivate () {
98 myIsActive = Standard_False;
101 Quantity_Length Aspect_Grid::XOrigin() const {
105 Quantity_Length Aspect_Grid::YOrigin() const {
109 Quantity_Length Aspect_Grid::RotationAngle() const {
110 return myRotationAngle;
113 Standard_Boolean Aspect_Grid::IsActive() const {
116 void Aspect_Grid::Display() {}
118 void Aspect_Grid::Erase () const {}
120 void Aspect_Grid::UpdateDisplay () {}
123 Standard_Boolean Aspect_Grid::IsDisplayed() const {
124 return Standard_False;}
126 void Aspect_Grid::SetDrawMode(const Aspect_GridDrawMode aDrawMode) {
127 myDrawMode = aDrawMode;
130 Aspect_GridDrawMode Aspect_Grid::DrawMode() const {