Click or drag to resize
SoTextProperty Class

Text property node.

Inheritance Hierarchy

Namespace: OIV.Inventor.Nodes
Assembly: OIV.Inventor (in OIV.Inventor.dll) Version: 10.12.3.0 (10.12.3.0)
Syntax
public class SoTextProperty : SoNode

The SoTextProperty type exposes the following members.

Constructors
  NameDescription
Public methodSoTextProperty

Text property constructor.

Top
Methods
  NameDescription
Public methodAffectsState

Returns true if a node has an effect on the state during traversal.

(Inherited from SoNode.)
Public methodCallback
Public methodCopy
Calls Copy(false).
(Inherited from SoNode.)
Public methodCopy(Boolean)

Creates and returns an exact copy of the node.

(Inherited from SoNode.)
Public methodCopyFieldValues(SoFieldContainer)
Calls CopyFieldValues(fc, false).
(Inherited from SoFieldContainer.)
Public methodCopyFieldValues(SoFieldContainer, Boolean)

Copies the contents of fc's fields into this object's fields.

(Inherited from SoFieldContainer.)
Public methodDispose
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.)
Public methodDistribute
(Inherited from SoNode.)
Public methodDoAction
Public methodEnableNotify

Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false).

(Inherited from SoFieldContainer.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFieldsAreEqual

Returns true if this object's fields are exactly equal to fc's fields.

(Inherited from SoFieldContainer.)
Public methodGet

Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.

(Inherited from SoFieldContainer.)
Public methodGetAllFields

Returns a list of fields, including the eventIn's and eventOut's.

(Inherited from SoFieldContainer.)
Public methodGetAlternateRep

This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type).

(Inherited from SoNode.)
Public methodGetBoundingBox
Public methodGetEventIn

Returns a the eventIn with the given name.

(Inherited from SoFieldContainer.)
Public methodGetEventOut

Returns the eventOut with the given name.

(Inherited from SoFieldContainer.)
Public methodGetField

Returns a the field of this object whose name is fieldName.

(Inherited from SoFieldContainer.)
Public methodGetFieldName

Returns the name of the given field in the fieldName argument.

(Inherited from SoFieldContainer.)
Public methodGetFields

Appends references to all of this object's fields to resultList, and returns the number of fields appended.

(Inherited from SoFieldContainer.)
Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetMatrix
(Inherited from SoNode.)
Public methodGetName

Returns the name of an instance.

(Inherited from SoBase.)
Public methodGetPrimitiveCount
Public methodGetRenderEngineMode

Returns the supported Render engine mode.

(Inherited from SoNode.)
Public methodGetRenderUnitID
(Inherited from SoNode.)
Public methodGetStringName (Inherited from SoBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGLRender
Public methodGLRenderBelowPath
(Inherited from SoNode.)
Public methodGLRenderInPath
(Inherited from SoNode.)
Public methodGLRenderOffPath
(Inherited from SoNode.)
Public methodGrabEventsCleanup
(Inherited from SoNode.)
Public methodGrabEventsSetup
(Inherited from SoNode.)
Public methodHandleEvent
(Inherited from SoNode.)
Public methodHasDefaultValues

Returns true if all of the object's fields have their default values.

(Inherited from SoFieldContainer.)
Public methodIsBoundingBoxIgnoring

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.

(Inherited from SoNode.)
Public methodIsNotifyEnabled

Notification is the process of telling interested objects that this object has changed.

(Inherited from SoFieldContainer.)
Public methodIsOverride

Returns the state of the override field.

(Overrides SoNodeIsOverride.)
Public methodIsSynchronizable

Gets the ScaleViz synchronizable state of this object.

(Inherited from SoBase.)
Public methodPick
Public methodRayPick
(Inherited from SoNode.)
Public methodSearch
(Inherited from SoNode.)
Public methodSet

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.

(Inherited from SoFieldContainer.)
Public methodSetName (Inherited from SoBase.)
Public methodSetOverride

Set the state of the override field.

(Overrides SoNodeSetOverride(Boolean).)
Public methodSetSynchronizable

Sets this to be a ScaleViz synchronizable object.

(Inherited from SoBase.)
Public methodSetToDefaults

Sets all fields in this object to their default values.

(Inherited from SoFieldContainer.)
Public methodToString
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.)
Public methodTouch

Marks an instance as modified, simulating a change to it.

(Inherited from SoNode.)
Public methodWrite
(Inherited from SoNode.)
Top
Properties
  NameDescription
Public propertyaliasingFactor

Defines the anti-aliasing factor to apply to the textured text rendering.

Public propertyalignmentH

Indicates horizontal placement and alignment of strings.

Public propertyalignmentV

Indicates vertical placement and alignment of strings.

Public propertybackFrameLineWidth

Defines the width of the line when BACK_FRAME_LINE has been enabled for the current style.

Public propertycharacterSpacing

This field specifies the spacing between individual characters.

Public propertyIsDisposable
ISafeDisposable interface implementation.
(Inherited from SoDisposable.)
Public propertykerning

Set this field to true to apply kerning on text rendering.

Public propertymargin

Set a margin (extra space) to apply around the text string for the BACK_FRAME and BACK_FRAME_LINE styles.

Public propertyorientation

Specifies the text rendering orientation.

Public propertystyle

Specifies zero or more styles to be applied to text.

Public propertystyleColors

Specifies the color to use for each style.

Public propertystyleColorsUseCurrentMaterial

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).

Public propertytextureQualityRange

Defines a quality range of values taken into account during textured text texture computation.

Public propertyUserData
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.)
Top
Remarks

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

Notes:
  • 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.

FILE FORMAT/DEFAULT

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
}

ACTION BEHAVIOR

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

See Also