1 // Created on: 2002-04-10
2 // Created by: QA Admin
3 // Copyright (c) 2002-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
22 #include <QABugs_MyText.ixx>
23 #include <QABugs_MyText.hxx>
24 #include <Prs3d_Presentation.hxx>
25 #include <Prs3d_TextAspect.hxx>
26 #include <AIS_Drawer.hxx>
27 #include <SelectMgr_EntityOwner.hxx>
28 #include <Prs3d_Text.hxx>
29 #include <Select3D_SensitiveBox.hxx>
30 #include <SelectMgr_Selection.hxx>
31 #include <Font_NameOfFont.hxx>
33 /*************************************************************************
35 * CONSTRUCTION/DESTRUCTION
37 **************************************************************************/
40 QABugs_MyText::QABugs_MyText(const TCollection_ExtendedString& aText, const gp_Pnt& aPosition,
41 const Standard_CString aFont, const Quantity_NameOfColor aColor, const Standard_Real aHeight)
43 myPosition = aPosition;
44 myText = TCollection_ExtendedString(aText);
46 myNameOfColor = aColor;
51 /*************************************************************************
55 **************************************************************************/
57 void QABugs_MyText::Compute(const Handle(PrsMgr_PresentationManager3d)& /*aPresentationManager*/,
58 const Handle(Prs3d_Presentation)& aPresentation,
59 const Standard_Integer /*aMode*/ )
61 aPresentation->Clear();
62 Handle_Prs3d_TextAspect asp = myDrawer->TextAspect();
64 asp->SetFont(myNameOfFont);
65 asp->SetColor(myNameOfColor);
66 asp->SetHeight(myHeight); // I am changing the myHeight value
67 Prs3d_Text::Draw(aPresentation, asp, myText, myPosition);
70 void QABugs_MyText::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
71 const Standard_Integer /*aMode*/)
73 // This code is here to compute the selection, erase this code if you don't what selection.
75 Handle( SelectMgr_EntityOwner ) own = new SelectMgr_EntityOwner(this, 7);
77 Handle( Select3D_SensitiveBox ) box = new Select3D_SensitiveBox(own,
88 Standard_Integer QABugs_MyText::NbPossibleSelection() const