1 // File: Draw_Axis3D.cxx
2 // Created: Wed Apr 29 15:24:18 1992
3 // Author: Remi LEQUETTE
6 #include <Draw_Axis3D.ixx>
10 extern Standard_Boolean Draw_Bounds;
13 //=======================================================================
14 //function : Draw_Axis3D
16 //=======================================================================
18 Draw_Axis3D::Draw_Axis3D (const Draw_Color& col,
19 const Standard_Integer Size) :
20 myAxes(gp::XOY()),myColor(col), mySize(Size)
24 //=======================================================================
25 //function : Draw_Axis3D
27 //=======================================================================
29 Draw_Axis3D::Draw_Axis3D (const gp_Pnt& p,
30 const Draw_Color& col,
31 const Standard_Integer Size) :
32 myAxes(p,gp::DZ(),gp::DX()), myColor(col), mySize(Size)
36 //=======================================================================
37 //function : Draw_Axis3D
39 //=======================================================================
41 Draw_Axis3D::Draw_Axis3D (const gp_Ax3& a,
42 const Draw_Color& col,
43 const Standard_Integer Size) :
44 myAxes(a), myColor(col), mySize(Size)
48 //=======================================================================
51 //=======================================================================
53 void Draw_Axis3D::DrawOn (Draw_Display& dis) const
55 Draw_Bounds = Standard_False;
56 dis.SetColor(myColor);
57 Standard_Real z = dis.Zoom();
58 z = (Standard_Real)mySize / z;
59 gp_Pnt P,P0 = myAxes.Location();
60 P = P0.Translated(gp_Vec(myAxes.XDirection()) * z);
62 dis.DrawString(P,"X");
63 P = P0.Translated(gp_Vec(myAxes.YDirection()) * z);
65 dis.DrawString(P,"Y");
66 P = P0.Translated(gp_Vec(myAxes.Direction()) * z);
68 dis.DrawString(P,"Z");
69 Draw_Bounds = Standard_True;