SmallChange
1.0.0
A collection of extensions to Coin3D
|
The SoText2Set class is a node type for visualizing a set of 2D texts aligned with the camera plane. More...
#include <SmallChange/nodes/SoText2Set.h>
Public Types | |
enum | Justification { LEFT = 1 , RIGHT , CENTER } |
Public Member Functions | |
SoText2Set (void) | |
virtual void | getPrimitiveCount (SoGetPrimitiveCountAction *action) |
virtual void | GLRender (SoGLRenderAction *action) |
virtual void | rayPick (SoRayPickAction *action) |
Static Public Member Functions | |
static void | initClass (void) |
Public Attributes | |
SoMFEnum | justification |
SoSFInt32 | maxStringsToRender |
SoMFVec3f | position |
SoSFBool | renderOutline |
SoMFFloat | rotation |
SoMFString | string |
Protected Member Functions | |
virtual | ~SoText2Set () |
virtual void | computeBBox (SoAction *action, SbBox3f &box, SbVec3f ¢er) |
virtual void | generatePrimitives (SoAction *action) |
virtual void | notify (SoNotList *list) |
The SoText2Set class is a node type for visualizing a set of 2D texts aligned with the camera plane.
See documentation of Inventor/shapenodes/SoText2
SoText2Set is identical to the built-in SoText2 node except for:
The main purpose of this node is optimization; by collecting all text that should be rendered with the same font settings in one SoText2Set node, overhead is reduced.
A secondary purpose is to allow rotated rendering of 2D text.
Note that if you want to render multi-line text, SoText2 is probably a better choice since that node takes care of vertical spacing automatically. With SoText2Set each string is positioned directly in 3D space.
FIXME: rayPick() does not function properly with rotated strings unless they are CENTERed.
Enum contains the various options for how the horizontal text layout text should be done. Valid values are LEFT, RIGHT and CENTER.
SoText2Set::SoText2Set | ( | void | ) |
Constructor.
|
protectedvirtual |
Destructor.
SoMFEnum SoText2Set::justification |
Decides how the horizontal layout of each text string is done.
SoSFInt32 SoText2Set::maxStringsToRender |
Specifies how many strings to render based on their closeness to the camera.
SoMFVec3f SoText2Set::position |
Position of each string in local coordinate space.
SoSFBool SoText2Set::renderOutline |
When TRUE, text will be rendered as white text with a black border. Default value is FALSE.
SoMFFloat SoText2Set::rotation |
Angle in radians between text and horizontal line, in the camera plane. Positive direction is counterclockwise.
SoMFString SoText2Set::string |
The set of strings to render. string[i] is rendered at position[i], justified according to justification[i] and rotated according to rotation[i].
The default value of the field is a single empty string.