1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
// File: Draw_Axis2D.cxx
// Created: Wed Apr 29 15:24:18 1992
// Author: Remi LEQUETTE
// <rle@sdsun1>
#include <Draw_Axis2D.ixx>
#include <gp_Vec2d.hxx>
#include <gp.hxx>
extern Standard_Boolean Draw_Bounds;
//=======================================================================
//function : Draw_Axis2D
//purpose :
//=======================================================================
Draw_Axis2D::Draw_Axis2D (const Draw_Color& col,
const Standard_Integer Size) :
myAxes(gp_Pnt2d(0,0),gp_Dir2d(1,0)),myColor(col), mySize(Size)
{
}
//=======================================================================
//function : Draw_Axis2D
//purpose :
//=======================================================================
Draw_Axis2D::Draw_Axis2D (const gp_Pnt2d& p,
const Draw_Color& col,
const Standard_Integer Size) :
myAxes(p,gp_Dir2d(1,0)), myColor(col), mySize(Size)
{
}
//=======================================================================
//function : Draw_Axis2D
//purpose :
//=======================================================================
Draw_Axis2D::Draw_Axis2D (const gp_Ax22d& a,
const Draw_Color& col,
const Standard_Integer Size) :
myAxes(a), myColor(col), mySize(Size)
{
}
//=======================================================================
//function : DrawOn
//purpose :
//=======================================================================
void Draw_Axis2D::DrawOn (Draw_Display& dis) const
{
Draw_Bounds = Standard_False;
dis.SetColor(myColor);
Standard_Real z = dis.Zoom();
z = (Standard_Real)mySize / z;
gp_Pnt2d P,P0 = myAxes.Location();
P = P0.Translated(gp_Vec2d(myAxes.XDirection()) * z);
dis.Draw(P0,P);
dis.DrawString(P,"X");
P = P0.Translated(gp_Vec2d(myAxes.YDirection()) * z);
dis.Draw(P0,P);
dis.DrawString(P,"Y");
Draw_Bounds = Standard_True;
}
|