SoTextProperty Class |
Text property node.
Namespace: OIV.Inventor.Nodes
The SoTextProperty type exposes the following members.
Name | Description | |
---|---|---|
SoTextProperty | Text property constructor. |
Name | Description | |
---|---|---|
AffectsState | Returns true if a node has an effect on the state during traversal. | |
Callback | (Overrides SoNodeCallback(SoCallbackAction).) | |
Copy | Calls Copy(false). (Inherited from SoNode.) | |
Copy(Boolean) | Creates and returns an exact copy of the node. | |
CopyFieldValues(SoFieldContainer) | Calls CopyFieldValues(fc, false). (Inherited from SoFieldContainer.) | |
CopyFieldValues(SoFieldContainer, Boolean) | Copies the contents of fc's fields into this object's fields. | |
Dispose |
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.) | |
Distribute | (Inherited from SoNode.) | |
DoAction | (Overrides SoNodeDoAction(SoAction).) | |
EnableNotify | Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false). | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
FieldsAreEqual | Returns true if this object's fields are exactly equal to fc's fields. | |
Get | Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string. | |
GetAllFields | Returns a list of fields, including the eventIn's and eventOut's. | |
GetAlternateRep | This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type). | |
GetBoundingBox | (Overrides SoNodeGetBoundingBox(SoGetBoundingBoxAction).) | |
GetEventIn | Returns a the eventIn with the given name. | |
GetEventOut | Returns the eventOut with the given name. | |
GetField | Returns a the field of this object whose name is fieldName. | |
GetFieldName | Returns the name of the given field in the fieldName argument. | |
GetFields | Appends references to all of this object's fields to resultList, and returns the number of fields appended. | |
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetMatrix | (Inherited from SoNode.) | |
GetName | Returns the name of an instance. | |
GetPrimitiveCount | (Overrides SoNodeGetPrimitiveCount(SoGetPrimitiveCountAction).) | |
GetRenderEngineMode | Returns the supported Render engine mode. | |
GetRenderUnitID | (Inherited from SoNode.) | |
GetStringName | (Inherited from SoBase.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GLRender | (Overrides SoNodeGLRender(SoGLRenderAction).) | |
GLRenderBelowPath | (Inherited from SoNode.) | |
GLRenderInPath | (Inherited from SoNode.) | |
GLRenderOffPath | (Inherited from SoNode.) | |
GrabEventsCleanup | (Inherited from SoNode.) | |
GrabEventsSetup | (Inherited from SoNode.) | |
HandleEvent | (Inherited from SoNode.) | |
HasDefaultValues | Returns true if all of the object's fields have their default values. | |
IsBoundingBoxIgnoring | This method is used by getBoundingBox action traversal to know if the current node must be traversed or not, ie the bounding should be ignored. | |
IsNotifyEnabled | Notification is the process of telling interested objects that this object has changed. | |
IsOverride | Returns the state of the override field. | |
IsSynchronizable | Gets the ScaleViz synchronizable state of this object. | |
Pick | (Overrides SoNodePick(SoPickAction).) | |
RayPick | (Inherited from SoNode.) | |
Search | (Inherited from SoNode.) | |
Set | Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format. | |
SetName | (Inherited from SoBase.) | |
SetOverride | Set the state of the override field. | |
SetSynchronizable | Sets this to be a ScaleViz synchronizable object. | |
SetToDefaults | Sets all fields in this object to their default values. | |
ToString |
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.) | |
Touch | Marks an instance as modified, simulating a change to it. | |
Write | (Inherited from SoNode.) |
Name | Description | |
---|---|---|
aliasingFactor | Defines the anti-aliasing factor to apply to the textured text rendering. | |
alignmentH | Indicates horizontal placement and alignment of strings. | |
alignmentV | Indicates vertical placement and alignment of strings. | |
backFrameLineWidth | Defines the width of the line when BACK_FRAME_LINE has been enabled for the current style. | |
characterSpacing | This field specifies the spacing between individual characters. | |
IsDisposable | ISafeDisposable interface implementation.
(Inherited from SoDisposable.) | |
kerning | Set this field to true to apply kerning on text rendering. | |
margin | Set a margin (extra space) to apply around the text string for the BACK_FRAME and BACK_FRAME_LINE styles. | |
orientation | Specifies the text rendering orientation. | |
style | Specifies zero or more styles to be applied to text. | |
styleColors | Specifies the color to use for each style. | |
styleColorsUseCurrentMaterial | This field allows to use the current OIV.Inventor.Nodes.SoMaterial instead of the value specified by OIV.Inventor.Nodes.SoTextProperty.styleColors for each available style (default gray). | |
textureQualityRange | Defines a quality range of values taken into account during textured text texture computation. | |
UserData |
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.) |
This node specifies properties used for text rendering.
The application can specify text alignment and orientation using the OIV.Inventor.Nodes.SoTextProperty.alignmentH, OIV.Inventor.Nodes.SoTextProperty.alignmentV, and OIV.Inventor.Nodes.SoTextProperty.orientation fields.
Note: Horizontal alignment can also be specified in some text nodes, for example OIV.Inventor.Nodes.SoText2 and OIV.Inventor.Nodes.SoText3, using the justification field. The value in the text node's field is used unless that field is explicitly set to INHERIT. To allow OIV.Inventor.Nodes.SoTextProperty to control horizontal justification, set the text node's justification field to INHERITED.
The application can also request use of font kerning using the OIV.Inventor.Nodes.SoTextProperty.kerning field. Kerning consists of modifying the spacing between two successive glyphs according to their outlines. For examples, a "T" and a "y" can be moved closer together as the top of the "y" fits nicely under the upper right bar of the "T". Kerning depends on the specific font being used.
Different text rendering styles such as underline, strikethrough and background rectangle can be specified using the OIV.Inventor.Nodes.SoTextProperty.style field. A color can be specified for each style using the OIV.Inventor.Nodes.SoTextProperty.styleColors field. The current material does not affect the color of a text rendering style unless the corresponding value in the OIV.Inventor.Nodes.SoTextProperty.styleColorsUseCurrentMaterial field is set to true. Text rendering styles apply to the entire string.
Text rendering effects |
Underline/overline/strike always has the same position relative to the text string, regardless of the vertical justification setting.
The underline/overline/strike position is determined by the font and the results should be similar to what you see in other applications using the same font (e.g. MS-Word on Windows). For some fonts the underline will intersect character descenders, for example on the lower case 'g'. For some fonts the overline will intersect the top portion of some characters.
When using BACK_FRAME and BACK_FRAME_LINE you will usually want to set the margin field to a small value, for example 0.05.
Color can be specified separately for each style. However underline and overline are often intended to be the same color as the text. It can be convenient to set the styleColorsUseCurrentMaterial field so that the current OIV.Inventor.Nodes.SoMaterial controls both the text and the lines.
Note that the color for each style is an RGBA value, allowing transparency to be applied. This is particularly useful for the BACK_FRAME attribute so the text background rectangle can be semi-transparent.
As backFrameLineWidth is increased, the width of the line expands outward, away from the string (the backframe box stays the same size).
Be sure to use the values in the StyleColor enum to set colors and inheritance flags, not the values in the Style enum. For example, use UNDERLINE_COLOR, not UNDERLINE. Open Inventor will not report an error, but the desired effect will not occur.
TextProperty {
aliasingFactor | 1.0 |
alignmentH | LEFT |
alignmentV | BASE |
backFrameLineWidth | 0.0 |
kerning | false |
margin | 0.0 |
orientation | LEFT_TO_RIGHT |
textureQualityRange | 150 300 |
style | NONE |
styleColors | 0.8 0.8 0.8 1 |
styleColorsUseCurrentMaterial | false |
Sets: OIV.Inventor.Elements.SoTextAlignmentHElement, OIV.Inventor.Elements.SoTextAlignmentVElement, OIV.Inventor.Elements.SoTextBackFrameLineWidthElement, OIV.Inventor.Elements.SoTextOrientationElement, OIV.Inventor.Elements.SoTextKerningElement, OIV.Inventor.Elements.SoTextMarginElement