#include <G4OpenGLFontBaseStore.hh>
Static Public Member Functions | |
static void | AddFontBase (G4VViewer *, G4int fontBase, G4double size, const G4String &fontName, G4int width) |
static const FontInfo & | GetFontInfo (G4VViewer *, G4double size) |
Data Structures | |
struct | FontInfo |
Definition at line 42 of file G4OpenGLFontBaseStore.hh.
void G4OpenGLFontBaseStore::AddFontBase | ( | G4VViewer * | , | |
G4int | fontBase, | |||
G4double | size, | |||
const G4String & | fontName, | |||
G4int | width | |||
) | [static] |
const G4OpenGLFontBaseStore::FontInfo & G4OpenGLFontBaseStore::GetFontInfo | ( | G4VViewer * | , | |
G4double | size | |||
) | [static] |
Definition at line 44 of file G4OpenGLFontBaseStore.cc.
00044 { 00045 std::map<G4VViewer*,std::vector<FontInfo> >::const_iterator i = 00046 fFontBaseMap.find(viewer); 00047 if (i != fFontBaseMap.end()) { 00048 G4double sizeDiscrepancy = 9999.; 00049 std::vector<FontInfo>::const_iterator j, k; 00050 for (j = i->second.begin(); j != i->second.end(); ++j) { 00051 G4double d = std::abs(size - j->fSize); 00052 if (d < sizeDiscrepancy) { 00053 sizeDiscrepancy = d; 00054 k = j; 00055 } 00056 } 00057 return *k; 00058 } else { 00059 // No font found for requested viewer. 00060 static const FontInfo nullFontInfo; // Default struct, fontBase = -1; 00061 return nullFontInfo; 00062 } 00063 }