1 #include <ISession_Text.ixx>
2 #include <AIS_InteractiveObject.hxx>
3 #include <Prs3d_Text.hxx>
4 #include <Graphic2d_Text.hxx>
8 ISession_Text::ISession_Text()
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)
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)
28 void ISession_Text::Compute(const Handle(PrsMgr_PresentationManager3d)& ,const Handle(Prs3d_Presentation)& aPresentation,const Standard_Integer )
30 Prs3d_Text::Draw(aPresentation,myDrawer,MyText,gp_Pnt(MyX,MyY,MyZ));
33 void ISession_Text::Compute(const Handle(Prs3d_Projector)& ,const Handle(Prs3d_Presentation)& )
37 void ISession_Text::Compute(const Handle(PrsMgr_PresentationManager2d)& ,const Handle(Graphic2d_GraphicObject)& aGrObj,const Standard_Integer )
39 Handle(Graphic2d_Text) text;
40 text = new Graphic2d_Text(aGrObj, MyText, MyX, MyY, MyAngle, MyTypeOfText, MyScale);
41 text->SetFontIndex(MyFontIndex);
43 text->SetColorIndex(MyColorIndex);
45 text->SetSlant(MySlant);
46 text->SetUnderline(Standard_False);
47 text->SetZoomable(Standard_True);
49 Quantity_Length anXoffset,anYoffset;
50 text->TextSize(MyWidth, MyHeight,anXoffset,anYoffset);
53 void ISession_Text::ComputeSelection(const Handle(SelectMgr_Selection)& ,const Standard_Integer )