Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4OpenGLFontBaseStore Class Reference

#include <G4OpenGLFontBaseStore.hh>

Classes

struct  FontInfo
 

Static Public Member Functions

static void AddFontBase (G4VViewer *, G4int fontBase, G4double size, const G4String &fontName, G4int width)
 
static const FontInfoGetFontInfo (G4VViewer *, G4double size)
 

Detailed Description

Definition at line 42 of file G4OpenGLFontBaseStore.hh.

Member Function Documentation

void G4OpenGLFontBaseStore::AddFontBase ( G4VViewer viewer,
G4int  fontBase,
G4double  size,
const G4String fontName,
G4int  width 
)
static

Definition at line 36 of file G4OpenGLFontBaseStore.cc.

38  {
39  fFontBaseMap[viewer].push_back(FontInfo(fontName, size, fontBase, width));
40 }
const G4OpenGLFontBaseStore::FontInfo & G4OpenGLFontBaseStore::GetFontInfo ( G4VViewer viewer,
G4double  size 
)
static

Definition at line 44 of file G4OpenGLFontBaseStore.cc.

44  {
45  std::map<G4VViewer*,std::vector<FontInfo> >::const_iterator i =
46  fFontBaseMap.find(viewer);
47  if (i != fFontBaseMap.end()) {
48  G4double sizeDiscrepancy = 9999.;
49  std::vector<FontInfo>::const_iterator j, k;
50  for (j = i->second.begin(); j != i->second.end(); ++j) {
51  G4double d = std::abs(size - j->fSize);
52  if (d < sizeDiscrepancy) {
53  sizeDiscrepancy = d;
54  k = j;
55  }
56  }
57  return *k;
58  } else {
59  // No font found for requested viewer.
60  static const FontInfo nullFontInfo; // Default struct, fontBase = -1;
61  return nullFontInfo;
62  }
63 }
double G4double
Definition: G4Types.hh:76

The documentation for this class was generated from the following files: