VedaLibDemo/Object3DFontArial.h

00001 #ifndef COM_M4NKIND_Object3DFontArial_H
00002 #define COM_M4NKIND_Object3DFontArial_H
00003 
00004 #include "Object3DFontVirtual.h"
00005 #include "PackFloatByte_Limits.h"
00006 #include "PackULong_Flags.h"
00007 #include "PackList.h"
00008 /*!
00009     \class  Object3DFontArial
00010     \ingroup    BaseObjectInherited_VedaLibDemo
00011     \brief  Define a list of characters with 3D objects.
00012             This is a fast done font with a static shape.
00013 */
00014 
00015 class Object3DFontArial : public Object3DFontVirtual
00016 {
00017 /*==================================================================
00018                                 PUBLIC
00019 ==================================================================*/
00020 public:
00021     /*!
00022         \brief  Constructor. There should only be members initialisation there.
00023     */
00024     Object3DFontArial(void);
00025 
00026     /*!
00027         \brief  Class Inheritance Descriptors. Also forces a destructor. See BASEOBJECT_DECLARE_... in .cpp
00028     */
00029     BASEOBJECT_DEFINE_CLASS(Object3DFontArial);
00030     /*!
00031         \brief  Return the 3D shape index of the object that fit one character.
00032                 (then use index with RenderObject() )
00033                 a character is given with a zero-ended string because we can support
00034                 one byte character and more large char formats.
00035                 If the char is not supportd, we return false.
00036                 else,_rShapeIndex can return -1 if the char is space or tab.
00037         \param  _pString    zero ended char.
00038         \param  _rShapeIndex return index
00039         \param  _rCharWidth     the width of the char, to use them in the geometry.
00040     */
00041     virtual bool GetShapeIndexForCharacter( const char *_pString,
00042                                             int &_rShapeIndex,
00043                                             float &_rCharWidth );
00044 
00045 /*==================================================================
00046                                 PROTECTED
00047 ==================================================================*/
00048 protected:
00049     //! flags for all polygons
00050     //PackULong_Flags   mSer_Flags;   re-use and extend the flag member of VirtualObject.
00051 
00052     /*!
00053         \brief  Method that really build the object using the serializable parameters.
00054                 Close() should close everything opened by CreateInternal().
00055     */
00056     virtual bool CreateInternal(void);
00057 #ifdef _ENGINE_EDITABLE_
00058     /*!
00059         \brief  Closes everything.
00060     */
00061     //old virtual void  CloseInternal(void);
00062 #endif
00063     //! horrible static base of the font shape.
00064     static const signed char m_fontc[];
00065 
00066     //! \brief type for m_pCharTable .
00067     typedef struct {
00068         signed int  m_ShapeIndex;
00069         float       m_CharWidth;
00070     } FontBase ;
00071     //old FontBase  *m_pCharTable;
00072     //! precalculate a table with shape index.
00073     FontBase m_CharTable[256];
00074 
00075 };
00076 
00077 #endif

      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/