OpendTect  6.6
odfontimplementation.h
Go to the documentation of this file.
1 #pragma once
2 /* -*-c++-*- OpenSceneGraph - Copyright (C) 2009-2010 Mathias Froehlich
3  *
4  * This library is open source and may be redistributed and/or modified under
5  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
6  * (at your option) any later version. The full license is in LICENSE file
7  * included with this distribution, and on the openscenegraph.org website.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * OpenSceneGraph Public License for more details.
13 */
14 
15 #include "uiosgmod.h"
16 #include "commondefs.h"
17 #include <osg/Version>
18 #include <osgText/Font>
19 #include <QtGui/QFont>
20 #include <string>
21 
22 mExpClass(uiOSG) ODFontImplementation : public osgText::Font::FontImplementation
23 {
24 public:
25  ODFontImplementation(const QFont& font);
27 
28  virtual std::string getFileName() const;
29 
30  virtual bool supportsMultipleFontResolutions() const { return true; }
31 
32  virtual osgText::Glyph* getGlyph(const osgText::FontResolution& fontRes,
33  unsigned int charcode);
34 #if OSG_MIN_VERSION_REQUIRED(3,6,0)
35  virtual osgText::Glyph3D* getGlyph3D(const osgText::FontResolution&,
36  unsigned int /*charcode*/)
37  { return nullptr; }
38 
39  virtual osg::Vec2 getKerning(const osgText::FontResolution&,
40  unsigned int leftcharcode,
41  unsigned int rightcharcode,
42  osgText::KerningType kerningType)
43  { return osg::Vec2(0,0); }
44 #else
45  virtual osgText::Glyph3D* getGlyph3D(unsigned int )
46  { return 0; }
47  virtual osg::Vec2 getKerning(unsigned int leftcharcode,
48  unsigned int rightcharcode,
49  osgText::KerningType kerningType)
50  { return osg::Vec2(0, 0); }
51 #endif
52 
53  virtual bool hasVertical() const
54  { return true; }
55 
56 protected:
57 
58  std::string _filename;
59  QFont _font;
60 };
ODFontImplementation::ODFontImplementation
ODFontImplementation(const QFont &font)
ODFontImplementation::getKerning
virtual osg::Vec2 getKerning(unsigned int leftcharcode, unsigned int rightcharcode, osgText::KerningType kerningType)
Definition: odfontimplementation.h:47
ODFontImplementation::_font
QFont _font
Definition: odfontimplementation.h:59
commondefs.h
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
ODFontImplementation::getFileName
virtual std::string getFileName() const
ODFontImplementation::supportsMultipleFontResolutions
virtual bool supportsMultipleFontResolutions() const
Definition: odfontimplementation.h:30
ODFontImplementation::getGlyph
virtual osgText::Glyph * getGlyph(const osgText::FontResolution &fontRes, unsigned int charcode)
ODFontImplementation::_filename
std::string _filename
Definition: odfontimplementation.h:58
ODFontImplementation::hasVertical
virtual bool hasVertical() const
Definition: odfontimplementation.h:53
ODFontImplementation::~ODFontImplementation
virtual ~ODFontImplementation()
ODFontImplementation::getGlyph3D
virtual osgText::Glyph3D * getGlyph3D(unsigned int)
Definition: odfontimplementation.h:45
ODFontImplementation
Definition: odfontimplementation.h:23

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2021