Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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

◆ AddFontBase()

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

Definition at line 35 of file G4OpenGLFontBaseStore.cc.

38 {
39 fFontBaseMap[viewer].push_back(FontInfo(fontName, size, fontBase, width));
40}

◆ GetFontInfo()

const G4OpenGLFontBaseStore::FontInfo & G4OpenGLFontBaseStore::GetFontInfo ( G4VViewer viewer,
G4double  size 
)
static

Definition at line 43 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:64

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