00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : Nicolas DAGUISE (Oct 2004) 00022 **=======================================================================*/ 00023 00024 00025 00026 #ifndef _SO_ANNOT_TEXT_3_ 00027 #define _SO_ANNOT_TEXT_3_ 00028 00029 #include <Inventor/fields/SoMFString.h> 00030 #include <Inventor/fields/SoSFEnum.h> 00031 #include <Inventor/fields/SoSFFloat.h> 00032 #include <Inventor/fields/SoSFNode.h> 00033 #include <Inventor/nodes/SoShape.h> 00034 00035 class SoText2; 00036 class SoText3; 00037 00110 class SoAnnoText3 : public SoShape { 00111 00112 SO_NODE_HEADER(SoAnnoText3); 00113 00114 public: 00115 00117 enum Justification { 00121 LEFT = 0x01, 00125 CENTER = 0x03, 00129 RIGHT = 0x02, 00133 INHERITED = 0x04 00134 }; 00135 00136 // Fields 00141 SoMFString string; 00142 00149 SoSFFloat spacing; 00150 00159 SoSFEnum justification; 00165 SoSFNode alternateRep; 00166 00170 SoAnnoText3(); 00171 00172 private: 00173 00174 // Method to get the bounds of the given character in the given 00175 // string. This must be called during the application of an 00176 // action; use a callbackAction applied to a Path to the text node 00177 // if you have to (this is really designed to be used in a Text3 00178 // manipulator, which will have direct access to the state). 00179 // The bounds are based on the font metric information, not the 00180 // geometric bounding box of the character. So, for example, 00181 // while a space character has an empty bounding box, 00182 // getCharacterBounds() will return a box as high as the font 00183 // height, as wide as a space, and as deep as the profile. 00184 SbBox3f getCharacterBounds(SoState *state, int stringIndex, int charIndex); 00185 virtual void GLRender(SoGLRenderAction *action); 00186 virtual void rayPick(SoRayPickAction *action); 00187 virtual void write(SoWriteAction *action); 00188 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action); 00189 00190 // Computes bounding box of text 00191 virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er); 00192 00193 private: 00194 static void initClass(); 00195 static void exitClass(); 00196 00197 SoSFNode m_text2Rep; 00198 SoSFNode m_text3Rep; 00199 00200 private: 00201 00202 // Generates primitives 00203 virtual void generatePrimitives(SoAction *); 00204 00205 virtual ~SoAnnoText3(); 00206 00207 }; 00208 00209 #endif // _SO_ANNOT_TEXT_3_ 00210 00211 00212 00213 00214