Open CASCADE Technology  6.5.4
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions
Graphic2d_FramedText Class Reference

The class defines the primitive FramedText

#include <Graphic2d_FramedText.hxx>

Inheritance diagram for Graphic2d_FramedText:
Inheritance graph
[legend]

Public Member Functions

 Graphic2d_FramedText (const Handle< Graphic2d_GraphicObject > &aGraphicObject, const TCollection_ExtendedString &aText, const Standard_Real X, const Standard_Real Y, const Quantity_PlaneAngle anAngle=0.0, const Quantity_Ratio aMargin=0.1, const Aspect_TypeOfText aType=Aspect_TOT_SOLID, const Quantity_Factor aScale=1.0)
 Creates a framed text in a graphic object <aGraphicObject>
The text is <aText>.
The reference point is <X>, <Y>.
The orientation angle is <anAngle>.
The margin ratio is <aMargin>,defines the proportional
margin between the text height and the outline frame.
The type of text is <aType> and must be one of :
Aspect_TOT_SOLID,
Aspect_TOT_OUTLINE,
The scale factor apply to the original font size,
Angles are measured counterclockwise with 0 radian
at 3 o'clock.

Warning: a text can be orientable,slantable,zoomable or outlinable
only when this options are enable regardless of the graphic driver.
i.e: Xw driver does not,but Xdps or PS driver does.

void SetFrameColorIndex (const Standard_Integer anIndex=0)
 Sets the color index for the frame of the text <me>.
default color is 0 (the same color that the text).

void SetFrameWidthIndex (const Standard_Integer anIndex=0)
 Sets the width index for the frame of the text <me>.
default width is 0 (1 pixel out line frame is drawn).

virtual Standard_Boolean Fit (const Quantity_Length aWidth, const Quantity_Length aHeight, const Standard_Boolean Adjust=Standard_True, const Standard_Boolean Expand=Standard_True)
 Defines the size of the text according to a bounding
box. If Adjust corresponds to TRUE, text positioning
depends on the text origin and bottom line. The
method returns Standard_True if the current Driver is
compatible with the text size.
Warning
Fit computation is executed only if the dimension is > 0.

virtual Standard_Boolean Trunc (const Quantity_Length aWidth)
 Trunc the text when the Width of the text is greater
that the defined Width Max,
and returns Standard_True if the current Driver used is
enable to trunc the text size.

virtual Standard_Boolean TextSize (Quantity_Length &aWidth, Quantity_Length &aHeight, Quantity_Length &anXoffset, Quantity_Length &anYoffset) const
 Returns Standard_True if the current Driver used is enabled
to get the right size and framed text offsets in the
world size parameter <aWidth>,<aHeight>,<anXoffset>,<anYoffset>
depending of the attributes of the text and the current scale
of the view.
NOTE that the text offsets defines the relative position of the
of the text string origin from the lower left corner of the framed text
boundary limits.

Quantity_Ratio Margin () const
 Returns the text margin.

Standard_Integer FrameColorIndex () const
 Returns the text frame color index.

Standard_Integer FrameWidthIndex () const
 Returns the text frame width index.

virtual void Save (Aspect_FStream &aFStream) const

Protected Member Functions

virtual void Draw (const Handle< Graphic2d_Drawer > &aDrawer)
 Draws the framed text <me>.

virtual Standard_Boolean Pick (const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal aPrecision, const Handle< Graphic2d_Drawer > &aDrawer)
 Returns Standard_True if the framed text <me> is picked,
Standard_False if not.


Constructor & Destructor Documentation


Member Function Documentation

virtual void Graphic2d_FramedText::Draw ( const Handle< Graphic2d_Drawer > &  aDrawer) [protected, virtual]

Reimplemented from Graphic2d_Text.

Reimplemented from Graphic2d_Text.

Reimplemented from Graphic2d_Text.

virtual void Graphic2d_FramedText::Save ( Aspect_FStream aFStream) const [virtual]

Reimplemented from Graphic2d_Text.

virtual Standard_Boolean Graphic2d_FramedText::TextSize ( Quantity_Length aWidth,
Quantity_Length aHeight,
Quantity_Length anXoffset,
Quantity_Length anYoffset 
) const [virtual]

Reimplemented from Graphic2d_Text.

Reimplemented from Graphic2d_Text.


The documentation for this class was generated from the following file: