b311480e |
1 | // Created on: 1994-11-17 |
2 | // Created by: Jean Yves LEBEY |
3 | // Copyright (c) 1994-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
42cf5bc1 |
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 | #include <TestTopOpeDraw_DrawableP2D.hxx> |
7fd59977 |
24 | |
92efcf78 |
25 | IMPLEMENT_STANDARD_RTTIEXT(TestTopOpeDraw_DrawableP2D,Draw_Marker2D) |
26 | |
7fd59977 |
27 | //======================================================================= |
28 | //function : TestTopOpeDraw_DrawableP2D |
29 | //purpose : |
30 | //======================================================================= |
7fd59977 |
31 | TestTopOpeDraw_DrawableP2D::TestTopOpeDraw_DrawableP2D |
32 | (const gp_Pnt2d& P, |
33 | const Draw_Color& PColor, |
34 | const Standard_Real MoveX, |
35 | const Standard_Real MoveY) : |
36 | Draw_Marker2D(P,Draw_Square,PColor,2), // Size |
37 | myPnt2d(P), |
38 | myText(" "), |
39 | myTextColor(PColor), |
40 | myMoveX(MoveX), |
41 | myMoveY(MoveY) |
42 | { |
43 | myText2D = new Draw_Text2D(myPnt2d,myText,myTextColor,(Standard_Integer)myMoveX,(Standard_Integer)myMoveY); |
44 | } |
45 | |
46 | //======================================================================= |
47 | //function : TestTopOpeDraw_DrawableP2D |
48 | //purpose : |
49 | //======================================================================= |
50 | |
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 |
57 | myPnt2d(P), |
58 | myText(Text), |
59 | myTextColor(TextColor), |
60 | myMoveX(MoveX), |
61 | myMoveY(MoveY) |
62 | { |
63 | myText2D = new Draw_Text2D(myPnt2d,myText,myTextColor,(Standard_Integer)myMoveX,(Standard_Integer)myMoveY); |
64 | } |
65 | |
66 | //======================================================================= |
67 | //function : TestTopOpeDraw_DrawableP2D |
68 | //purpose : |
69 | //======================================================================= |
70 | |
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), |
78 | myPnt2d(P), |
79 | myText(Text), |
80 | myTextColor(TextColor), |
81 | myMoveX(MoveX), |
82 | myMoveY(MoveY) |
83 | { |
84 | myText2D = new Draw_Text2D(myPnt2d,myText,myTextColor,(Standard_Integer)myMoveX,(Standard_Integer)myMoveY); |
85 | } |
86 | |
87 | //======================================================================= |
88 | //function : TestTopOpeDraw_DrawableP2D |
89 | //purpose : |
90 | //======================================================================= |
91 | |
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), |
98 | myPnt2d(P), |
99 | myText(Text), |
100 | myTextColor(TextColor), |
101 | myMoveX(MoveX), |
102 | myMoveY(MoveY) |
103 | { |
104 | myText2D = new Draw_Text2D(myPnt2d,myText,myTextColor,(Standard_Integer)myMoveX,(Standard_Integer)myMoveY); |
105 | } |
106 | |
107 | //======================================================================= |
108 | //function : ChangePnt2d |
109 | //purpose : |
110 | //======================================================================= |
111 | |
112 | void TestTopOpeDraw_DrawableP2D::ChangePnt2d(const gp_Pnt2d& P) |
113 | { |
114 | myPnt2d = P; |
115 | myText2D = new Draw_Text2D(myPnt2d,myText,myTextColor,(Standard_Integer)myMoveX,(Standard_Integer)myMoveY); |
116 | ChangePos() = P; |
117 | } |
118 | |
119 | //======================================================================= |
120 | //function : DrawOn |
121 | //purpose : |
122 | //======================================================================= |
123 | |
124 | void TestTopOpeDraw_DrawableP2D::DrawOn(Draw_Display& dis) const |
125 | { |
126 | Draw_Marker2D::DrawOn(dis); |
127 | myText2D->DrawOn(dis); |
128 | } |