osg::QFieldLabelFactory Class Reference

#include <OSGQFieldLabelFactory.h>

List of all members.

Public Types

typedef QFieldValueLabelBase *(* LabelCreateF )(QFieldViewBase *, UInt32)

Public Member Functions

 ~QFieldLabelFactory (void)
bool registerLabel (const std::string &strFieldContentsName, LabelCreateF labelCreateFunc)
bool registerDefaultLabel (const std::string &strFieldContentsName, LabelCreateF labelCreateFunc)
QFieldValueLabelBasecreateLabel (QFieldViewBase *pView, UInt32 uiIndex)

Static Public Member Functions

static QFieldLabelFactorythe ()

Private Types

typedef std::map< std::string,
LabelCreateF
LabelMap
typedef std::map< std::string,
LabelCreateF >::iterator 
LabelMapIt

Private Member Functions

 QFieldLabelFactory (void)

Private Attributes

LabelMap _labelMap
LabelCreateF _defaultLabelCreateFunc

Static Private Attributes

static QFieldLabelFactory_the = 0


Detailed Description

Definition at line 59 of file OSGQFieldLabelFactory.h.


Member Typedef Documentation

typedef std::map<std::string, LabelCreateF> osg::QFieldLabelFactory::LabelMap [private]

Definition at line 76 of file OSGQFieldLabelFactory.h.

typedef std::map<std::string, LabelCreateF>::iterator osg::QFieldLabelFactory::LabelMapIt [private]

Definition at line 77 of file OSGQFieldLabelFactory.h.


Constructor & Destructor Documentation

QFieldLabelFactory::~QFieldLabelFactory ( void   ) 

Definition at line 64 of file OSGQFieldLabelFactory.cpp.

00065 {
00066 }

QFieldLabelFactory::QFieldLabelFactory ( void   )  [private]

Definition at line 104 of file OSGQFieldLabelFactory.cpp.


Member Function Documentation

QFieldLabelFactory & QFieldLabelFactory::the ( void   )  [static]

bool QFieldLabelFactory::registerLabel ( const std::string &  strFieldContentsName,
LabelCreateF  labelCreateFunc 
)

Definition at line 78 of file OSGQFieldLabelFactory.cpp.

References _labelMap.

Referenced by osg::QLabelRegisterWrapper< FieldLabelType >::QLabelRegisterWrapper().

00080 {
00081     _labelMap[strFieldContentName] = labelCreateFunc;
00082 
00083     return true;
00084 }

bool osg::QFieldLabelFactory::registerDefaultLabel ( const std::string &  strFieldContentsName,
LabelCreateF  labelCreateFunc 
)

QFieldValueLabelBase * QFieldLabelFactory::createLabel ( QFieldViewBase pView,
UInt32  uiIndex 
)

Definition at line 87 of file OSGQFieldLabelFactory.cpp.

References _defaultLabelCreateFunc, _labelMap, osg::TypeBase::getCName(), osg::Field::getContentType(), and osg::QFieldViewBase::getFieldPtr().

Referenced by osg::QMFieldView::acquireLabel(), osg::QSFieldView::initSelf(), and osg::QMFieldView::sizeHint().

00088 {
00089     const Char8 *szContentTypeName = 
00090         pView->getFieldPtr()->getContentType().getCName();
00091 
00092     LabelMapIt iter = _labelMap.find(szContentTypeName);
00093 
00094     if(iter != _labelMap.end())
00095     {
00096         return (*iter).second(pView, uiIndex);
00097     }
00098     else
00099     {
00100         return _defaultLabelCreateFunc(pView, uiIndex);
00101     }
00102 }


Member Data Documentation

Definition at line 81 of file OSGQFieldLabelFactory.h.

Referenced by the().

Definition at line 83 of file OSGQFieldLabelFactory.h.

Referenced by createLabel(), and registerLabel().

Definition at line 84 of file OSGQFieldLabelFactory.h.

Referenced by createLabel().


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

Generated on Mon Mar 17 11:29:14 2008 for OpenSG by  doxygen 1.5.5