VisualizationFoundation CAT2DGeometricTextGP

Usage: you must use this class as is. You should never derive it.


public class CAT2DGeometricTextGP

Class to create a dynamic graphic primitive of 2D geometric text.
Role: These Graphic primitives have a continuous zoom.

See also:


Constructor and Destructor Index


o CAT2DGeometricTextGP(float[2],CATUnicodeString&,float,int,int,int,CATFont*,int,float,float,float,float,int,unsigned int)
Constructs a 2D geometric text Graphic primitive.

Method Index


o Draw(CATRender&)
Draws the dynamic graphic primitive with a render.
o Get(int*,char**,CATFont**,CAT2DGeomTextAttributeSet*,CAT2DGeomTextBoundingBox*)
Retrieves data about the 2D geometric text.
o GetApplicativeUpValues(float[5])
Retrieves applicative up values.
o GetBoundingBox(float*)
Gets a 4-points bounding box (Parallelepiped) around the 2D geometric text.
o GetGDI(int&,float&,float&,int&,int&,int&,int&,int&,int&,CATUnicodeString&,unsigned int&,float&,CATUnicodeString&,int&,float&,float&)
Retrieves GDI attributes.
o GetStroke(int*,char**,CATFont**,CAT2DGeomTextAttributeSet*,CAT2DGeomTextBoundingBox*)
Retrieves data about the stroke 2D geometric text.
o ImmediateDraw(CATRender&,CATViewpoint*,CATViewport*)
Draws a 2D geometric text.
o ResetApplicativePickingRectangle()
Reset the applicative picking rectangle.
o SetApplicativePickingRectangle(float,float,float,float)
Sets the applicative picking rectangle.
o SetTextBackground(float*,int,int*)
Sets the 2D geometric text background.
o UnsetTextBackground()
Removes data about the 2D geometric text background.

Constructor and Destructor


o CAT2DGeometricTextGP
public CAT2DGeometricTextGP( const iPoint,
const iString,
const iHeight=10.,
const iHorJustification= 1,
const iVerJustification= 3,
const iPitch= 0,
const iFont= NULL,
const iPath= 0,
const iOrientationAngle= 0.f,
const iSpacingFactor= -10000.f,
const iCompFactor= 1.f,
const iSlantAngle= 0.f,
const iKerningEnable= 0,
const iTextVersion= 0)
Constructs a 2D geometric text Graphic primitive.
Parameters:
iPoint
the position of the Graphic Primitive in a 2D space.
iString
the string of characters which composes the text of the 2D geometric text.
iHeight
the Height of the 2D geometric text.
legal values: the default value is 10.
iHorJustification
the orthogonal justification of the 2D geometric text.
legal values:
  • 0 : normal
  • 1 : centered
  • 2 : opposite

NB : for a code page where characters are displayed in a directional way from left to right, normal = left and opposite = right
iVerJustification
the vertical justification of the 2D geometric text.
legal values:
  • 0 : top
  • 1 : cap
  • 2 : half
  • 3 : base
  • 4 : bottom
iFont
the font of the 2D geometric text.
legal values: the default value is NULL. It represents the default font.
iPitch
the pitch of the font.
legal values:
  • 0 : fixed
  • 1 : variable
iPath
the way where each character is drawn with respect to the last one drawn.
legal values:
  • 0 : left to right
  • 1 : top to bottom
  • 2 : right to left
  • 3 : bottom to top

Exemple :
 0:  TEST  | 1:  T   | 2:  TSET  | 3:  T
           |     E   |           |     S
           |     S   |           |     E
           |     T   |           |     T
iOrientationAngle
an angle in degree to rotate the 2D geometric text in the 2D plan. The inital angle is determined by iPath.
iSpacingFactor
the space factor between each character of the iString.
legal values: the default value is -10000.
it represents 1/7 for stroke font and 0 for type1 font.
iCompFactor
the compression/extension factor of each character of the iString.
legal values: the default value is 1. It means that there is no extension and no compression.
iSlantAngle
slant angle in degrees. The slant transformation has the following matrix:
  +-                   -+
  ! 1  sin(iSlantAngle) !
  !                     !
  ! 0  cos(iSlantAngle) ! 
  +-                   -+
For example, when 0<iSlantAngle<90 , it can be considered as the composition of the two following transformations:
  • Y affinity with a cos(iSlantAngle) coefficient
  • shear transformation ("transvection" or "cisaillement" in french) whose:
    • X axis is the axis which each point is invariant
    • top-right coefficient of the matrix is tangent(iSlantAngle)
iKerningEnable
to apply the kerning value between pair of glyph. Only used for OpenType font.
legal values:
  • 0 : default value, no kerning value will be applied
  • 1 : kerning value is applied (if the font is an OpenType font)
iTextVersion
to apply the code enhancement to the text display.
legal values:
  • 0 : default value, no code enhancement will be applied
  • xxyzz : enhancement is applied if the version is great or eqale to current version

Methods


o Draw
public virtual Draw( iRender)
Draws the dynamic graphic primitive with a render.
Parameters:
iRender
the render used to draw the dynamic graphic primitive.
o Get
public virtual Get( oCharCountPtr,
oStringPtr,
oFontPtr,
oGeomAttSetPtr,
oBoundingBoxPtr)
Retrieves data about the 2D geometric text.
Parameters:
oCharCountPtr
the number of characters of the string of the 2D geometric text.
oStringPtr
the string of characters of the 2D geometric text.
oFontPtr
the font used to display the 2D geometric text.
oGeomAttSetPtr
the attribute set for the 2D geometric text (it contains the position, the pitch, the height,...).
oBoundingBoxPtr
the bounding box for the 2D geometric text.
o GetApplicativeUpValues
public GetApplicativeUpValues( oUpValues)
Retrieves applicative up values. This up values are independent of the content of the CAT2DGeometricText string: they are related to the whole font character set. If the font contains no symbol, the top and bottom values provided correspond to the maximum and minimum values of the font characters bounding box. If the font contains symbols, they are not taken into account.
Parameters:
oUpValues
Up values ( oUpValues must be allocated by the calling service)
Legal values:
  • 0 : base -> bottom
  • 1 : base -> half
  • 2 : base -> cap
  • 3 : base -> top
  • 4 : bottom -> top
o GetBoundingBox
public virtual GetBoundingBox( oPoint)
Gets a 4-points bounding box (Parallelepiped) around the 2D geometric text.
Parameters:
oPoint
four 2D points of the bounding box (0:x1 , 1:y1, 2:x2 , 3:y2, 4:x3 , 5:y3, 6:x4 , 7:y4 Caution: oPoint must be allocated by the calling service (length = 8))
o GetGDI
public virtual GetGDI( oTrueTypeEquivalent,
oCellHeight,
oWidth,
oEscapement,
oOrientation,
oWeight,
oItalicFlag,
oCharSet,
oPitchAndFamily,
oTypeFaceName,
oAlignment,
oExtraSpacing,
oString,
oCharCount,
oXPoint,
oYPoint)
Retrieves GDI attributes.
Parameters:
oTrueTypeEquivalent
the flag to know if an equivalent truetype 2D geometric text exists. Following attributs have a sense only if oTrueTypeEquivalent == 1
Legal values:
  • 0 : no TrueType equivalent exist.
  • 1 : the TrueType equivalent exists.
oCellHeight
the cell height in model coordinates to create the equivalent true type font.
oWidth
equal to -1 (there's no utility here).
oEscapement
the escapement in tenths of degrees to create the equivalent true type font.
oOrientation
the orientation in tenths of degrees to create the equivalent true type font.
oWeight
the Weight to create the equivalent true type font.
oItalicFlag
the flag to specify if the equivalent true type font is an italic or not italic font.
Legal values:
  • 0 : the equivalent true type font is not an italic font.
  • 1 : the equivalent true type font is an italic font.
oCharSet
the character set to create the equivalent true type font.
oPitchAndFamily
the PitchAndFamily to create the equivalent true type font.
oTypeFaceName
the FaceName to create the equivalent true type font.
oAlignment
the alignement (an attribute for SetTextAlign).
oExtraSpacing
the extra spacing in model coordinates (an attribute for SetTextCharacterExtra).
oString
the string to create the equivalent 2D geometric text.
oCharCount
the number of characters of oString
oXPoint
the X position in model coordinates of the equivalent D geometric text.
oYPoint
the Y position in model coordinates of the equivalent D geometric text.
o GetStroke
public virtual GetStroke( oCharCountPtr,
oStringPtr,
oFontPtr,
oGeomAttSetPtr,
oBoundingBoxPtr)
Retrieves data about the stroke 2D geometric text.
Parameters:
oCharCountPtr
the number of characters of the string of the stroke 2D geometric text.
oStringPtr
the string of characters of the stroke 2D geometric text.
oFontPtr
the font used to display the stroke 2D geometric text.
oGeomAttSetPtr
the attribute set for the stroke 2D geometric text (it contains the position, the pitch, the height,...).
oBoundingBoxPtr
the bounding box for the stroke 2D geometric text.
o ImmediateDraw
public virtual ImmediateDraw( iRender,
const iViewpoint,
const iViewport)
Draws a 2D geometric text.
Parameters:
iRender
the render used to draw the 2D geometric text.
iViewpoint
the viewpoint used to draw the 2D geometric text.
iViewport
the viewport used to draw the 2D geometric text.
o ResetApplicativePickingRectangle
public ResetApplicativePickingRectangle()
Reset the applicative picking rectangle.
o SetApplicativePickingRectangle
public SetApplicativePickingRectangle( iAnchorToFirstAlgebraicValue,
iAnchorToSecondAlgebraicValue,
iAnchorToTransversalBottom,
iAnchorToTransversalTop)
Sets the applicative picking rectangle. This service is a dirty solution. The problem is that, currently, there is no way, in Immediate draw, to know if the CATRender corresponds to a picking or not. Consequently, the best solution (distinguish the picking case in Immediate draw and let the application create a new applicative GP which inherits from the CAT2DGeometricTextGP) cannot be implemented. Consequently we are obliged:
Parameters:
iAnchorToFirstAlgebraicValue
if you consider the line which is along the deplacement direction, and passes through the anchor point, oriented by the deplacement direction, this value is the algebraic value from the anchor point to the intersection with:
  • Path right case: left side of the rectangle
  • path down case: up side of the rectangle
  • Path left case: right side of the rectangle
  • path up case: bottom side of the rectangle
iAnchorToSecondAlgebraicValue
the same as iAnchorToFirstAlgebraicValue, except that you take the opposite side of the rectangle
iAnchorToTransversalBottom
consider the line which passes through the anchor point, perpendicular to the deplacement direction, with an associated unitary vector, oriented so that:
  • Path right case: the scalar product between the unitary vector and the up vector is positive
  • path down case: the scalar product between the unitary vector and the base vector is positive
  • Path left case: the scalar product between the unitary vector and the up vector is positive
  • path up case: the scalar product between the unitary vector and the base vector is positive
Then, this value is the algebraic value, along this line, from the anchor point to the intersection of this line with the following side of the rectangle:
  • Path right case: bottom
  • path down case: left
  • Path left case: bottom
  • path up case: left
iAnchorToTransversalTop
the same as iAnchorToTransversalBottom, except that you take the opposite side of the rectangle.
o SetTextBackground
public SetTextBackground( iPoint=NULL,
iNb_point=0,
iColor=NULL)
Sets the 2D geometric text background. This method allows to describe the background of the 2D geometric text. The background is a polygon filled with one color.
Parameters:
iPoint
Points which describe the polygon (they are 2D points). This is an array of float and its size is equal to two times the number of points (XYXYXY...).
Legal values: the default value is NULL. It means there is no background available.
iNb_point
Number of 2D points.
Legal values: the default value is 0.
iColor
table which describes the color of the background. The lenght of this table is 3 (RGB).
Legal values: the default value is NULL.
o UnsetTextBackground
public UnsetTextBackground()
Removes data about the 2D geometric text background. It initalizes to 0 all datas on the background.

This object is included in the file: CAT2DGeometricTextGP.h
If needed, your Imakefile.mk should include the module: CATVisFoundation

Copyright © 1999-2015, Dassault Systèmes. All rights reserved.