#include <Font_FontAspect.hxx>
#include <TCollection_ExtendedString.hxx>
+class Font_TextFormatter;
+
//! Presentation of the text.
class AIS_TextLabel : public AIS_InteractiveObject
{
Standard_EXPORT Standard_Boolean HasFlipping() const;
+ //! Returns flag if text uses position as point of attach
+ Standard_Boolean HasOwnAnchorPoint() const { return myHasOwnAnchorPoint; }
+
+ //! Set flag if text uses position as point of attach
+ void SetOwnAnchorPoint (const Standard_Boolean theOwnAnchorPoint) { myHasOwnAnchorPoint = theOwnAnchorPoint; }
+
//! Define the display type of the text.
//!
//! TODT_NORMAL Default display. Text only.
//! and the colour of backgroubd for the TODT_DEKALE TextDisplayType.
Standard_EXPORT void SetColorSubTitle (const Quantity_Color& theColor);
-private:
+ //! Returns text presentation formatter; NULL by default, which means standard text formatter will be used.
+ const Handle(Font_TextFormatter)& TextFormatter() const { return myFormatter; }
+
+ //! Setup text formatter for presentation. It's empty by default.
+ void SetTextFormatter (const Handle(Font_TextFormatter)& theFormatter) { myFormatter = theFormatter; }
+
+protected:
//! Compute
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
const Standard_Integer theMode) Standard_OVERRIDE;
+ //! Calculate label center, width and height
+ Standard_EXPORT Standard_Boolean calculateLabelParams (const gp_Pnt& thePosition,
+ gp_Pnt& theCenterOfLabel,
+ Standard_Real& theWidth,
+ Standard_Real& theHeight) const;
+
+ //! Calculate label transformation
+ Standard_EXPORT gp_Trsf calculateLabelTrsf (const gp_Pnt& thePosition,
+ gp_Pnt& theCenterOfLabel) const;
+
protected:
+ Handle(Font_TextFormatter) myFormatter;
+
TCollection_ExtendedString myText;
gp_Ax2 myOrientation3D;
Standard_Boolean myHasOrientation3D;
+ Standard_Boolean myHasOwnAnchorPoint;
Standard_Boolean myHasFlipping;
public: