1 // Created on: 1994-11-17
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
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 #include <TestTopOpeDraw_DrawableP2D.hxx>
25 IMPLEMENT_STANDARD_RTTIEXT(TestTopOpeDraw_DrawableP2D,Draw_Marker2D)
27 //=======================================================================
28 //function : TestTopOpeDraw_DrawableP2D
30 //=======================================================================
31 TestTopOpeDraw_DrawableP2D::TestTopOpeDraw_DrawableP2D
33 const Draw_Color& PColor,
34 const Standard_Real MoveX,
35 const Standard_Real MoveY) :
36 Draw_Marker2D(P,Draw_Square,PColor,2), // Size
43 myText2D = new Draw_Text2D(myPnt2d,myText,myTextColor,(Standard_Integer)myMoveX,(Standard_Integer)myMoveY);
46 //=======================================================================
47 //function : TestTopOpeDraw_DrawableP2D
49 //=======================================================================
51 TestTopOpeDraw_DrawableP2D::TestTopOpeDraw_DrawableP2D
52 (const gp_Pnt2d& P,const Draw_Color& PColor,
53 const Standard_CString Text,const Draw_Color& TextColor,
54 const Standard_Real MoveX,
55 const Standard_Real MoveY) :
56 Draw_Marker2D(P,Draw_Square,PColor,2), // Size
59 myTextColor(TextColor),
63 myText2D = new Draw_Text2D(myPnt2d,myText,myTextColor,(Standard_Integer)myMoveX,(Standard_Integer)myMoveY);
66 //=======================================================================
67 //function : TestTopOpeDraw_DrawableP2D
69 //=======================================================================
71 TestTopOpeDraw_DrawableP2D::TestTopOpeDraw_DrawableP2D
72 (const gp_Pnt2d& P,const Draw_MarkerShape T,const Draw_Color& PColor,
73 const Standard_CString Text,const Draw_Color& TextColor,
74 const Standard_Integer Size,
75 const Standard_Real MoveX,
76 const Standard_Real MoveY) :
77 Draw_Marker2D(P,T,PColor,Size),
80 myTextColor(TextColor),
84 myText2D = new Draw_Text2D(myPnt2d,myText,myTextColor,(Standard_Integer)myMoveX,(Standard_Integer)myMoveY);
87 //=======================================================================
88 //function : TestTopOpeDraw_DrawableP2D
90 //=======================================================================
92 TestTopOpeDraw_DrawableP2D::TestTopOpeDraw_DrawableP2D
93 (const gp_Pnt2d& P,const Draw_MarkerShape T,
94 const Draw_Color& PColor,const Standard_CString Text,
95 const Draw_Color& TextColor,const Standard_Real Tol,
96 const Standard_Real MoveX,const Standard_Real MoveY) :
97 Draw_Marker2D(P,T,PColor,Tol),
100 myTextColor(TextColor),
104 myText2D = new Draw_Text2D(myPnt2d,myText,myTextColor,(Standard_Integer)myMoveX,(Standard_Integer)myMoveY);
107 //=======================================================================
108 //function : ChangePnt2d
110 //=======================================================================
112 void TestTopOpeDraw_DrawableP2D::ChangePnt2d(const gp_Pnt2d& P)
115 myText2D = new Draw_Text2D(myPnt2d,myText,myTextColor,(Standard_Integer)myMoveX,(Standard_Integer)myMoveY);
119 //=======================================================================
122 //=======================================================================
124 void TestTopOpeDraw_DrawableP2D::DrawOn(Draw_Display& dis) const
126 Draw_Marker2D::DrawOn(dis);
127 myText2D->DrawOn(dis);