SoAsciiText - Online Linux Manual PageSection : 3
Updated : Mon Jan 25 2021
Source : Version 2.5.0
Note : Coin

NAMESoAsciiText − The SoAsciiText class renders flat 3D text​.

SYNOPSIS
#include <Inventor/nodes/SoAsciiText​.h> Inherits SoShape​.

Public Typesenum Justification { LEFT = 1, RIGHT, CENTER }

Public Member Functionsvirtual SoType getTypeId (void) const
SoAsciiText (void)
virtual void GLRender (SoGLRenderAction *action)
virtual void getPrimitiveCount (SoGetPrimitiveCountAction *action)

Static Public Member Functionsstatic SoType getClassTypeId (void)
static void initClass (void)

Public AttributesSoMFString string
SoSFFloat spacing
SoSFEnum justification
SoMFFloat width

Protected Member Functionsvirtual const SoFieldData * getFieldData (void) const
virtual ~SoAsciiText ()
virtual void computeBBox (SoAction *action, SbBox3f &box, SbVec3f ¢er)
virtual void generatePrimitives (SoAction *)
virtual SoDetail * createTriangleDetail (SoRayPickAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3, SoPickedPoint *pp)
virtual void notify (SoNotList *list)

Static Protected Member Functionsstatic const SoFieldData ** getFieldDataPtr (void)

Friendsclass SoAsciiTextP

Additional Inherited Members

Detailed DescriptionThe SoAsciiText class renders flat 3D text​. The text is rendered using 3D polygon 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​. 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 node is different from the SoText2 node in that it rotates, scales, translates etc just like other geometry in the scene​. It is different from the SoText3 node in that it renders the text 'flat', i​.e​. does not extrude the fonts to have depth​. To get an intuitive feeling for how SoAsciiText works, take a look at this sample Inventor file in examinerviewer: #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 } }In examinerviewer the Inventor file looks something like this: FILE FORMAT/DEFAULTS: AsciiText { string "" spacing 1 justification LEFT width 0 } Since Inventor 2​.1

Member Enumeration Documentation

enum SoAsciiText::JustificationThe font justification values control the text alignment​. Justification can have three distinct values​. The default value is SoAsciiText::LEFT, and the strings are rendered with a common left border​. The second value is SoAsciiText::RIGHT, and renders the strings with a common right border​. The last value is SoAsciiText::CENTER, 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​. Enumerator LEFT  The strings are left-aligned; rendered with a common left border​. This is the default alignment​. RIGHT  The strings are right-aligned; rendered with a common right border​. CENTER  The text is center-aligned; all strings are centered​.

Constructor & Destructor Documentation

SoAsciiText::SoAsciiText (void)Constructor​. References CENTER, justification, LEFT, RIGHT, spacing, and width​.

SoAsciiText::~SoAsciiText () [protected], [virtual]Destructor​.

Member Function Documentation

SoType SoAsciiText::getTypeId (void) const [virtual]Returns the type identification of an object derived from a class inheriting SoBase​. This is used for run-time type checking and 'downward' casting​. Usage example: void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } else if (node->getTypeId()​.isOfType(SoGroup::getClassTypeId())) { SoGroup * group = (SoGroup *)node; // safe downward cast, knows the type } }For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all 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 Inventor/nodes/SoSubNode​.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine​.h (for engine classes) and so on​. For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups​. Reimplemented from SoShape​.

const SoFieldData * SoAsciiText::getFieldData (void) const [protected], [virtual]Returns a pointer to the class-wide field data storage object for this instance​. If no fields are present, returns NULL​. Reimplemented from SoShape​.

void SoAsciiText::GLRender (SoGLRenderAction * action) [virtual]Action method for the SoGLRenderAction​. 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​. Reimplemented from SoShape​. References CENTER, SoAction::getState(), SoState::isElementEnabled(), justification, SoDebugError::postWarning(), RIGHT, SoShape::shouldGLRender(), and spacing​.

void SoAsciiText::getPrimitiveCount (SoGetPrimitiveCountAction * action) [virtual]Action method for the SoGetPrimitiveCountAction​. Calculates the number of triangle, line segment and point primitives for the node and adds these to the counters of the action​. Nodes influencing how geometry nodes calculates their primitive count also overrides this method to change the relevant state variables​. Reimplemented from SoShape​. References SoGetPrimitiveCountAction::addNumText(), SoGetPrimitiveCountAction::addNumTriangles(), SoAction::getState(), and SoGetPrimitiveCountAction::is3DTextCountedAsTriangles()​.

void SoAsciiText::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​. References CENTER, SbBox3f::extendBy(), SbBox3f::getCenter(), SbBox3f::getMin(), SoAction::getState(), SbBox3f::isEmpty(), justification, LEFT, RIGHT, SbBox3f::setBounds(), and spacing​.

void SoAsciiText::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​. References SoShape::beginShape(), CENTER, SoShape::endShape(), SoAction::getState(), justification, SoDebugError::postWarning(), RIGHT, SoTextDetail::setCharacterIndex(), SoPrimitiveVertex::setDetail(), SoPrimitiveVertex::setMaterialIndex(), SoPrimitiveVertex::setNormal(), SoTextDetail::setPart(), SoPrimitiveVertex::setPoint(), SoTextDetail::setStringIndex(), SoPrimitiveVertex::setTextureCoords(), SoShape::shapeVertex(), and spacing​.

SoDetail * SoAsciiText::createTriangleDetail (SoRayPickAction * action, const SoPrimitiveVertex * v1, const SoPrimitiveVertex * v2, const SoPrimitiveVertex * v3, SoPickedPoint * pp) [protected], [virtual]Will create triangle detail for a SoPickedPoint​. This method will only be called internally, when generatePrimitives() is used for picking (SoShape::rayPick() is not overridden)​. This method returns NULL in Open Inventor, and subclasses will need to override this method to create details for a SoPickedPoint​. This is not necessary with Coin​. Of course, if you choose to override it, it will work in the same way as Open Inventor​. For this to work, you must supply a face or line detail when generating primitives​. If you supply NULL for the detail argument in SoShape::beginShape(), you'll have to override this method​. Reimplemented from SoShape​. References SoDetail::copy(), and SoPrimitiveVertex::getDetail()​.

void SoAsciiText::notify (SoNotList * l) [protected], [virtual]Notifies all auditors for this instance when changes are made​. Reimplemented from SoShape​. References SoNotList::getLastField(), and SoShape::notify()​.

Member Data Documentation

SoMFString SoAsciiText::stringLines of text to render​. Several strings can be specified for this multifield, where each string represents a line​. Default value is a single empty string​.

SoSFFloat SoAsciiText::spacingSpacing between each line​. Defaults to 1​.0​. Referenced by computeBBox(), generatePrimitives(), GLRender(), and SoAsciiText()​.

SoSFEnum SoAsciiText::justificationHorizontal alignment​. Default SoAsciiText::LEFT​. Referenced by computeBBox(), generatePrimitives(), GLRender(), and SoAsciiText()​.

SoMFFloat SoAsciiText::widthDefines 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​. Referenced by SoAsciiText()​.

AuthorGenerated automatically by Doxygen for Coin from the source code​.
0
Johanes Gumabo
Data Size   :   48,640 byte
man-SoAsciiText.3coin2Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   4 / 192,658
Visitor ID   :     :  
Visitor IP   :   18.119.119.119   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.