0022627: Change OCCT memory management defaults
[occt.git] / src / Aspect / Aspect_Grid.cxx
CommitLineData
7fd59977 1//
2// Updated: GG IMP230300 Add grid color parameters in constructor
3// and add new methods SetColors() & Colors()
4//
5
6#include <Aspect_Grid.ixx>
7
8
9Aspect_Grid::Aspect_Grid(
10 const Quantity_Length anXOrigin,
11 const Quantity_Length anYOrigin,
12 const Quantity_PlaneAngle anAngle,
13 const Quantity_Color& aColor,
14 const Quantity_Color& aTenthColor)
15: myRotationAngle(anAngle),
16 myXOrigin(anXOrigin),
17 myYOrigin(anYOrigin),
18 myColor(aColor),
19 myTenthColor(aTenthColor),
20 myIsActive(Standard_False),
21 myDrawMode(Aspect_GDM_Lines)
22{
23}
24
25
26void Aspect_Grid::SetXOrigin(const Quantity_Length anOrigin) {
27 myXOrigin = anOrigin;
28 Init();
29 UpdateDisplay();
30}
31
32void Aspect_Grid::SetYOrigin(const Quantity_Length anOrigin) {
33 myYOrigin = anOrigin;
34 Init();
35 UpdateDisplay();
36}
37
38void Aspect_Grid::SetRotationAngle(const Quantity_Length anAngle){
39
40
41 myRotationAngle = anAngle;
42 Init();
43 UpdateDisplay();
44}
45void Aspect_Grid::Rotate(const Quantity_PlaneAngle anAngle) {
46 myRotationAngle += anAngle;
47 Init();
48 UpdateDisplay();
49}
50void Aspect_Grid::Translate(const Quantity_Length aDx,
51 const Quantity_Length aDy) {
52 myXOrigin += aDx;
53 myYOrigin += aDy;
54 Init();
55 UpdateDisplay();
56}
57
58void Aspect_Grid::SetColors(const Quantity_Color& aColor,
59 const Quantity_Color& aTenthColor) {
60 myColor = aColor;
61 myTenthColor = aTenthColor;
62 UpdateDisplay();
63}
64
65void Aspect_Grid::Colors(Quantity_Color& aColor,
66 Quantity_Color& aTenthColor) const {
67 aColor = myColor;
68 aTenthColor = myTenthColor;
69}
70
71void Aspect_Grid::Hit(const Quantity_Length X,
72 const Quantity_Length Y,
73 Quantity_Length& gridX,
74 Quantity_Length& gridY) const {
75 if (myIsActive) {
76 Compute(X,Y,gridX,gridY);}
77 else{
78 gridX = X;
79 gridY = Y;
80 }
81 }
82void Aspect_Grid::Activate () {
83 myIsActive = Standard_True;
84}
85
86void Aspect_Grid::Deactivate () {
87 myIsActive = Standard_False;
88}
89
90Quantity_Length Aspect_Grid::XOrigin() const {
91 return myXOrigin;
92}
93
94Quantity_Length Aspect_Grid::YOrigin() const {
95 return myYOrigin;
96}
97
98Quantity_Length Aspect_Grid::RotationAngle() const {
99 return myRotationAngle;
100}
101
102Standard_Boolean Aspect_Grid::IsActive() const {
103 return myIsActive;
104}
105void Aspect_Grid::Display() {}
106
107void Aspect_Grid::Erase () const {}
108
109void Aspect_Grid::UpdateDisplay () {}
110
111
112Standard_Boolean Aspect_Grid::IsDisplayed() const {
113 return Standard_False;}
114
115void Aspect_Grid::SetDrawMode(const Aspect_GridDrawMode aDrawMode) {
116 myDrawMode = aDrawMode;
117 UpdateDisplay();
118}
119Aspect_GridDrawMode Aspect_Grid::DrawMode() const {
120 return myDrawMode;
121}