1 // Created on: 2014-11-10
2 // Copyright (c) 2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #ifndef _AIS_TextLabel_HeaderFile
16 #define _AIS_TextLabel_HeaderFile
18 #include <AIS_InteractiveObject.hxx>
21 #include <Graphic3d_VerticalTextAlignment.hxx>
22 #include <Graphic3d_HorizontalTextAlignment.hxx>
23 #include <Font_FontAspect.hxx>
24 #include <TCollection_ExtendedString.hxx>
26 //! Presentation of the text.
27 class AIS_TextLabel : public AIS_InteractiveObject
31 //! Default constructor
32 Standard_EXPORT AIS_TextLabel();
34 //! Setup color of entire text.
35 Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
37 //! Setup color of entire text.
38 Standard_EXPORT virtual void SetColor (const Quantity_NameOfColor theColor) Standard_OVERRIDE;
41 Standard_EXPORT void SetText (const TCollection_ExtendedString& theText);
44 Standard_EXPORT void SetPosition (const gp_Pnt& thePosition);
46 //! Setup horizontal justification.
47 Standard_EXPORT void SetHJustification (const Graphic3d_HorizontalTextAlignment theHJust);
49 //! Setup vertical justification.
50 Standard_EXPORT void SetVJustification (const Graphic3d_VerticalTextAlignment theVJust);
53 Standard_EXPORT void SetAngle (const Standard_Real theAngle);
55 //! Setup zoomable property.
56 Standard_EXPORT void SetZoomable (const Standard_Boolean theIsZoomable);
59 Standard_EXPORT void SetHeight (const Standard_Real theHeight);
61 //! Setup font aspect.
62 Standard_EXPORT void SetFontAspect (const Font_FontAspect theFontAspect);
65 Standard_EXPORT void SetFont (Standard_CString theFont);
70 Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
71 const Handle(Prs3d_Presentation)& thePresentation,
72 const Standard_Integer theMode) Standard_OVERRIDE;
75 Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
76 const Standard_Integer theMode) Standard_OVERRIDE;
80 TCollection_ExtendedString myText;
82 TCollection_AsciiString myFont;
83 Font_FontAspect myFontAspect;
88 DEFINE_STANDARD_RTTI(AIS_TextLabel, AIS_InteractiveObject);
92 DEFINE_STANDARD_HANDLE(AIS_TextLabel, AIS_InteractiveObject)
94 #endif // _AIS_TextLabel_HeaderFile