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-2017 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 00109 class SoAnnoText3 : public SoShape { 00110 00111 SO_NODE_HEADER(SoAnnoText3); 00112 00113 public: 00114 00116 enum Justification { 00120 LEFT = 0x01, 00124 CENTER = 0x03, 00128 RIGHT = 0x02, 00132 INHERITED = 0x04 00133 }; 00134 00135 // Fields 00140 SoMFString string; 00141 00148 SoSFFloat spacing; 00149 00158 SoSFEnum justification; 00164 SoSFNode alternateRep; 00165 00169 SoAnnoText3(); 00170 00171 private: 00172 00173 // Method to get the bounds of the given character in the given 00174 // string. This must be called during the application of an 00175 // action; use a callbackAction applied to a Path to the text node 00176 // if you have to (this is really designed to be used in a Text3 00177 // manipulator, which will have direct access to the state). 00178 // The bounds are based on the font metric information, not the 00179 // geometric bounding box of the character. So, for example, 00180 // while a space character has an empty bounding box, 00181 // getCharacterBounds() will return a box as high as the font 00182 // height, as wide as a space, and as deep as the profile. 00183 SbBox3f getCharacterBounds(SoState *state, int stringIndex, int charIndex); 00184 virtual void GLRender(SoGLRenderAction *action); 00185 virtual void rayPick(SoRayPickAction *action); 00186 virtual void write(SoWriteAction *action); 00187 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action); 00188 00189 // Computes bounding box of text 00190 virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er); 00191 00192 private: 00193 static void initClass(); 00194 static void exitClass(); 00195 00196 SoSFNode m_text2Rep; 00197 SoSFNode m_text3Rep; 00198 00199 private: 00200 00201 // Generates primitives 00202 virtual void generatePrimitives(SoAction *); 00203 00204 virtual ~SoAnnoText3(); 00205 00206 }; 00207 00208 #endif // _SO_ANNOT_TEXT_3_ 00209 00210 00211 00212 00213