G4OpenGLFontBaseStore Class Reference

#include <G4OpenGLFontBaseStore.hh>


Static Public Member Functions

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

Data Structures

struct  FontInfo


Detailed Description

Definition at line 42 of file G4OpenGLFontBaseStore.hh.


Member Function Documentation

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

Definition at line 36 of file G4OpenGLFontBaseStore.cc.

00038               {
00039   fFontBaseMap[viewer].push_back(FontInfo(fontName, size, fontBase, width));
00040 }

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 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:47 2013 for Geant4 by  doxygen 1.4.7