00001 // Filename: geomTextGlyph.h 00002 // Created by: drose (11Feb02) 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 GEOMTEXTGLYPH_H 00020 #define GEOMTEXTGLYPH_H 00021 00022 #include "pandabase.h" 00023 00024 #ifdef HAVE_FREETYPE 00025 00026 #include "geomTristrip.h" 00027 #include "dynamicTextGlyph.h" 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Class : GeomTextGlyph 00031 // Description : This is a specialization on GeomTristrip for 00032 // containing a triangle strip intended to represent a 00033 // DynamicTextGlyph. Its sole purpose is to maintain 00034 // the geom count on the glyph, so we can determine the 00035 // actual usage count on a dynamic glyph (and thus know 00036 // when it is safe to recycle the glyph). 00037 //////////////////////////////////////////////////////////////////// 00038 class EXPCL_PANDA GeomTextGlyph : public GeomTristrip { 00039 public: 00040 INLINE GeomTextGlyph(DynamicTextGlyph *glyph); 00041 INLINE GeomTextGlyph(const GeomTextGlyph ©); 00042 void operator = (const GeomTextGlyph ©); 00043 virtual ~GeomTextGlyph(); 00044 00045 virtual Geom *make_copy() const; 00046 00047 private: 00048 PT(DynamicTextGlyph) _glyph; 00049 00050 public: 00051 static void register_with_read_factory(); 00052 static TypedWritable *make_GeomTextGlyph(const FactoryParams ¶ms); 00053 00054 PUBLISHED: 00055 static TypeHandle get_class_type() { 00056 return _type_handle; 00057 } 00058 public: 00059 static void init_type() { 00060 GeomTristrip::init_type(); 00061 register_type(_type_handle, "GeomTextGlyph", 00062 GeomTristrip::get_class_type()); 00063 } 00064 virtual TypeHandle get_type() const { 00065 return get_class_type(); 00066 } 00067 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00068 00069 private: 00070 static TypeHandle _type_handle; 00071 }; 00072 00073 #include "geomTextGlyph.I" 00074 00075 #endif // HAVE_FREETYPE 00076 00077 #endif // GEOMTEXTGLYPH_H