1SoText2(3IV)()                                                  SoText2(3IV)()
2
3
4

NAME

6       SoText2 — screen-aligned 2D text shape node
7

INHERITS FROM

9       SoBase > SoFieldContainer > SoNode > SoShape > SoText2
10

SYNOPSIS

12       #include <Inventor/nodes/SoText2.h>
13
14     enum Justification {
15          SoText2::LEFT       Left edges of all strings are aligned
16          SoText2::RIGHT      Right edges of all strings are aligned
17          SoText2::CENTER     Centers of all strings are aligned
18     }
19
20          Fields from class SoText2:
21
22     SoMFString          string
23     SoSFFloat           spacing
24     SoSFEnum            justification
25
26          Methods from class SoText2:
27
28                         SoText2()
29     static SoType       getClassTypeId()
30
31          Methods from class SoNode:
32
33     void                setOverride(SbBool state)
34     SbBool              isOverride() const
35     SoNode *            copy(SbBool copyConnections = FALSE) const
36     virtual SbBool      affectsState() const
37     static SoNode *     getByName(const SbName &name)
38     static int          getByName(const SbName &name, SoNodeList &list)
39
40          Methods from class SoFieldContainer:
41
42     void                setToDefaults()
43     SbBool              hasDefaultValues() const
44     SbBool              fieldsAreEqual(const SoFieldContainer *fc) const
45     void                copyFieldValues(const  SoFieldContainer  *fc,  SbBool
46                              copyConnections = FALSE)
47     SbBool              set(const char *fieldDataString)
48     void                get(SbString &fieldDataString)
49     virtual int         getFields(SoFieldList &resultList) const
50     virtual SoField *   getField(const SbName &fieldName) const
51     SbBool              getFieldName(const SoField *field, SbName &fieldName)
52                              const
53     SbBool              isNotifyEnabled() const
54     SbBool              enableNotify(SbBool flag)
55
56          Methods from class SoBase:
57
58     void                ref()
59     void                unref() const
60     void                unrefNoDelete() const
61     void                touch()
62     virtual SoType      getTypeId() const
63     SbBool              isOfType(SoType type) const
64     virtual void        setName(const SbName &name)
65     virtual SbName      getName() const
66
67

DESCRIPTION

69       This  node  defines  one or more strings of 2D text. The text is always
70       aligned horizontally with the screen and does not change size with dis‐
71       tance  in a perspective projection. The text origin is at (0,0,0) after
72       applying the current  transformation.  Rotations  and  scales  have  no
73       effect on the orientation or size of 2D text, just the location.
74
75       SoText2  uses  the current font to determine the typeface and size. The
76       text is always drawn with the diffuse color of the current material; it
77       is  not lit, regardless of the lighting model. Furthermore, 2D text can
78       not be textured, and it ignores the current drawing style and  complex‐
79       ity.
80
81       Because 2D text is screen-aligned, it has some unusual characteristics.
82       For example, the 3D bounding box surrounding a 2D text  string  depends
83       on the current camera and the current viewport size, since changing the
84       field of view or the mapping onto the window changes the relative  size
85       of  the  text  with respect to the rest of the scene. This has implica‐
86       tions for caching as well, since a render cache in an SoSeparator  that
87       contains an SoText2 node depends on the current camera.
88

FIELDS

90     SoMFString          string
91          The  text  string(s)  to display. Each string will appear on its own
92          line. The string(s) can be ascii or UTF-8.
93
94     SoSFFloat           spacing
95          Defines the distance (in the negative y direction) between the  base
96          points  of  successive strings, measured with respect to the current
97          font height. A value of 1 indicates single spacing,  a  value  of  2
98          indicates double spacing, and so on.
99
100     SoSFEnum            justification
101          Indicates  placement  and alignment of strings. With LEFT justifica‐
102          tion, the left edge of the first line is at the  (transformed)  ori‐
103          gin, and all left edges are aligned. RIGHT justification is similar.
104          CENTER justification places the center of the first  string  at  the
105          (transformed)  origin,  with  the  centers  of all remaining strings
106          aligned under it.
107
108

METHODS

110                         SoText2()
111          Creates a 2D text node with default settings.
112
113     static SoType       getClassTypeId()
114          Returns type identifier for this class.
115
116

ACTION BEHAVIOR

118       SoGLRenderAction
119          Draws text based on the current font, at a  location  based  on  the
120          current transformation.
121
122     SoRayPickAction
123          Performs  a pick on the text. Text will be picked if the picking ray
124          intersects the bounding box of the strings.  The  string  index  and
125          character position are available from the SoTextDetail.
126
127     SoGetBoundingBoxAction
128          Computes the bounding box that encloses the text.
129
130

FILE FORMAT/DEFAULTS

132       Text2 {
133          string         ""
134          spacing        1
135          justification  LEFT
136     }
137

SEE ALSO

139       SoFont, SoText3, SoTextDetail
140
141
142
143
144                                                                SoText2(3IV)()
Impressum