Open Inventor Reference
SoAsciiText Class Reference

Simple 3D text shape node. More...

#include <Inventor/nodes/SoAsciiText.h>

Inheritance diagram for SoAsciiText:
SoShape SoNode SoFieldContainer SoBase

List of all members.

Public Types

enum  Justification { LEFT = 0x01, RIGHT = 0x02, CENTER = 0x03 }
 Justification types. More...

Public Member Functions

 SoAsciiText ()
 Creates an ascii text node with default settings.
virtual void GLRender (SoGLRenderAction *action)
 Implements rendering by rendering each primitive generated by subclass.
virtual void rayPick (SoRayPickAction *action)
 Implements picking along a ray by intersecting the ray with each primitive generated by subclass.

Static Public Member Functions

static void initClass ()
 Initializes base node class.

Public Attributes

Fields
SoMFString string
 The text string(s) to display. Each string will appear on its own line.
SoSFFloat spacing
 Defines the distance (in the negative y direction) between the base points of successive strings, measured with respect to the current font height.
SoSFEnum justification
 Indicates placement and alignment of strings.
SoMFFloat width
 Defines the width of each text string.

Protected Member Functions

virtual void computeBBox (SoAction *action, SbBox3f &box, SbVec3f &center)
 Computes bounding box of text.
virtual void generatePrimitives (SoAction *)
 Generates primitives.
virtual ~SoAsciiText ()

Detailed Description

This node defines one or more strings of 3D text. In contrast with SoText2, 3D text can be rotated, scaled, lighted, and textured, just like all other 3D shapes. In constrast with SoText3, this 3D ascii text cannot be extruded.

The text origin is at (0,0,0) after applying the current transformation. The scale of the text is affected by the size field of the current SoFont as well as the current transformation.

SoAsciiText uses the current material when rendering. Textures are applied to ascii text as follows. On the front face of the text, the texture origin is at the base point of the first string; the base point is at the lower left for justification LEFT, at the lower right for RIGHT, and at the lower center for CENTER. The texture is scaled equally in both S and T dimensions, with the font height representing 1 unit. S increases to the right on the front face.

File Format/Default
AsciiText {
  string ""
  spacing 1
  justification LEFT
  width 0
}
Action Behavior
SoGLRenderAction
Draws text based on the current font, transformation, drawing style, material, texture, complexity, and so on.
SoRayPickAction
Performs a pick on the text. The string index and character position are available from the SoTextDetail.
SoGetBoundingBoxAction
Computes the bounding box that encloses the text.
SoCallbackAction
If any triangle callbacks are registered with the action, they will be invoked for each successive triangle used to approximate the text geometry.
See Also
SoFont, SoFontStyle, SoText2, SoText3, SoTextDetail

Definition at line 148 of file SoAsciiText.h.


Member Enumeration Documentation

Enumerator:
LEFT 
RIGHT 
CENTER 

Definition at line 154 of file SoAsciiText.h.


Constructor & Destructor Documentation

SoAsciiText::SoAsciiText ( )
virtual SoAsciiText::~SoAsciiText ( ) [protected, virtual]

Member Function Documentation

virtual void SoAsciiText::computeBBox ( SoAction action,
SbBox3f box,
SbVec3f center 
) [protected, virtual]

Implements SoShape.

virtual void SoAsciiText::generatePrimitives ( SoAction ) [protected, virtual]

Implements SoShape.

virtual void SoAsciiText::GLRender ( SoGLRenderAction action) [virtual]

May be overridden in subclass.

Reimplemented from SoShape.

static void SoAsciiText::initClass ( ) [static]

Reimplemented from SoShape.

virtual void SoAsciiText::rayPick ( SoRayPickAction action) [virtual]

May be overridden in subclass.

Reimplemented from SoShape.


Member Data Documentation

With LEFT justification, the left edge of the first line is at the (transformed) origin, and all left edges are aligned. RIGHT justification is similar. CENTER justification places the center of the first string at the (transformed) origin, with the centers of all remaining strings aligned under it.

Definition at line 178 of file SoAsciiText.h.

A value of 1 indicates single spacing, a value of 2 indicates double spacing, and so on.

Definition at line 170 of file SoAsciiText.h.

Definition at line 164 of file SoAsciiText.h.

Each string will be scaled so that it spans this many units.

Definition at line 182 of file SoAsciiText.h.


The documentation for this class was generated from the following file: