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

The SmTextureText2 node is used for fast text rendering. More...

#include <SmallChange/nodes/SmTextureText2.h>

Inheritance diagram for SmTextureText2:
SoShape

Public Types

enum  Justification { LEFT = 1 , RIGHT , CENTER }
 
enum  VerticalJustification { BOTTOM = 1 , TOP , VCENTER }
 

Public Member Functions

 SmTextureText2 (void)
 
virtual void buildStringQuad (SoAction *action, int idx, SbVec3f &p0, SbVec3f &p1, SbVec3f &p2, SbVec3f &p3)
 
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

SoSFEnum justification
 
SoSFFloat maxRange
 
SoSFVec3f offset
 
SoSFBool pickOnPixel
 
SoMFVec3f position
 
SoMFFloat rotation
 
SoMFString string
 
SoMFInt32 stringIndex
 
SoSFEnum verticalJustification
 

Protected Member Functions

virtual ~SmTextureText2 ()
 
virtual void computeBBox (SoAction *action, SbBox3f &box, SbVec3f &center)
 
virtual void generatePrimitives (SoAction *action)
 
virtual int getPositions (SoState *state, const SbVec3f *&positions) const
 
virtual int getRotations (SoState *state, const float *&rotations) const
 
virtual int getStringIndices (SoState *state, const int32_t *&indices) const
 
virtual int getStrings (SoState *state, const SbString *&strings) const
 

Detailed Description

The SmTextureText2 node is used for fast text rendering.

This node can render ~200k strings / second. It pregenerates a font texture which is used for rendering the text instead of using the glBitmap()/glPixmap() method.

It can be used in two modes. If multiple 'position' values are specified, one string is rendered at each position. If a single 'position' value is supplied, the strings will be rendered vertically like the SoText2 node.

This node also supports material binding and will pick materials from the state whenever the material binding != OVERALL.

If the stringIndex field is not empty, it will be used to select strings to render. If the material binding != OVERALL, the index array will also be used to select the color.

Constructor & Destructor Documentation

◆ SmTextureText2()

SmTextureText2::SmTextureText2 ( void )

Constructor.

◆ ~SmTextureText2()

SmTextureText2::~SmTextureText2 ( )
protectedvirtual

Destructor.


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