| http://www.sim.no/ http://www.coin3d.org/

SoGlyph.h
1 #ifndef COIN_SOGLYPH_H
2 #define COIN_SOGLYPH_H
3
4 /**************************************************************************\
5 *
6 * This file is part of the Coin 3D visualization library.
7 * Copyright (C) by Kongsberg Oil & Gas Technologies.
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * ("GPL") version 2 as published by the Free Software Foundation.
12 * See the file LICENSE.GPL at the root directory of this source
13 * distribution for additional information about the GNU GPL.
14 *
15 * For using Coin with software that can not be combined with the GNU
16 * GPL, and for taking advantage of the additional benefits of our
17 * support services, please contact Kongsberg Oil & Gas Technologies
18 * about acquiring a Coin Professional Edition License.
19 *
20 * See http://www.coin3d.org/ for more information.
21 *
22 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24 *
25 \**************************************************************************/
26
27 #include <Inventor/SbBasic.h>
28 #include <Inventor/SbBox2f.h>
29 #include <Inventor/SbVec2s.h>
30 #include <Inventor/misc/SoState.h>
31
32 class SbName;
33 class SoGlyphP;
34
35 class COIN_DLL_API SoGlyph {
36 public:
37
38 enum Fonttype {
39 FONT2D = 1,
40 FONT3D = 2
41 };
42
43 void unref(void) const;
44
45 static const SoGlyph * getGlyph(const char character, const SbName & font);
46
47 const SbVec2f * getCoords(void) const;
48 const int * getFaceIndices(void) const;
49 const int * getEdgeIndices(void) const;
50 const int * getNextCWEdge(const int edgeidx) const;
51 const int * getNextCCWEdge(const int edgeidx) const;
52
53 float getWidth(void) const;
54 const SbBox2f & getBoundingBox(void) const;
55
56 static const SoGlyph * getGlyph(SoState * state,
57 const unsigned int character,
58 const SbVec2s & size,
59 const float angle);
60 SbVec2s getAdvance(void) const;
61 SbVec2s getKerning(const SoGlyph & rightglyph) const;
62 unsigned char * getBitmap(SbVec2s & size, SbVec2s & pos, const SbBool antialiased) const;
63
64 protected:
65 SoGlyph(void);
66 ~SoGlyph();
67
68 #if (COIN_MAJOR_VERSION == 2)
69 #error Reminder: when copying this file over to Coin-2, next 3 functions
70 #error must be changed back to take a non-const first argument -- to keep
71 #error ABI-compatibility. Do not change any other interfaces because of this,
72 #error but handle by doing work-around casting internally in SoGlyph.cpp.
73 #endif
74 void setCoords(const SbVec2f * coords, int numcoords = -1);
75 void setFaceIndices(const int * indices, int numindices = -1);
76 void setEdgeIndices(const int * indices, int numindices = -1);
77
78 private:
79 static void unrefGlyph(SoGlyph * glyph);
80 void setFontType(Fonttype type) const;
81
82
83 friend class SoGlyphP;
84 SoGlyphP * pimpl;
85 };
86
87 #endif // !COIN_SOGLYPH_H
SbVec2f
The SbVec2f class is a 2 dimensional vector with floating point coordinates.This vector class is used...
Definition: SbVec2f.h:39
SoState
The SoState class manages the Coin scenegraph traversal state data.The SoState class is used by actio...
Definition: SoState.h:35
SbBox2f
The SbBox2f class is a 2 dimensional box with floating point corner coordinates.This box class is use...
Definition: SbBox2f.h:33
SoGlyph
The SoGlyph class is used to generate and reuse font glyph bitmaps and outlines.
Definition: SoGlyph.h:35
SbVec2s
The SbVec2s class is a 2 dimensional vector with short integer coordinates.This vector class is used ...
Definition: SbVec2s.h:41
SbName
The SbName class stores strings by reference.The class is used by Coin for storing keywords...
Definition: SbName.h:31

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.