Integration of OCCT 6.5.0 from SVN
[occt.git] / src / Draw / Draw_Text2D.cxx
1 // File:        Draw_Text2D.cxx
2 // Created:     Wed Apr 29 15:37:27 1992
3 // Author:      Remi LEQUETTE
4 //              <rle@sdsun1>
5
6
7 #include <Draw_Text2D.ixx>
8
9
10 //=======================================================================
11 //function : Draw_Text2D
12 //purpose  : 
13 //=======================================================================
14
15 Draw_Text2D::Draw_Text2D(const gp_Pnt2d& p, const Standard_CString T, 
16                          const Draw_Color& col) :
17        myPoint(p), myColor(col), myText(T), mymoveX(0), mymoveY(0)
18 {
19 }
20
21 //=======================================================================
22 //function : Draw_Text2D
23 //purpose  : 
24 //=======================================================================
25
26 Draw_Text2D::Draw_Text2D(const gp_Pnt2d& p, const Standard_CString T, 
27                          const Draw_Color& col, const Standard_Integer moveX, const Standard_Integer moveY) :
28        myPoint(p), myColor(col), myText(T), mymoveX(moveX), mymoveY(moveY)
29 {
30 }
31
32 //=======================================================================
33 //function : SetPnt2d
34 //purpose  : 
35 //=======================================================================
36
37 void Draw_Text2D::SetPnt2d(const gp_Pnt2d& p)
38 {
39   myPoint = p;
40 }
41
42 //=======================================================================
43 //function : DrawOn
44 //purpose  : 
45 //=======================================================================
46
47 void Draw_Text2D::DrawOn(Draw_Display& dis) const
48 {
49   dis.SetColor(myColor);
50   dis.DrawString(myPoint,myText.ToCString(),
51                  (Standard_Real)mymoveX, (Standard_Real)mymoveY);
52 }