//! Default constructor
Standard_EXPORT AIS_TextLabel();
+ //! Return TRUE for supported display mode.
+ virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; }
+
//! Setup color of entire text.
Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
- //! Setup color of entire text.
- Standard_EXPORT virtual void SetColor (const Quantity_NameOfColor theColor) Standard_OVERRIDE;
+ //! Setup transparency within [0, 1] range.
+ Standard_EXPORT virtual void SetTransparency (const Standard_Real theValue) Standard_OVERRIDE;
+
+ //! Removes the transparency setting.
+ virtual void UnsetTransparency() Standard_OVERRIDE { SetTransparency (0.0); }
+
+ //! Material has no effect for text label.
+ virtual void SetMaterial (const Graphic3d_MaterialAspect& ) Standard_OVERRIDE {}
//! Setup text.
Standard_EXPORT void SetText (const TCollection_ExtendedString& theText);
//! Returns position.
Standard_EXPORT const gp_Pnt& Position() const;
+ //! Returns the label text.
+ const TCollection_ExtendedString& Text() const { return myText; }
+
+ //! Returns the font of the label text.
+ Standard_EXPORT const TCollection_AsciiString& FontName() const;
+
+ //! Returns the font aspect of the label text.
+ Standard_EXPORT Font_FontAspect FontAspect() const;
+
//! Returns label orientation in the model 3D space.
Standard_EXPORT const gp_Ax2& Orientation3D() const;
//! Returns true if the current text placement mode uses text orientation in the model 3D space.
Standard_EXPORT Standard_Boolean HasOrientation3D() const;
+ Standard_EXPORT void SetFlipping (const Standard_Boolean theIsFlipping);
+
+ 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:
+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:
TCollection_ExtendedString myText;
- TCollection_AsciiString myFont;
- Font_FontAspect myFontAspect;
gp_Ax2 myOrientation3D;
Standard_Boolean myHasOrientation3D;
+ Standard_Boolean myHasOwnAnchorPoint;
+ Standard_Boolean myHasFlipping;
public: