SmallChange  1.0.0
A collection of extensions to Coin3D
Loading...
Searching...
No Matches
SoText2Set Class Reference

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>

Inheritance diagram for SoText2Set:
SoShape

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 &center)
 
virtual void generatePrimitives (SoAction *action)
 
virtual void notify (SoNotList *list)
 

Detailed Description

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:

  • Each string is positioned independently in 3D space
  • Each string is aligned independently
  • Each string is rotated independently (in the camera plane)

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.

See also
SoText2

Member Enumeration Documentation

◆ Justification

Enum contains the various options for how the horizontal text layout text should be done. Valid values are LEFT, RIGHT and CENTER.

Constructor & Destructor Documentation

◆ SoText2Set()

SoText2Set::SoText2Set ( void )

Constructor.

◆ ~SoText2Set()

SoText2Set::~SoText2Set ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ notify()

void SoText2Set::notify ( SoNotList * list)
protectedvirtual

Overloaded to disable geometry cache.

Member Data Documentation

◆ justification

SoMFEnum SoText2Set::justification

Decides how the horizontal layout of each text string is done.

◆ maxStringsToRender

SoSFInt32 SoText2Set::maxStringsToRender

Specifies how many strings to render based on their closeness to the camera.

◆ position

SoMFVec3f SoText2Set::position

Position of each string in local coordinate space.

◆ renderOutline

SoSFBool SoText2Set::renderOutline

When TRUE, text will be rendered as white text with a black border. Default value is FALSE.

◆ rotation

SoMFFloat SoText2Set::rotation

Angle in radians between text and horizontal line, in the camera plane. Positive direction is counterclockwise.

◆ string

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.


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