1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
18 // Updated: GG IMP230300 Add grid color parameters in constructor
19 // and add new methods SetColors() & Colors()
21 #include <Aspect_Grid.ixx>
24 Aspect_Grid::Aspect_Grid(
25 const Quantity_Length anXOrigin,
26 const Quantity_Length anYOrigin,
27 const Quantity_PlaneAngle anAngle,
28 const Quantity_Color& aColor,
29 const Quantity_Color& aTenthColor)
30 : myRotationAngle(anAngle),
34 myTenthColor(aTenthColor),
35 myIsActive(Standard_False),
36 myDrawMode(Aspect_GDM_Lines)
41 void Aspect_Grid::SetXOrigin(const Quantity_Length anOrigin) {
47 void Aspect_Grid::SetYOrigin(const Quantity_Length anOrigin) {
53 void Aspect_Grid::SetRotationAngle(const Quantity_Length anAngle){
56 myRotationAngle = anAngle;
60 void Aspect_Grid::Rotate(const Quantity_PlaneAngle anAngle) {
61 myRotationAngle += anAngle;
65 void Aspect_Grid::Translate(const Quantity_Length aDx,
66 const Quantity_Length aDy) {
73 void Aspect_Grid::SetColors(const Quantity_Color& aColor,
74 const Quantity_Color& aTenthColor) {
76 myTenthColor = aTenthColor;
80 void Aspect_Grid::Colors(Quantity_Color& aColor,
81 Quantity_Color& aTenthColor) const {
83 aTenthColor = myTenthColor;
86 void Aspect_Grid::Hit(const Quantity_Length X,
87 const Quantity_Length Y,
88 Quantity_Length& gridX,
89 Quantity_Length& gridY) const {
91 Compute(X,Y,gridX,gridY);}
97 void Aspect_Grid::Activate () {
98 myIsActive = Standard_True;
101 void Aspect_Grid::Deactivate () {
102 myIsActive = Standard_False;
105 Quantity_Length Aspect_Grid::XOrigin() const {
109 Quantity_Length Aspect_Grid::YOrigin() const {
113 Quantity_Length Aspect_Grid::RotationAngle() const {
114 return myRotationAngle;
117 Standard_Boolean Aspect_Grid::IsActive() const {
120 void Aspect_Grid::Display() {}
122 void Aspect_Grid::Erase () const {}
124 void Aspect_Grid::UpdateDisplay () {}
127 Standard_Boolean Aspect_Grid::IsDisplayed() const {
128 return Standard_False;}
130 void Aspect_Grid::SetDrawMode(const Aspect_GridDrawMode aDrawMode) {
131 myDrawMode = aDrawMode;
134 Aspect_GridDrawMode Aspect_Grid::DrawMode() const {