blob: 0d1a6c32ddd47ab685238869aa31843d89bbca99 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
// File: StdSelect_TextProjector2d.cxx
// Created: Fri Apr 21 17:17:45 1995
// Author: Robert COUBLANC
// <rob@fidox>
#include <StdSelect_TextProjector2d.ixx>
#include <Aspect_WindowDriver.hxx>
//==================================================
// Function:
// Purpose :
//==================================================
StdSelect_TextProjector2d::
StdSelect_TextProjector2d(const Handle(V2d_View)& aView):
myview(aView)
{
}
//==================================================
// Function:
// Purpose :
//==================================================
void StdSelect_TextProjector2d::
Convert(const gp_Pnt2d& aPointIn, gp_Pnt2d& aPointOut) const
{
aPointOut = aPointIn.Transformed(mytrsf);
}
//==================================================
// Function:
// Purpose :
//==================================================
void StdSelect_TextProjector2d
::Convert(const TCollection_ExtendedString& aText,
const Standard_Real XPos,
const Standard_Real YPos,
gp_Pnt2d& MinPoint,
gp_Pnt2d& MaxPoint,
const Standard_Integer afont) const
{
Standard_ShortReal myL,myH;
MinPoint = gp_Pnt2d(XPos,YPos).Transformed(mytrsf);
myview->Driver()->TextSize(aText,myL,myH,afont);
Standard_Real myWinL=myview->Convert(myL);
Standard_Real myWinH=myview->Convert(myH);
MaxPoint.SetCoord(XPos+myWinL,YPos+myWinH);
MaxPoint.Transform(mytrsf);
}
|