1 // Created on: 2002-04-10
2 // Created by: QA Admin
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <QABugs_MyText.ixx>
17 #include <QABugs_MyText.hxx>
18 #include <Prs3d_Presentation.hxx>
19 #include <Prs3d_TextAspect.hxx>
20 #include <AIS_Drawer.hxx>
21 #include <SelectMgr_EntityOwner.hxx>
22 #include <Prs3d_Text.hxx>
23 #include <Select3D_SensitiveBox.hxx>
24 #include <SelectMgr_Selection.hxx>
25 #include <Font_NameOfFont.hxx>
27 /*************************************************************************
29 * CONSTRUCTION/DESTRUCTION
31 **************************************************************************/
34 QABugs_MyText::QABugs_MyText(const TCollection_ExtendedString& aText, const gp_Pnt& aPosition,
35 const Standard_CString aFont, const Quantity_NameOfColor aColor, const Standard_Real aHeight)
37 myPosition = aPosition;
38 myText = TCollection_ExtendedString(aText);
40 myNameOfColor = aColor;
45 /*************************************************************************
49 **************************************************************************/
51 void QABugs_MyText::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
52 const Handle(Prs3d_Presentation)& aPresentation,
53 const Standard_Integer /*aMode*/ )
55 aPresentation->Clear();
56 Handle(Prs3d_TextAspect) asp = myDrawer->TextAspect();
58 asp->SetFont(myNameOfFont);
59 asp->SetColor(myNameOfColor);
60 asp->SetHeight(myHeight); // I am changing the myHeight value
61 Prs3d_Text::Draw(aPresentation, asp, myText, myPosition);
64 void QABugs_MyText::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
65 const Standard_Integer /*aMode*/)
67 // This code is here to compute the selection, erase this code if you don't what selection.
69 Handle( SelectMgr_EntityOwner ) own = new SelectMgr_EntityOwner(this, 7);
71 Handle( Select3D_SensitiveBox ) box = new Select3D_SensitiveBox(own,
82 Standard_Integer QABugs_MyText::NbPossibleSelection() const