.TH "SoAsciiText" 3 "Sat Oct 12 2013" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoAsciiText \- .PP The \fBSoAsciiText\fP class renders flat 3D text\&. .PP The text is rendered using 3D polygon geometry\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoShape\fP\&. .SS "Public Types" .in +1c .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 "\fBSoAsciiText\fP (void)" .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 .RI "\fIThis static method returns the \fBSoType\fP object associated with objects of this class\&. \fP" .ti -1c .RI "static void \fBinitClass\fP (void)" .br .RI "\fISets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system\&. \fP" .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 "\fBSoMFFloat\fP \fBwidth\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 \fB~SoAsciiText\fP ()" .br .ti -1c .RI "virtual void \fBcomputeBBox\fP (\fBSoAction\fP *action, \fBSbBox3f\fP &box, \fBSbVec3f\fP ¢er)" .br .ti -1c .RI "virtual void \fBgeneratePrimitives\fP (\fBSoAction\fP *)" .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 \fBSoAsciiText\fP class renders flat 3D text\&. .PP The text is rendered using 3D polygon 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 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 node is different from the \fBSoText2\fP node in that it rotates, scales, translates etc just like other geometry in the scene\&. It is different from the \fBSoText3\fP node in that it renders the text 'flat', i\&.e\&. does not extrude the fonts to have depth\&. .PP To get an intuitive feeling for how \fBSoAsciiText\fP works, take a look at this sample Inventor file in examinerviewer: .PP .PP .nf #Inventor V2.1 ascii Separator { Font { size 10 name "Arial:Bold Italic" } BaseColor { rgb 1 0 0 #red } AsciiText { width [ 0, 1, 50 ] justification LEFT #Standard alignment string [ "LEFT", "LEFT", "LEFT", "LEFT", "LEFT LEFT" ] } BaseColor { rgb 1 1 0 } Sphere { radius 1.5 } Translation { translation 0 -50 0 } BaseColor { rgb 0 1 0 #green } AsciiText { width [ 0, 1, 50 ] justification RIGHT string [ "RIGHT", "RIGHT", "RIGHT", "RIGHT", "RIGHT RIGHT" ] } BaseColor { rgb 0 1 1 } Sphere { radius 1.5 } Translation { translation 0 -50 0 } BaseColor { rgb 0 0 1 #blue } AsciiText { width [ 0, 1, 50 ] justification CENTER string [ "CENTER", "CENTER", "CENTER", "CENTER", "CENTER CENTER" ] } BaseColor { rgb 1 0 1 } Sphere { radius 1.5 } } .fi .PP .PP In examinerviewer the Inventor file looks something like this: .PP .PP \fBFILE FORMAT/DEFAULTS:\fP .PP .nf AsciiText { string '' spacing 1 justification LEFT width 0 } .fi .PP .PP \fBSince:\fP .RS 4 Inventor 2\&.1 .RE .PP .SH "Member Enumeration Documentation" .PP .SS "enum \fBSoAsciiText::Justification\fP" The font justification values control the text alignment\&. Justification can have three distinct values\&. The default value is \fBSoAsciiText::LEFT\fP, and the strings are rendered with a common left border\&. The second value is \fBSoAsciiText::RIGHT\fP, and renders the strings with a common right border\&. The last value is \fBSoAsciiText::CENTER\fP, in which the strings are rendered with their centers aligned\&. The origo of the three alignments are respectively left, right and center, located at the baseline of the first line of text\&. .PP \fBEnumerator: \fP .in +1c .TP \fB\fILEFT \fP\fP The strings are left-aligned; rendered with a common left border\&. This is the default alignment\&. .TP \fB\fIRIGHT \fP\fP The strings are right-aligned; rendered with a common right border\&. .TP \fB\fICENTER \fP\fP The text is center-aligned; all strings are centered\&. .SH "Constructor & Destructor Documentation" .PP .SS "SoAsciiText::SoAsciiText (void)" Constructor\&. .SS "SoAsciiText::~SoAsciiText ()\fC [protected]\fP, \fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoAsciiText::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 ** SoAsciiText::getFieldDataPtr (void)\fC [static]\fP, \fC [protected]\fP" \fIThis API member is considered internal to the library, as it is not likely to be of interest to the application programmer\&.\fP .PP Reimplemented from \fBSoShape\fP\&. .SS "const \fBSoFieldData\fP * SoAsciiText::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 "void SoAsciiText::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 SoAsciiText::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 SoAsciiText::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 "void SoAsciiText::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 "\fBSoDetail\fP * SoAsciiText::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 SoAsciiText::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 SoAsciiText::string" Lines of text to render\&. Several strings can be specified for this multifield, where each string represents a line\&. .PP Default value is a single empty string\&. .SS "\fBSoSFFloat\fP SoAsciiText::spacing" Spacing between each line\&. Defaults to 1\&.0\&. .SS "\fBSoSFEnum\fP SoAsciiText::justification" Horizontal alignment\&. Default \fBSoAsciiText::LEFT\fP\&. .SS "\fBSoMFFloat\fP SoAsciiText::width" Defines the width of each line\&. The text is scaled to be within the specified units\&. The size of the characters will remain the same; only the the x-positions are scaled\&. When width <= 0, the width value is ignored and the text rendered as normal\&. The exact width of the rendered text depends not only on the width field, but also on the maximum character width in the rendered string\&. The string will be attempted to fit within the specified width, but if it is unable to do so, it uses the largest character in the string as the width\&. If fewer widths are specified than the number of strings, the strings without matching widths are rendered with default width\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.