OCC Main Page | Visualization | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

Visualization
TKV2d
Graphic2d


Graphic2d_HidingText Class Reference

The primitive HidingText
is a Text above a surounded hiding polygon.
The text foreground color depends of the
SetColorIndex() method.
The polygon background color of the
SetHidingColorIndex() method.
The outline frame foreground color and width depends
of the SetFrameColorIndex() & SetFrameWidthIndex() methods.
.

#include <Graphic2d_HidingText.hxx>

Inheritance diagram for Graphic2d_HidingText:

Inheritance graph
[legend]

Public Member Functions

Standard_EXPORT Graphic2d_HidingText (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 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.
.
Standard_EXPORT void SetFrameColorIndex (const Standard_Integer anIndex=0)
 Sets the color index for the frame of the hiding text <me>.
default color is 0 (no out line frame is drawn).
.
Standard_EXPORT void SetFrameWidthIndex (const Standard_Integer anIndex=0)
 Sets the width index for the frame of the hiding text <me>.
default width is 0 (1 pixel out line frame is drawn).
.
Standard_EXPORT void SetHidingColorIndex (const Standard_Integer anIndex=0)
 Sets the interior color index for the frame of the hiding text <me>.
default color is 0 (the current view background color).
.
virtual Standard_EXPORT Standard_Boolean Fit (const Quantity_Length aWidth, const Quantity_Length aHeight, const Standard_Boolean Adjust=Standard_True, const Standard_Boolean Expand=Standard_True)
 Compute text size depending of a required bounding box,
Adjust the text position depending of the text origine
and base line if Adjust is TRUE,
Expand the text when the Width is smaller that the
Fit Width if "Expand" is TRUE.
and returns Standard_True if the current Driver used is
enable to fit the text size.
Warning: The fit computation is apply only if the corresponding
dimension is > 0.
.
virtual Standard_EXPORT 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_EXPORT 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 hiding 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 hiding text
boundary limits.
.
Standard_EXPORT Quantity_Ratio Margin () const
 Returns the text margin.
.
Standard_EXPORT Standard_Integer HidingColorIndex () const
 Returns the text hiding color index.
.
Standard_EXPORT Standard_Integer FrameColorIndex () const
 Returns the text frame color index.
.
Standard_EXPORT Standard_Integer FrameWidthIndex () const
 Returns the text frame width index.
.
virtual Standard_EXPORT void Save (Aspect_FStream &aFStream) const
Standard_EXPORT const Handle (Standard_Type)&DynamicType() const

Protected Member Functions

virtual Standard_EXPORT void Draw (const Handle(Graphic2d_Drawer)&aDrawer)
 Draws the text <me>.
.
virtual Standard_EXPORT 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 text <me> is picked,
Standard_False if not.
.

Private Member Functions

virtual Standard_EXPORT Standard_Boolean ComputeMinMax ()
 Computes the MinMax of the text if possible.
.

Private Attributes

Standard_Integer myHidingColorIndex
Standard_Integer myFrameColorIndex
Standard_Integer myFrameWidthIndex
Standard_ShortReal myMargin

Constructor & Destructor Documentation

Standard_EXPORT Graphic2d_HidingText::Graphic2d_HidingText 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
 


Member Function Documentation

virtual Standard_EXPORT Standard_Boolean Graphic2d_HidingText::ComputeMinMax  )  [private, virtual]
 

Reimplemented from Graphic2d_Text.

virtual Standard_EXPORT void Graphic2d_HidingText::Draw const Handle(Graphic2d_Drawer)&  aDrawer  )  [protected, virtual]
 

Reimplemented from Graphic2d_Text.

virtual Standard_EXPORT Standard_Boolean Graphic2d_HidingText::Fit const Quantity_Length  aWidth,
const Quantity_Length  aHeight,
const Standard_Boolean  Adjust = Standard_True,
const Standard_Boolean  Expand = Standard_True
[virtual]
 

Reimplemented from Graphic2d_Text.

Standard_EXPORT Standard_Integer Graphic2d_HidingText::FrameColorIndex  )  const
 

Standard_EXPORT Standard_Integer Graphic2d_HidingText::FrameWidthIndex  )  const
 

Standard_EXPORT const Graphic2d_HidingText::Handle Standard_Type   )  const
 

Reimplemented from Graphic2d_Text.

Standard_EXPORT Standard_Integer Graphic2d_HidingText::HidingColorIndex  )  const
 

Standard_EXPORT Quantity_Ratio Graphic2d_HidingText::Margin  )  const
 

virtual Standard_EXPORT Standard_Boolean Graphic2d_HidingText::Pick const Standard_ShortReal  X,
const Standard_ShortReal  Y,
const Standard_ShortReal  aPrecision,
const Handle(Graphic2d_Drawer)&  aDrawer
[protected, virtual]
 

Reimplemented from Graphic2d_Text.

virtual Standard_EXPORT void Graphic2d_HidingText::Save Aspect_FStream aFStream  )  const [virtual]
 

Reimplemented from Graphic2d_Text.

Standard_EXPORT void Graphic2d_HidingText::SetFrameColorIndex const Standard_Integer  anIndex = 0  ) 
 

Standard_EXPORT void Graphic2d_HidingText::SetFrameWidthIndex const Standard_Integer  anIndex = 0  ) 
 

Standard_EXPORT void Graphic2d_HidingText::SetHidingColorIndex const Standard_Integer  anIndex = 0  ) 
 

virtual Standard_EXPORT Standard_Boolean Graphic2d_HidingText::TextSize Quantity_Length &  aWidth,
Quantity_Length &  aHeight,
Quantity_Length &  anXoffset,
Quantity_Length &  anYoffset
const [virtual]
 

Reimplemented from Graphic2d_Text.

virtual Standard_EXPORT Standard_Boolean Graphic2d_HidingText::Trunc const Quantity_Length  aWidth  )  [virtual]
 

Reimplemented from Graphic2d_Text.


Field Documentation

Standard_Integer Graphic2d_HidingText::myFrameColorIndex [private]
 

Standard_Integer Graphic2d_HidingText::myFrameWidthIndex [private]
 

Standard_Integer Graphic2d_HidingText::myHidingColorIndex [private]
 

Standard_ShortReal Graphic2d_HidingText::myMargin [private]
 


The documentation for this class was generated from the following file:
Generated on Mon Aug 25 13:55:33 2008 for OpenCASCADE by  doxygen 1.4.1