.TH "SoText3" 3 "Thu May 29 2014" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoText3 \- .PP The \fBSoText3\fP class renders extruded 3D text\&. .PP Render text as 3D geometry\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoShape\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "enum \fBPart\fP { \fBFRONT\fP = 1, \fBSIDES\fP = 2, \fBBACK\fP = 4, \fBALL\fP = FRONT|BACK|SIDES }" .br .ti -1c .RI "enum \fBJustification\fP { \fBLEFT\fP = 1, \fBRIGHT\fP, \fBCENTER\fP }" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const " .br .RI "\fIReturns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. \fP" .ti -1c .RI "\fBSbBox3f\fP \fBgetCharacterBounds\fP (\fBSoState\fP *state, int stringindex, int charindex)" .br .ti -1c .RI "virtual void \fBGLRender\fP (\fBSoGLRenderAction\fP *action)" .br .ti -1c .RI "virtual void \fBgetPrimitiveCount\fP (\fBSoGetPrimitiveCountAction\fP *action)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .in -1c .SS "Public Attributes" .in +1c .ti -1c .RI "\fBSoMFString\fP \fBstring\fP" .br .ti -1c .RI "\fBSoSFFloat\fP \fBspacing\fP" .br .ti -1c .RI "\fBSoSFEnum\fP \fBjustification\fP" .br .ti -1c .RI "\fBSoSFBitMask\fP \fBparts\fP" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual const \fBSoFieldData\fP * \fBgetFieldData\fP (void) const " .br .ti -1c .RI "virtual void \fBgeneratePrimitives\fP (\fBSoAction\fP *)" .br .ti -1c .RI "virtual void \fBcomputeBBox\fP (\fBSoAction\fP *action, \fBSbBox3f\fP &box, \fBSbVec3f\fP ¢er)" .br .ti -1c .RI "virtual \fBSoDetail\fP * \fBcreateTriangleDetail\fP (\fBSoRayPickAction\fP *action, const \fBSoPrimitiveVertex\fP *v1, const \fBSoPrimitiveVertex\fP *v2, const \fBSoPrimitiveVertex\fP *v3, \fBSoPickedPoint\fP *pp)" .br .ti -1c .RI "virtual void \fBnotify\fP (\fBSoNotList\fP *list)" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static const \fBSoFieldData\fP ** \fBgetFieldDataPtr\fP (void)" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBSoText3\fP class renders extruded 3D text\&. .PP Render text as 3D geometry\&. The size of the textual geometry representation is decided from the \fBSoFont::size\fP 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\&. .PP This node will create 3D geometry from a specified font defined by a preceding \fBSoFont\fP node\&. The complexity of the glyphs is controlled by a preceding \fBSoComplexity\fP node with \fIType\fP set to OBJECT_SPACE\&. Please note that the default builtin 3D font will not be affected by the \fBSoComplexity\fP node\&. .PP This is a simple example of an extruded \fBSoText3\fP string: .PP .PP .nf #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 } } .fi .PP .PP .PP if \fBSoText3::Part\fP is set to SIDES or ALL and no profile is provided, a flat, one unit long profile will be created\&. .PP Separate colors can be assigned to the front, sides and back of the glyphs by adding a preceding \fBSoMaterialBinding\fP node\&. Set the \fIvalue\fP 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\&. .PP Beware that using a lot of \fBSoText3\fP 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 \fBSoText3\fP nodes most suitable in situations where you just need a few characters to be placed in your scene, rather than to visualize complete sentences\&. .PP \fBFILE FORMAT/DEFAULTS:\fP .PP .nf Text3 { string "" spacing 1 justification LEFT parts FRONT } .fi .PP .PP \fBSee also:\fP .RS 4 \fBSoText2\fP, \fBSoAsciiText\fP, \fBSoProfile\fP .RE .PP .SH "Member Enumeration Documentation" .PP .SS "enum \fBSoText3::Part\fP" Used to specify which parts should be rendered/generated\&. .PP \fBEnumerator\fP .in +1c .TP \fB\fIFRONT \fP\fP Front of characters\&. .TP \fB\fISIDES \fP\fP Sides of characters\&. .TP \fB\fIBACK \fP\fP Back of characters\&. .TP \fB\fIALL \fP\fP All parts\&. .SS "enum \fBSoText3::Justification\fP" Used to specify horizontal string alignment\&. .PP \fBEnumerator\fP .in +1c .TP \fB\fILEFT \fP\fP Left edges of strings are aligned\&. .TP \fB\fIRIGHT \fP\fP Right edges of strings are aligned\&. .TP \fB\fICENTER \fP\fP Strings are centered\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoText3::getTypeId (void) const\fC [virtual]\fP" .PP Returns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. Usage example: .PP .PP .nf void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } } .fi .PP .PP For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in \fIall\fP subclasses\&. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance \fBInventor/nodes/SoSubNode\&.h\fP (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine\&.h (for engine classes) and so on\&. .PP For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups\&. .PP Reimplemented from \fBSoShape\fP\&. .SS "const \fBSoFieldData\fP * SoText3::getFieldData (void) const\fC [protected]\fP, \fC [virtual]\fP" Returns a pointer to the class-wide field data storage object for this instance\&. If no fields are present, returns \fCNULL\fP\&. .PP Reimplemented from \fBSoShape\fP\&. .SS "\fBSbBox3f\fP SoText3::getCharacterBounds (\fBSoState\fP *state, intstringindex, intcharindex)" Not implemented\&. Should probably have been private in OIV\&. Let us know if you need this method for anything, and we'll implement it\&. .SS "void SoText3::GLRender (\fBSoGLRenderAction\fP *action)\fC [virtual]\fP" Action method for the \fBSoGLRenderAction\fP\&. .PP This is called during rendering traversals\&. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method\&. .PP Reimplemented from \fBSoShape\fP\&. .SS "void SoText3::getPrimitiveCount (\fBSoGetPrimitiveCountAction\fP *action)\fC [virtual]\fP" Action method for the \fBSoGetPrimitiveCountAction\fP\&. .PP Calculates the number of triangle, line segment and point primitives for the node and adds these to the counters of the \fIaction\fP\&. .PP Nodes influencing how geometry nodes calculates their primitive count also overrides this method to change the relevant state variables\&. .PP Reimplemented from \fBSoShape\fP\&. .SS "void SoText3::generatePrimitives (\fBSoAction\fP *action)\fC [protected]\fP, \fC [virtual]\fP" The method implements action behavior for shape nodes for \fBSoCallbackAction\fP\&. It is invoked from \fBSoShape::callback()\fP\&. (Subclasses should \fInot\fP override \fBSoNode::callback()\fP\&.) .PP The subclass implementations uses the convenience methods \fBSoShape::beginShape()\fP, \fBSoShape::shapeVertex()\fP, and \fBSoShape::endShape()\fP, with \fBSoDetail\fP instances, to pass the primitives making up the shape back to the caller\&. .PP Implements \fBSoShape\fP\&. .SS "void SoText3::computeBBox (\fBSoAction\fP *action, \fBSbBox3f\fP &box, \fBSbVec3f\fP ¢er)\fC [protected]\fP, \fC [virtual]\fP" Implemented by \fBSoShape\fP subclasses to let the \fBSoShape\fP superclass know the exact size and weighted center point of the shape's bounding box\&. .PP The bounding box and center point should be calculated and returned in the local coordinate system\&. .PP The method implements action behavior for shape nodes for \fBSoGetBoundingBoxAction\fP\&. It is invoked from \fBSoShape::getBoundingBox()\fP\&. (Subclasses should \fInot\fP override \fBSoNode::getBoundingBox()\fP\&.) .PP The \fIbox\fP parameter sent in is guaranteed to be an empty box, while \fIcenter\fP is undefined upon function entry\&. .PP Implements \fBSoShape\fP\&. .SS "\fBSoDetail\fP * SoText3::createTriangleDetail (\fBSoRayPickAction\fP *action, const \fBSoPrimitiveVertex\fP *v1, const \fBSoPrimitiveVertex\fP *v2, const \fBSoPrimitiveVertex\fP *v3, \fBSoPickedPoint\fP *pp)\fC [protected]\fP, \fC [virtual]\fP" Will create triangle detail for a \fBSoPickedPoint\fP\&. This method will only be called internally, when \fBgeneratePrimitives()\fP is used for picking (\fBSoShape::rayPick()\fP is not overridden)\&. .PP This method returns \fCNULL\fP in Open Inventor, and subclasses will need to override this method to create details for a \fBSoPickedPoint\fP\&. .PP This is not necessary with Coin\&. Of course, if you choose to override it, it will work in the same way as Open Inventor\&. .PP For this to work, you must supply a face or line detail when generating primitives\&. If you supply \fCNULL\fP for the detail argument in \fBSoShape::beginShape()\fP, you'll have to override this method\&. .PP Reimplemented from \fBSoShape\fP\&. .SS "void SoText3::notify (\fBSoNotList\fP *l)\fC [protected]\fP, \fC [virtual]\fP" Notifies all auditors for this instance when changes are made\&. .PP Reimplemented from \fBSoShape\fP\&. .SH "Member Data Documentation" .PP .SS "\fBSoMFString\fP SoText3::string" The strings to render\&. .PP Array defaults to contain a single empty string\&. .SS "\fBSoSFFloat\fP SoText3::spacing" Vertical spacing\&. 1\&.0 is the default spacing\&. .SS "\fBSoSFEnum\fP SoText3::justification" Horizontal justification\&. Default is alignment at the left border\&. .SS "\fBSoSFBitMask\fP SoText3::parts" Character parts\&. Default is to show only the front-facing part\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.