Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoAnnoText3.h
Go to the documentation of this file.
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2017 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Nicolas DAGUISE (Oct 2004)
22**=======================================================================*/
23
24
25
26#ifndef _SO_ANNOT_TEXT_3_
27#define _SO_ANNOT_TEXT_3_
28
34
35class SoText2;
36class SoText3;
37
109class SoAnnoText3 : public SoShape {
110
112
113public:
114
120 LEFT = 0x01,
124 CENTER = 0x03,
128 RIGHT = 0x02,
132 INHERITED = 0x04
133 };
134
135 // Fields
141
149
165
170
171 private:
172
173 // Method to get the bounds of the given character in the given
174 // string. This must be called during the application of an
175 // action; use a callbackAction applied to a Path to the text node
176 // if you have to (this is really designed to be used in a Text3
177 // manipulator, which will have direct access to the state).
178 // The bounds are based on the font metric information, not the
179 // geometric bounding box of the character. So, for example,
180 // while a space character has an empty bounding box,
181 // getCharacterBounds() will return a box as high as the font
182 // height, as wide as a space, and as deep as the profile.
183 SbBox3f getCharacterBounds(SoState *state, int stringIndex, int charIndex);
184 virtual void GLRender(SoGLRenderAction *action);
185 virtual void rayPick(SoRayPickAction *action);
186 virtual void write(SoWriteAction *action);
187 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action);
188
189 // Computes bounding box of text
190 virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f &center);
191
192 private:
193 static void initClass();
194 static void exitClass();
195
196 SoSFNode m_text2Rep;
197 SoSFNode m_text3Rep;
198
199 private:
200
201 // Generates primitives
202 virtual void generatePrimitives(SoAction *);
203
204 virtual ~SoAnnoText3();
205
206};
207
208#endif // _SO_ANNOT_TEXT_3_
209
210
211
212
#define SO_NODE_HEADER(className)
Definition SoSubNode.h:151
3D box class.
Definition SbBox.h:649
3D vector class.
Definition SbVec.h:932
Abstract base class for all actions.
Definition SoAction.h:132
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Annotation text ...
SoAnnoText3()
Constructor.
SoSFNode alternateRep
This field optionally holds an SoText3 node that will be written out in place of this SoAnnoText3 nod...
SoMFString string
The text string(s) to display.
SoSFFloat spacing
Defines the distance (in the negative y direction) between the base points of successive strings,...
SoSFEnum justification
Indicates placement and alignment of strings.
Justification
Justification types.
@ CENTER
Center justification.
@ RIGHT
Right justification.
@ INHERITED
The text justification is inherited from the current SoTextProperty::alignmentH value.
@ LEFT
Left justification.
Renders a scene graph using Open Inventor's Render Engine.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Counts number of...
Multiple-value field containing any number of strings.
Definition SoMFString.h:116
Intersects objects with a ray cast into scene.
Field containing an enumerated value.
Definition SoSFEnum.h:89
Field containing a floating-point value.
Definition SoSFFloat.h:78
Field containing a a node.
Definition SoSFNode.h:97
Abstract base class for all shape nodes.
Definition SoShape.h:115
Traversal state.
Definition SoState.h:74
Screen-aligned 2D text shape node.
Definition SoText2.h:194
3D text shape node.
Definition SoText3.h:204
Writes a scene graph to a file.