From efea36541272d1aec5f1e30e320d7d87a92af7eb Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 10 Mar 2003 09:15:59 +0000 Subject: [PATCH] Moved the remain inline osg::Font methods into Font.cpp to avoid problems with the impossibly stupid visual studio compilers. --- include/osgText/Font | 21 +++++---- src/osgText/Font.cpp | 70 +++++++++++++++++++++++++++++ src/osgUtil/TriStrip_tri_stripper.h | 6 +-- 3 files changed, 83 insertions(+), 14 deletions(-) diff --git a/include/osgText/Font b/include/osgText/Font index 3b051dab8..47f0b44ac 100644 --- a/include/osgText/Font +++ b/include/osgText/Font @@ -60,8 +60,8 @@ public: /** Set the pixel width and height hint.*/ virtual void setSize(unsigned int width, unsigned int height); - unsigned int getWidth() { return _width; } - unsigned int getHeight() { return _height; } + unsigned int getWidth(); + unsigned int getHeight(); /** Get a Glyph for specified charcode, and the font size nearest to the current font size hint.*/ virtual Glyph* getGlyph(unsigned int charcode); @@ -72,37 +72,36 @@ public: /** Return true if this font provides vertical alignments and spacing or glyphs.*/ virtual bool hasVertical() const; - /** Set the margin around each glyph, * to ensure that texture filtering doesn't bleed adjacent glyph's into each other. * Default margin is 2 texels.*/ - void setGlyphImageMargin(unsigned int margin) { _margin = margin; } - unsigned int getGlyphImageMargin() const { return _margin; } + void setGlyphImageMargin(unsigned int margin); + unsigned int getGlyphImageMargin() const; /** Set the size of texture to create to store the glyph images when rendering. * Note, this doesn't affect already created Texture Glhph's.*/ void setTextureSizeHint(unsigned int width,unsigned int height); - unsigned int getTextureWidthHint() const { return _textureWidthHint; } - unsigned int getTextureHeightHint() const { return _textureWidthHint; } + unsigned int getTextureWidthHint() const; + unsigned int getTextureHeightHint() const; /** Set the minification texture filter to use when creating the texture to store the glyph images when rendering. * Note, this doesn't affect already created Texture Glhph's.*/ void setMinFilterHint(osg::Texture::FilterMode mode); - osg::Texture::FilterMode getMinFilterHint() const { return _minFilterHint; } + osg::Texture::FilterMode getMinFilterHint() const; /** Set the magnification texture filter to use when creating the texture to store the glyph images when rendering. * Note, this doesn't affect already created Texture Glhph's.*/ void setMagFilterHint(osg::Texture::FilterMode mode); - osg::Texture::FilterMode getMagFilterHint() const { return _magFilterHint; } + osg::Texture::FilterMode getMagFilterHint() const; // make Text a friend to allow it add and remove its entry in the Font's _textList. friend class FontImplementation; void setImplementation(FontImplementation* implementation); - FontImplementation* getImplementation() { return _implementation.get(); } - const FontImplementation* getImplementation() const { return _implementation.get(); } + FontImplementation* getImplementation(); + const FontImplementation* getImplementation() const; protected: diff --git a/src/osgText/Font.cpp b/src/osgText/Font.cpp index 25f8d5a44..a9905917d 100644 --- a/src/osgText/Font.cpp +++ b/src/osgText/Font.cpp @@ -99,6 +99,16 @@ void Font::setImplementation(FontImplementation* implementation) if (_implementation.valid()) _implementation->_facade = this; } +Font::FontImplementation* Font::getImplementation() +{ + return _implementation.get(); +} + +const Font::FontImplementation* Font::getImplementation() const +{ + return _implementation.get(); +} + std::string Font::getFileName() const { if (_implementation.valid()) return _implementation->getFileName(); @@ -110,6 +120,66 @@ void Font::setSize(unsigned int width, unsigned int height) if (_implementation.valid()) _implementation->setSize(width, height); } +unsigned int Font::getWidth() +{ + return _width; +} + +unsigned int Font::getHeight() +{ + return _height; +} + +void Font::setGlyphImageMargin(unsigned int margin) +{ + _margin = margin; +} + +unsigned int Font::getGlyphImageMargin() const +{ + return _margin; +} + +void Font::setTextureSizeHint(unsigned int width,unsigned int height) +{ + _textureWidthHint = width; + _textureHeightHint = height; +} + +unsigned int Font::getTextureWidthHint() const +{ + return _textureWidthHint; +} + +unsigned int Font::getTextureHeightHint() const +{ + return _textureHeightHint; +} + + +void Font::setMinFilterHint(osg::Texture::FilterMode mode) +{ + _minFilterHint = mode; +} + +osg::Texture::FilterMode Font::getMinFilterHint() const +{ + return _minFilterHint; +} + +/** Set the magnification texture filter to use when creating the texture to store the glyph images when rendering. + * Note, this doesn't affect already created Texture Glhph's.*/ +void Font::setMagFilterHint(osg::Texture::FilterMode mode) +{ + _magFilterHint = mode; +} + +osg::Texture::FilterMode Font::getMagFilterHint() const +{ + return _magFilterHint; +} + + Font::Glyph* Font::getGlyph(unsigned int charcode) { SizeGlyphMap::iterator itr = _sizeGlyphMap.find(SizePair(_width,_height)); diff --git a/src/osgUtil/TriStrip_tri_stripper.h b/src/osgUtil/TriStrip_tri_stripper.h index 3eecc937a..96cc696ca 100644 --- a/src/osgUtil/TriStrip_tri_stripper.h +++ b/src/osgUtil/TriStrip_tri_stripper.h @@ -188,11 +188,11 @@ public: // constructor/initializer - tri_stripper(const indices & TriIndices); + inline tri_stripper(const indices & TriIndices); // Settings functions - void SetCacheSize(const size_t CacheSize = 16); // = 0 will disable the cache optimizer - void SetMinStripSize(const size_t MinStripSize = 2); + inline void SetCacheSize(const size_t CacheSize = 16); // = 0 will disable the cache optimizer + inline void SetMinStripSize(const size_t MinStripSize = 2); // Stripper void Strip(primitives_vector * out_pPrimitivesVector); // throw triangles_indices_error();