Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/text/dynamicTextGlyph.h

Go to the documentation of this file.
00001 // Filename: dynamicTextGlyph.h
00002 // Created by:  drose (09Feb02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef DYNAMICTEXTGLYPH_H
00020 #define DYNAMICTEXTGLYPH_H
00021 
00022 #include "pandabase.h"
00023 
00024 #ifdef HAVE_FREETYPE
00025 
00026 #include "textGlyph.h"
00027 
00028 class DynamicTextPage;
00029 
00030 ////////////////////////////////////////////////////////////////////
00031 //       Class : DynamicTextGlyph
00032 // Description : A specialization on TextGlyph that is generated and
00033 //               stored by a DynamicTextFont.  This keeps some
00034 //               additional information, such as where the glyph
00035 //               appears on a texture map.
00036 ////////////////////////////////////////////////////////////////////
00037 class EXPCL_PANDA DynamicTextGlyph : public TextGlyph {
00038 public:
00039   INLINE DynamicTextGlyph(DynamicTextPage *page, int x, int y,
00040                           int x_size, int y_size, int margin);
00041   INLINE DynamicTextGlyph(float advance);
00042 private:
00043   INLINE DynamicTextGlyph(const DynamicTextGlyph &copy);
00044   INLINE void operator = (const DynamicTextGlyph &copy);
00045 
00046 public:
00047   virtual ~DynamicTextGlyph();
00048 
00049   INLINE bool intersects(int x, int y, int x_size, int y_size) const;
00050   unsigned char *get_row(int y);
00051   void erase();
00052   void make_geom(int top, int left, float advance, float poly_margin,
00053                  float tex_x_size, float tex_y_size,
00054                  float font_pixels_per_unit, float tex_pixels_per_unit);
00055 
00056   DynamicTextPage *_page;
00057   int _geom_count;
00058 
00059   int _x, _y;
00060   int _x_size, _y_size;
00061   int _margin;
00062 };
00063 
00064 #include "dynamicTextGlyph.I"
00065 
00066 #endif  // HAVE_FREETYPE
00067 
00068 #endif

Generated on Fri May 2 00:44:15 2003 for Panda by doxygen1.3