Integration of OCCT 6.5.0 from SVN
[occt.git] / samples / java / src / ISession / ISession_Text.cxx
1 #include <ISession_Text.ixx>
2 #include <AIS_InteractiveObject.hxx>
3 #include <Prs3d_Text.hxx>
4 #include <Graphic2d_Text.hxx>
5
6
7
8 ISession_Text::ISession_Text()
9 {
10 }
11
12 ISession_Text::ISession_Text(const TCollection_AsciiString& aText,const Standard_Real anX,const Standard_Real anY,const Standard_Real aZ,const Aspect_TypeOfText aType,const Quantity_PlaneAngle anAngle,const Standard_Real aSlant,const Standard_Integer aColorIndex,const Standard_Integer aFontIndex,const Quantity_Factor aScale)
13      : AIS_InteractiveObject(),MyText(aText),MyX(anX),MyY(anY),MyZ(aZ),
14        MyTypeOfText(aType),MyAngle(anAngle),MySlant(aSlant),
15        MyColorIndex(aColorIndex),MyFontIndex(aFontIndex),
16        MyScale(aScale),MyWidth(0),MyHeight(0)
17 {
18 }
19
20 ISession_Text::ISession_Text(const TCollection_AsciiString& aText,const gp_Pnt& aPoint,const Aspect_TypeOfText aType,const Quantity_PlaneAngle anAngle,const Standard_Real aSlant,const Standard_Integer aColorIndex,const Standard_Integer aFontIndex,const Quantity_Factor aScale)
21      :AIS_InteractiveObject(),MyText(aText),MyX(aPoint.X()),MyY(aPoint.Y()),MyZ(aPoint.Z()),
22        MyTypeOfText(aType),MyAngle(anAngle),MySlant(aSlant),
23        MyColorIndex(aColorIndex),MyFontIndex(aFontIndex),
24        MyScale(aScale),MyWidth(0),MyHeight(0)
25 {
26 }
27
28  void ISession_Text::Compute(const Handle(PrsMgr_PresentationManager3d)& ,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer ) 
29 {
30   Prs3d_Text::Draw(aPresentation,myDrawer,MyText,gp_Pnt(MyX,MyY,MyZ));
31 }
32
33  void ISession_Text::Compute(const Handle(Prs3d_Projector)& ,const Handle(Prs3d_Presentation)& ) 
34 {
35 }
36
37  void ISession_Text::Compute(const Handle(PrsMgr_PresentationManager2d)& ,const Handle(Graphic2d_GraphicObject)& aGrObj,const Standard_Integer ) 
38 {
39   Handle(Graphic2d_Text) text;
40   text = new Graphic2d_Text(aGrObj, MyText, MyX, MyY, MyAngle, MyTypeOfText, MyScale);
41   text->SetFontIndex(MyFontIndex);
42  
43   text->SetColorIndex(MyColorIndex);
44  
45   text->SetSlant(MySlant);
46   text->SetUnderline(Standard_False);
47   text->SetZoomable(Standard_True);
48   aGrObj->Display();
49   Quantity_Length anXoffset,anYoffset;
50   text->TextSize(MyWidth, MyHeight,anXoffset,anYoffset);
51 }
52
53  void ISession_Text::ComputeSelection(const Handle(SelectMgr_Selection)& ,const Standard_Integer ) 
54 {
55 }
56