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

Visualization
TKV2d
Graphic2d


Graphic2d_Paragraph Class Reference

The primitive Paragraph
contains a row column of editable texts
each text can have a different color and font index.
.

#include <Graphic2d_Paragraph.hxx>

Inheritance diagram for Graphic2d_Paragraph:

Inheritance graph
[legend]

Public Member Functions

Standard_EXPORT Graphic2d_Paragraph (const Handle(Graphic2d_GraphicObject)&aGraphicObject, const Standard_Real X, const Standard_Real Y, const Quantity_PlaneAngle anAngle=0.0, const Aspect_CardinalPoints anOffset=Aspect_CP_Center, const Quantity_Factor aScale=1.0)
 Creates a paragraph in a graphic object <agraphicobject>
The reference point is <x>, <y>.
The orientation angle is <anangle>.
The offset position of the reference point is <aposition>
depending of the size of paragraph.
The paragraph scale.
Angles are measured counterclockwise with 0 radian
at 3 o'clock.
Warning: a paragraph can be orientable.slantable and zoomable
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 SetSlant (const Quantity_PlaneAngle aSlant=0.0)
 Sets the slant angle of the paragraph <me>.
.
Standard_EXPORT void SetSpacing (const Quantity_Ratio aSpacing=0.5)
 Sets the line spacing ratio for the paragraph <me>.
the spacing height between two lines depends of
the spacing factor apply on the height of the line currently -- writen.
.
Standard_EXPORT void SetMargin (const Quantity_Length aMargin=0.0)
 Sets the fixed margin for the paragraph <me>.
.
Standard_EXPORT void SetZoomable (const Standard_Boolean aFlag=Standard_False)
 The paragraph <me> follows the scale factor of the view
if the flag is Standard_True.
.
Standard_EXPORT void SetFrameColorIndex (const Standard_Integer anIndex=0)
 Sets the frame color index for the paragraph <me>.
Warning: Note that the paragraph frame is drawn only when index
is > 0.
.
Standard_EXPORT void SetFrameWidthIndex (const Standard_Integer anIndex=0)
 Sets the width index for the frame of the paragraph <me>.
default width is 0 (1 pixel out line frame is drawn).
.
Standard_EXPORT void SetHidingColorIndex (const Standard_Integer anIndex=0)
 Sets the hiding color index for the paragraph <me>.
Warning: Note that the paragraph background is filled only when index
is >= 0.
A value of 0 permits to drawn the paragraph background with
the current view background color.
.
Standard_EXPORT void SetCurrentColorIndex (const Standard_Integer anIndex=1)
 Sets the current color index for the paragraph <me>.
Warning: Note that the index 0 can be undefined as a ColorMapEntry,
in this case the default color is taken.
.
Standard_EXPORT void SetCurrentFontIndex (const Standard_Integer anIndex=0, const Quantity_Length aHScale=1.0, const Quantity_Length aWScale=1.0)
 Sets the current font index and scales for the paragraph <me>.
Warning: Note that the index 0 can be undefined as a FontMapEntry ,
in this case the default system text font is taken.
.
Standard_EXPORT void SetCurrentAlignment (const Graphic2d_TypeOfAlignment anAlignment=Graphic2d_TOA_LEFT)
 Sets the current text alignment for the paragraph <me>.
.
Standard_EXPORT void SetCurrentUnderline (const Standard_Boolean isUnderlined=Standard_False)
 Sets the current text underline flag for the paragraph <me>.
.
Standard_EXPORT void AddText (const TCollection_ExtendedString &aText, const Standard_Integer aRow=0, const Standard_Integer aColumn=0)
 Adds a text at a row-column position in the paragraph <me>
with the current Color,Font,Alignment attributes
at the position <aColumn,aRow> if <acolumn> and <arow> are > 0
or at the end of the line if <acolumn> is 0,
or at the end of the paragraph if <arow> is 0.
.
Standard_EXPORT void ChangeText (const TCollection_ExtendedString &aText, const Standard_Integer aRow, const Standard_Integer aColumn)
 Changes a text in the paragraph at a row-column position,
don't change the attributes of the text.
Warning: May do nothing if the row-column don't exist in the
paragraph.
.
Standard_EXPORT void Clear ()
 Clear ALL the text in the paragraph <me>.
.
Standard_EXPORT Standard_Boolean IsZoomable () const
 Returns Standard_True if the Paragraph <me> follows
the scale factor of the view.
.
Standard_EXPORT void Size (Quantity_Length &aWidth, Quantity_Length &aHeight) const
 Returns the size of the paragraph <me> .
.
Standard_EXPORT void Position (Quantity_Length &X, Quantity_Length &Y) const
 Returns the paragraph position.
.
Standard_EXPORT Aspect_CardinalPoints Offset (Quantity_Length &Dx, Quantity_Length &Dy) const
 Returns the paragraph Offset.
.
Standard_EXPORT Quantity_PlaneAngle Angle () const
 Returns the paragraph orientation.
.
Standard_EXPORT Quantity_PlaneAngle Slant () const
 Returns the paragraph slant.
.
Standard_EXPORT Quantity_Ratio Spacing () const
 Returns the paragraph spacing ratio.
.
Standard_EXPORT Quantity_Length Margin () const
 Returns the paragraph margin value.
.
Standard_EXPORT Standard_Integer HidingColorIndex () const
 Returns the paragraph hiding color index.
.
Standard_EXPORT Standard_Integer FrameColorIndex () const
 Returns the paragraph frame color index.
.
Standard_EXPORT Standard_Integer FrameWidthIndex () const
 Returns the paragraph frame width index.
.
Standard_EXPORT TCollection_ExtendedString Text (const Standard_Integer aRank, Standard_Integer &aRow, Standard_Integer &aColumn, Standard_Integer &aColorIndex, Standard_Integer &aFontIndex, Graphic2d_TypeOfAlignment &anAlignment) const
 Returns the text string and attributes of rank <arank>.
.
Standard_EXPORT Standard_Boolean TextSize (const Standard_Integer aRank, 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 offsets in the
world size parameter <awidth>,<aheight>,<anxoffset>,<anyoffset>
depending of the attributes of the paragraph text position
<arank> 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 text
boundary limits.
.
Standard_EXPORT Standard_Integer Length () const
 Returns the number of Text of the paragraph <me>.
.
Standard_EXPORT Standard_Integer MaxRow () const
 Returns the number of Row of the paragraph <me>.
.
Standard_EXPORT Standard_Integer MaxColumn () const
 Returns the number of Column of the paragraph <me>.
.
Standard_EXPORT Standard_Boolean ComputeMinMax ()
 Computes the MinMax of the paragraph if possible.
.
virtual Standard_EXPORT void Save (Aspect_FStream &aFStream) const
Standard_EXPORT const Handle (Standard_Type)&DynamicType() const

Protected Member Functions

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

Private Attributes

Standard_ShortReal myX
Standard_ShortReal myY
Standard_ShortReal myXoffset
Standard_ShortReal myYoffset
Aspect_CardinalPoints myOffset
Standard_ShortReal myWidth
Standard_ShortReal myHeight
Standard_ShortReal myAngle
Standard_ShortReal mySlant
Standard_ShortReal mySpacing
Standard_ShortReal myMargin
Standard_ShortReal myScale
Standard_Boolean myIsZoomable
Standard_Integer myFrameColorIndex
Standard_Integer myFrameWidthIndex
Standard_Integer myHidingColorIndex
Standard_Integer myCurrentColorIndex
Standard_Integer myCurrentFontIndex
Standard_ShortReal myCurrentFontHScale
Standard_ShortReal myCurrentFontWScale
Graphic2d_TypeOfAlignment myCurrentAlignment
Standard_Boolean myCurrentUnderline
TColStd_SequenceOfExtendedString myTextStringList
TColStd_SequenceOfInteger myTextDescriptorList
TShort_SequenceOfShortReal myTextXpositionList
TShort_SequenceOfShortReal myTextYpositionList
TShort_SequenceOfShortReal myTextFheightList
TShort_SequenceOfShortReal myTextFoffsetList
TShort_SequenceOfShortReal myTextHScaleList
TShort_SequenceOfShortReal myTextWScaleList

Constructor & Destructor Documentation

Standard_EXPORT Graphic2d_Paragraph::Graphic2d_Paragraph const Handle(Graphic2d_GraphicObject)&  aGraphicObject,
const Standard_Real  X,
const Standard_Real  Y,
const Quantity_PlaneAngle  anAngle = 0.0,
const Aspect_CardinalPoints  anOffset = Aspect_CP_Center,
const Quantity_Factor  aScale = 1.0
 


Member Function Documentation

Standard_EXPORT void Graphic2d_Paragraph::AddText const TCollection_ExtendedString &  aText,
const Standard_Integer  aRow = 0,
const Standard_Integer  aColumn = 0
 

Standard_EXPORT Quantity_PlaneAngle Graphic2d_Paragraph::Angle  )  const
 

Standard_EXPORT void Graphic2d_Paragraph::ChangeText const TCollection_ExtendedString &  aText,
const Standard_Integer  aRow,
const Standard_Integer  aColumn
 

Standard_EXPORT void Graphic2d_Paragraph::Clear  ) 
 

Standard_EXPORT Standard_Boolean Graphic2d_Paragraph::ComputeMinMax  )  [virtual]
 

Reimplemented from Graphic2d_Primitive.

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

Implements Graphic2d_Primitive.

Standard_EXPORT Standard_Integer Graphic2d_Paragraph::FrameColorIndex  )  const
 

Standard_EXPORT Standard_Integer Graphic2d_Paragraph::FrameWidthIndex  )  const
 

Standard_EXPORT const Graphic2d_Paragraph::Handle Standard_Type   )  const
 

Reimplemented from Graphic2d_Primitive.

Standard_EXPORT Standard_Integer Graphic2d_Paragraph::HidingColorIndex  )  const
 

Standard_EXPORT Standard_Boolean Graphic2d_Paragraph::IsZoomable  )  const
 

Standard_EXPORT Standard_Integer Graphic2d_Paragraph::Length  )  const
 

Standard_EXPORT Quantity_Length Graphic2d_Paragraph::Margin  )  const
 

Standard_EXPORT Standard_Integer Graphic2d_Paragraph::MaxColumn  )  const
 

Standard_EXPORT Standard_Integer Graphic2d_Paragraph::MaxRow  )  const
 

Standard_EXPORT Aspect_CardinalPoints Graphic2d_Paragraph::Offset Quantity_Length &  Dx,
Quantity_Length &  Dy
const
 

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

Implements Graphic2d_Primitive.

Standard_EXPORT void Graphic2d_Paragraph::Position Quantity_Length &  X,
Quantity_Length &  Y
const
 

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

Implements Graphic2d_Primitive.

Standard_EXPORT void Graphic2d_Paragraph::SetCurrentAlignment const Graphic2d_TypeOfAlignment  anAlignment = Graphic2d_TOA_LEFT  ) 
 

Standard_EXPORT void Graphic2d_Paragraph::SetCurrentColorIndex const Standard_Integer  anIndex = 1  ) 
 

Standard_EXPORT void Graphic2d_Paragraph::SetCurrentFontIndex const Standard_Integer  anIndex = 0,
const Quantity_Length  aHScale = 1.0,
const Quantity_Length  aWScale = 1.0
 

Standard_EXPORT void Graphic2d_Paragraph::SetCurrentUnderline const Standard_Boolean  isUnderlined = Standard_False  ) 
 

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

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

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

Standard_EXPORT void Graphic2d_Paragraph::SetMargin const Quantity_Length  aMargin = 0.0  ) 
 

Standard_EXPORT void Graphic2d_Paragraph::SetSlant const Quantity_PlaneAngle  aSlant = 0.0  ) 
 

Standard_EXPORT void Graphic2d_Paragraph::SetSpacing const Quantity_Ratio  aSpacing = 0.5  ) 
 

Standard_EXPORT void Graphic2d_Paragraph::SetZoomable const Standard_Boolean  aFlag = Standard_False  ) 
 

Standard_EXPORT void Graphic2d_Paragraph::Size Quantity_Length &  aWidth,
Quantity_Length &  aHeight
const
 

Standard_EXPORT Quantity_PlaneAngle Graphic2d_Paragraph::Slant  )  const
 

Standard_EXPORT Quantity_Ratio Graphic2d_Paragraph::Spacing  )  const
 

Standard_EXPORT TCollection_ExtendedString Graphic2d_Paragraph::Text const Standard_Integer  aRank,
Standard_Integer &  aRow,
Standard_Integer &  aColumn,
Standard_Integer &  aColorIndex,
Standard_Integer &  aFontIndex,
Graphic2d_TypeOfAlignment anAlignment
const
 

Standard_EXPORT Standard_Boolean Graphic2d_Paragraph::TextSize const Standard_Integer  aRank,
Quantity_Length &  aWidth,
Quantity_Length &  aHeight,
Quantity_Length &  anXoffset,
Quantity_Length &  anYoffset
const
 


Field Documentation

Standard_ShortReal Graphic2d_Paragraph::myAngle [private]
 

Graphic2d_TypeOfAlignment Graphic2d_Paragraph::myCurrentAlignment [private]
 

Standard_Integer Graphic2d_Paragraph::myCurrentColorIndex [private]
 

Standard_ShortReal Graphic2d_Paragraph::myCurrentFontHScale [private]
 

Standard_Integer Graphic2d_Paragraph::myCurrentFontIndex [private]
 

Standard_ShortReal Graphic2d_Paragraph::myCurrentFontWScale [private]
 

Standard_Boolean Graphic2d_Paragraph::myCurrentUnderline [private]
 

Standard_Integer Graphic2d_Paragraph::myFrameColorIndex [private]
 

Standard_Integer Graphic2d_Paragraph::myFrameWidthIndex [private]
 

Standard_ShortReal Graphic2d_Paragraph::myHeight [private]
 

Standard_Integer Graphic2d_Paragraph::myHidingColorIndex [private]
 

Standard_Boolean Graphic2d_Paragraph::myIsZoomable [private]
 

Standard_ShortReal Graphic2d_Paragraph::myMargin [private]
 

Aspect_CardinalPoints Graphic2d_Paragraph::myOffset [private]
 

Standard_ShortReal Graphic2d_Paragraph::myScale [private]
 

Standard_ShortReal Graphic2d_Paragraph::mySlant [private]
 

Standard_ShortReal Graphic2d_Paragraph::mySpacing [private]
 

TColStd_SequenceOfInteger Graphic2d_Paragraph::myTextDescriptorList [private]
 

TShort_SequenceOfShortReal Graphic2d_Paragraph::myTextFheightList [private]
 

TShort_SequenceOfShortReal Graphic2d_Paragraph::myTextFoffsetList [private]
 

TShort_SequenceOfShortReal Graphic2d_Paragraph::myTextHScaleList [private]
 

TColStd_SequenceOfExtendedString Graphic2d_Paragraph::myTextStringList [private]
 

TShort_SequenceOfShortReal Graphic2d_Paragraph::myTextWScaleList [private]
 

TShort_SequenceOfShortReal Graphic2d_Paragraph::myTextXpositionList [private]
 

TShort_SequenceOfShortReal Graphic2d_Paragraph::myTextYpositionList [private]
 

Standard_ShortReal Graphic2d_Paragraph::myWidth [private]
 

Standard_ShortReal Graphic2d_Paragraph::myX [private]
 

Standard_ShortReal Graphic2d_Paragraph::myXoffset [private]
 

Standard_ShortReal Graphic2d_Paragraph::myY [private]
 

Standard_ShortReal Graphic2d_Paragraph::myYoffset [private]
 


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