0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / Draw / Draw_Text2D.cxx
1 // Created on: 1992-04-29
2 // Created by: Remi LEQUETTE
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17
18 #include <Draw_Color.hxx>
19 #include <Draw_Display.hxx>
20 #include <Draw_Text2D.hxx>
21 #include <gp_Pnt2d.hxx>
22 #include <Standard_Type.hxx>
23
24 IMPLEMENT_STANDARD_RTTIEXT(Draw_Text2D,Draw_Drawable2D)
25
26 //=======================================================================
27 //function : Draw_Text2D
28 //purpose  : 
29 //=======================================================================
30 Draw_Text2D::Draw_Text2D(const gp_Pnt2d& p, const Standard_CString T, 
31                          const Draw_Color& col) :
32        myPoint(p), myColor(col), myText(T), mymoveX(0), mymoveY(0)
33 {
34 }
35
36 //=======================================================================
37 //function : Draw_Text2D
38 //purpose  : 
39 //=======================================================================
40
41 Draw_Text2D::Draw_Text2D(const gp_Pnt2d& p, const Standard_CString T, 
42                          const Draw_Color& col, const Standard_Integer moveX, const Standard_Integer moveY) :
43        myPoint(p), myColor(col), myText(T), mymoveX(moveX), mymoveY(moveY)
44 {
45 }
46
47 //=======================================================================
48 //function : SetPnt2d
49 //purpose  : 
50 //=======================================================================
51
52 void Draw_Text2D::SetPnt2d(const gp_Pnt2d& p)
53 {
54   myPoint = p;
55 }
56
57 //=======================================================================
58 //function : DrawOn
59 //purpose  : 
60 //=======================================================================
61
62 void Draw_Text2D::DrawOn(Draw_Display& dis) const
63 {
64   dis.SetColor(myColor);
65   dis.DrawString(myPoint,myText.ToCString(),
66                  (Standard_Real)mymoveX, (Standard_Real)mymoveY);
67 }