Coin Logo 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) 1998-2007 by Systems in Motion. All rights reserved.
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 Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, 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  void setCoords(SbVec2f * coords, int numcoords = -1);
69  void setFaceIndices(int * indices, int numindices = -1);
70  void setEdgeIndices(int * indices, int numindices = -1);
71 
72 private:
73  void setFontType(Fonttype type) const;
74  static void unrefGlyph(SoGlyph * glyph);
75 
76  friend class SoGlyphP;
77  SoGlyphP * pimpl;
78 };
79 
80 #endif // !COIN_SOGLYPH_H
SoState
The SoState class manages the Coin scenegraph traversal state data.
Definition: SoState.h:35
SbName
The SbName class stores strings by reference.
Definition: SbName.h:31
SbVec2f
The SbVec2f class is a 2 dimensional vector with floating point coordinates.
Definition: SbVec2f.h:36
SoGlyph::getWidth
float getWidth(void) const
Definition: SoGlyph.cpp:265
SoGlyph::getBoundingBox
const SbBox2f & getBoundingBox(void) const
Definition: SoGlyph.cpp:279
SoGlyph::getFaceIndices
const int * getFaceIndices(void) const
Definition: SoGlyph.cpp:193
SoGlyph::setEdgeIndices
void setEdgeIndices(int *indices, int numindices=-1)
Definition: SoGlyph.cpp:359
SoGlyph::setFaceIndices
void setFaceIndices(int *indices, int numindices=-1)
Definition: SoGlyph.cpp:340
SoGlyph
The SoGlyph class is used to generate and reuse font glyph bitmaps and outlines.
Definition: SoGlyph.h:35
SbBox2f::getMax
const SbVec2f & getMax(void) const
Definition: SbBox2f.cpp:174
SbString
The SbString class is a string class with convenience functions for string operations.
Definition: SbString.h:42
SoGlyph::getNextCCWEdge
const int * getNextCCWEdge(const int edgeidx) const
Definition: SoGlyph.cpp:245
SoGlyph::~SoGlyph
~SoGlyph()
Definition: SoGlyph.cpp:143
SbVec2s
The SbVec2s class is a 2 dimensional vector with short integer coordinates.
Definition: SbVec2s.h:37
SbList
The SbList class is a template container class for lists.
Definition: SoType.h:46
SbName::getString
const char * getString(void) const
Definition: SbName.cpp:278
SoGlyph::getGlyph
static const SoGlyph * getGlyph(const char character, const SbName &font)
Definition: SoGlyph.cpp:439
SoGlyph::getNextCWEdge
const int * getNextCWEdge(const int edgeidx) const
Definition: SoGlyph.cpp:222
SoGlyph::setCoords
void setCoords(SbVec2f *coords, int numcoords=-1)
Definition: SoGlyph.cpp:321
SbBox2f
The SbBox2f class is a 2 dimensional box with floating point corner coordinates.
Definition: SbBox2f.h:33
SoGlyph::getBitmap
unsigned char * getBitmap(SbVec2s &size, SbVec2s &pos, const SbBool antialiased) const
Definition: SoGlyph.cpp:649
SoGlyph::getCoords
const SbVec2f * getCoords(void) const
Definition: SoGlyph.cpp:180
SoGlyph::unref
void unref(void) const
Definition: SoGlyph.cpp:153
SbString::getString
const char * getString(void) const
Definition: SbString.h:71
SoGlyph::getEdgeIndices
const int * getEdgeIndices(void) const
Definition: SoGlyph.cpp:207
SbBox2f::getMin
const SbVec2f & getMin(void) const
Definition: SbBox2f.cpp:153
SoGlyph::SoGlyph
SoGlyph(void)
Definition: SoGlyph.cpp:117

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Wed Jul 24 2019 for Coin by Doxygen. 1.8.17