|
http://www.coin3d.org/ http://www.kongsberg.com/kogt/ |
The SoText3 class renders extruded 3D text.Render text as 3D geometry. More...
#include <Inventor/nodes/SoText3.h>
Public Types | |
| enum | Part { FRONT = 1, SIDES = 2, BACK = 4, ALL = FRONT|BACK|SIDES } |
| enum | Justification { LEFT = 1, RIGHT, CENTER } |
Public Member Functions | |
| SbBox3f | getCharacterBounds (SoState *state, int stringindex, int charindex) |
| virtual void | GLRender (SoGLRenderAction *action) |
| virtual void | getPrimitiveCount (SoGetPrimitiveCountAction *action) |
Static Public Member Functions | |
| static void | initClass (void) |
| Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. | |
Public Attributes | |
| SoMFString | string |
| SoSFFloat | spacing |
| SoSFEnum | justification |
| SoSFBitMask | parts |
Protected Member Functions | |
| virtual void | generatePrimitives (SoAction *) |
| virtual void | computeBBox (SoAction *action, SbBox3f &box, SbVec3f ¢er) |
| virtual SoDetail * | createTriangleDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3, SoPickedPoint *pp) |
| virtual void | notify (SoNotList *list) |
The SoText3 class renders extruded 3D text.
Render text as 3D geometry.
The size of the textual geometry representation is decided from the SoFont::size field of a preceding SoFont-node in the scene graph, which specifies the size in unit coordinates. This value sets the approximate vertical size of the letters. The default value if no SoFont-nodes are used, is 10.
This node will create 3D geometry from a specified font defined by a preceding SoFont node. The complexity of the glyphs is controlled by a preceding SoComplexity node with Type set to OBJECT_SPACE. Please note that the default builtin 3D font will not be affected by the SoComplexity node.
This is a simple example of an extruded SoText3 string:
#Inventor V2.1 ascii
Separator {
renderCaching ON
Font {
name "Arial"
size 2
}
ProfileCoordinate2 {
point [ 0 0,
0.05 0.05,
0.25 0.05,
0.3 0 ]
}
LinearProfile {
index [ 0, 1, 2, 3 ]
}
Complexity {
type OBJECT_SPACE
value 1
}
ShapeHints {
creaseAngle 1.5
shapeType SOLID
vertexOrdering COUNTERCLOCKWISE
}
Material {
diffuseColor 0.6 0.6 0.8
specularColor 1 1 1
}
Text3 {
string ["Coin3D"]
parts ALL
}
}
if SoText3::Part is set to SIDES or ALL and no profile is provided, a flat, one unit long profile will be created.
Separate colors can be assigned to the front, sides and back of the glyphs by adding a preceding SoMaterialBinding node. Set the value field to PER_PART (default is OVERALL). The front, side and back of the glyphs will then be colored according to diffuse color 0, 1 and 2 found on the stack.
Beware that using a lot of SoText3 text characters in a scene will usually have severe impact on the rendering performance, as each and every character of the text increases the polygon-count a lot. This makes SoText3 nodes most suitable in situations where you just need a few characters to be placed in your scene, rather than to visualize complete sentences.
FILE FORMAT/DEFAULTS:
Text3 {
string ""
spacing 1
justification LEFT
parts FRONT
}
| enum SoText3::Part |
| void SoText3::generatePrimitives | ( | SoAction * | action | ) | [protected, virtual] |
The method implements action behavior for shape nodes for SoCallbackAction. It is invoked from SoShape::callback(). (Subclasses should not override SoNode::callback().)
The subclass implementations uses the convenience methods SoShape::beginShape(), SoShape::shapeVertex(), and SoShape::endShape(), with SoDetail instances, to pass the primitives making up the shape back to the caller.
Implements SoShape.
| void SoText3::computeBBox | ( | SoAction * | action, | |
| SbBox3f & | box, | |||
| SbVec3f & | center | |||
| ) | [protected, virtual] |
Implemented by SoShape subclasses to let the SoShape superclass know the exact size and weighted center point of the shape's bounding box.
The bounding box and center point should be calculated and returned in the local coordinate system.
The method implements action behavior for shape nodes for SoGetBoundingBoxAction. It is invoked from SoShape::getBoundingBox(). (Subclasses should not override SoNode::getBoundingBox().)
The box parameter sent in is guaranteed to be an empty box, while center is undefined upon function entry.
Implements SoShape.
| void SoText3::notify | ( | SoNotList * | l | ) | [protected, virtual] |
Notifies all auditors for this instance when changes are made.
Reimplemented from SoShape.
The strings to render.
Array defaults to contain a single empty string.
Vertical spacing. 1.0 is the default spacing.
Horizontal justification. Default is alignment at the left border.
Character parts. Default is to show only the front-facing part.
Copyright © by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated on Mon Nov 7 20:02:06 2011 for Coin by Doxygen 1.6.3.