00001 #ifndef COIN_SOASCIITEXT_H
00002 #define COIN_SOASCIITEXT_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <Inventor/nodes/SoSubNode.h>
00028 #include <Inventor/nodes/SoShape.h>
00029 #include <Inventor/fields/SoMFString.h>
00030 #include <Inventor/fields/SoSFFloat.h>
00031 #include <Inventor/fields/SoSFEnum.h>
00032 #include <Inventor/fields/SoMFFloat.h>
00033 #include <Inventor/lists/SbList.h>
00034
00035 class COIN_DLL_API SoAsciiText : public SoShape {
00036 typedef SoShape inherited;
00037
00038 SO_NODE_HEADER(SoAsciiText);
00039
00040 public:
00041 static void initClass(void);
00042 SoAsciiText(void);
00043
00044 enum Justification {
00045 LEFT = 1,
00046 RIGHT,
00047 CENTER
00048 };
00049
00050 SoMFString string;
00051 SoSFFloat spacing;
00052 SoSFEnum justification;
00053 SoMFFloat width;
00054
00055 virtual void GLRender(SoGLRenderAction * action);
00056 virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
00057
00058 protected:
00059 virtual ~SoAsciiText();
00060
00061 virtual void computeBBox(SoAction * action, SbBox3f & box, SbVec3f & center);
00062 virtual void generatePrimitives(SoAction *);
00063
00064 virtual SoDetail * createTriangleDetail(SoRayPickAction * action,
00065 const SoPrimitiveVertex * v1,
00066 const SoPrimitiveVertex * v2,
00067 const SoPrimitiveVertex * v3,
00068 SoPickedPoint * pp);
00069 virtual void notify(SoNotList * list);
00070
00071 private:
00072 class SoAsciiTextP * pimpl;
00073 friend class SoAsciiTextP;
00074
00075 float getWidth(const int idx, const float fontsize);
00076 };
00077
00078 #endif // !COIN_SOASCIITEXT_H