Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

osg::QTypedFieldValueLabel< FieldContentsTypeT > Class Template Reference

Flyweight label template, which can be specialized for different field types.

#include <OSGQTypedFieldValueLabel.h>

Inheritance diagram for osg::QTypedFieldValueLabel< FieldContentsTypeT >:

osg::QGenericFieldValueLabel osg::QFieldValueLabelBase List of all members.

Public Types

typedef FieldContentsTypeT FieldContentsType

Public Member Functions

virtual void paint (QPainter *pPainter, const QColorGroup &colGrp, const QRect &rect)
virtual QSize sizeHint (void)
virtual QSize minimumSizeHint (void)
virtual void valueChanged (void)
void setIndex (UInt32 uiIndex)
UInt32 getIndex (void) const

Static Public Member Functions

static QFieldValueLabelBasecreate (QFieldViewBase *pView, UInt32 uiIndex)

Protected Member Functions

const QString & getCachedValue (void)
const QSize & getCachedSize (void)
QFieldViewBasegetFieldView (void)
const QFieldViewBasegetFieldView (void) const
FieldContainerPtrgetFieldContainer (void)
const FieldContainerPtrgetFieldContainer (void) const
UInt32 getFieldId (void) const
UInt32 getAspect (void) const
FieldgetFieldPtr (void)
const FieldgetFieldPtr (void) const

Private Types

typedef QGenericFieldValueLabel Inherited

Detailed Description

template<class FieldContentsTypeT>
class osg::QTypedFieldValueLabel< FieldContentsTypeT >

Definition at line 55 of file OSGQTypedFieldValueLabel.h.


Member Typedef Documentation

template<class FieldContentsTypeT>
typedef FieldContentsTypeT osg::QTypedFieldValueLabel< FieldContentsTypeT >::FieldContentsType
 

Definition at line 59 of file OSGQTypedFieldValueLabel.h.

template<class FieldContentsTypeT>
typedef QGenericFieldValueLabel osg::QTypedFieldValueLabel< FieldContentsTypeT >::Inherited [private]
 

Reimplemented from osg::QGenericFieldValueLabel.

Definition at line 62 of file OSGQTypedFieldValueLabel.h.


Member Function Documentation

QFieldValueLabelBase * QGenericFieldValueLabel::create QFieldViewBase pView,
UInt32  uiIndex
[static, inherited]
 

Create function, which is registered at the QFieldLabelFactory.

Definition at line 108 of file OSGQFieldValueLabel.cpp.

References osg::QGenericFieldValueLabel::QGenericFieldValueLabel().

00109 {
00110     return new QGenericFieldValueLabel(pView, uiIndex);
00111 }

void QGenericFieldValueLabel::paint QPainter *  pPainter,
const QColorGroup &  colGrp,
const QRect &  rect
[virtual, inherited]
 

Draws the text representation of a field value.

Implements osg::QFieldValueLabelBase.

Definition at line 124 of file OSGQFieldValueLabel.cpp.

References osg::QGenericFieldValueLabel::getCachedValue(), and osg::QGenericFieldValueLabel::sizeHint().

00126 {
00127     if(!rect.isValid())
00128         return;
00129 
00130     pPainter->save();
00131 
00132     pPainter->setPen  (colGrp.text());
00133     pPainter->setBrush(colGrp.base());
00134 
00135     if( (rect.width() < sizeHint().width())   || 
00136         (rect.height() < sizeHint().height())   )
00137     {
00138         pPainter->drawRect(rect);
00139 
00140         pPainter->drawText(rect, AlignVCenter, getCachedValue());
00141     }
00142     else
00143     {
00144         QRect rectText(rect.x()    +4, rect.y()     +4, 
00145                        rect.width()-8, rect.height()-8 );
00146 
00147         pPainter->drawRect(rect);
00148 
00149         pPainter->drawText(rectText, AlignVCenter, getCachedValue());
00150     }
00151 
00152     pPainter->restore();
00153 }

QSize QGenericFieldValueLabel::sizeHint void   )  [virtual, inherited]
 

Get the best size for this label.

Implements osg::QFieldValueLabelBase.

Definition at line 159 of file OSGQFieldValueLabel.cpp.

References osg::QGenericFieldValueLabel::getCachedSize().

Referenced by osg::QGenericFieldValueLabel::paint().

00160 {
00161     return QSize(getCachedSize().width()  + 8,
00162                  getCachedSize().height() + 8);
00163 }

QSize QGenericFieldValueLabel::minimumSizeHint void   )  [virtual, inherited]
 

Get the minimal size for this label.

Implements osg::QFieldValueLabelBase.

Definition at line 169 of file OSGQFieldValueLabel.cpp.

References osg::QGenericFieldValueLabel::getCachedSize().

00170 {
00171     return getCachedSize();
00172 }

void QGenericFieldValueLabel::valueChanged void   )  [virtual, inherited]
 

Tell the label, that the shown field's value has changed.

Implements osg::QFieldValueLabelBase.

Definition at line 178 of file OSGQFieldValueLabel.cpp.

References osg::QGenericFieldValueLabel::_bCacheValid.

00179 {
00180     _bCacheValid = false;
00181 }

const QString & QGenericFieldValueLabel::getCachedValue void   )  [protected, inherited]
 

Definition at line 184 of file OSGQFieldValueLabel.cpp.

References osg::QGenericFieldValueLabel::_strCachedVal, and osg::QGenericFieldValueLabel::updateCache().

Referenced by osg::QGenericFieldValueLabel::paint().

00185 {
00186     updateCache();
00187 
00188     return _strCachedVal;
00189 }

const QSize & QGenericFieldValueLabel::getCachedSize void   )  [protected, inherited]
 

Definition at line 192 of file OSGQFieldValueLabel.cpp.

References osg::QGenericFieldValueLabel::_cachedSize, and osg::QGenericFieldValueLabel::updateCache().

Referenced by osg::QGenericFieldValueLabel::minimumSizeHint(), and osg::QGenericFieldValueLabel::sizeHint().

00193 {
00194     updateCache();
00195 
00196     return _cachedSize;
00197 }

void QFieldValueLabelBase::setIndex UInt32  uiIndex  )  [inherited]
 

Definition at line 81 of file OSGQFieldValueLabel.cpp.

References osg::QFieldValueLabelBase::_uiIndex, and osg::QFieldValueLabelBase::valueChanged().

Referenced by osg::QMFieldView::acquireLabel().

00082 {
00083     _uiIndex = uiIndex;
00084 
00085     valueChanged();
00086 }

UInt32 osg::QFieldValueLabelBase::getIndex void   )  const [inline, inherited]
 

Definition at line 46 of file OSGQFieldValueLabel.inl.

References osg::QFieldValueLabelBase::_uiIndex.

Referenced by osg::QMFieldView::acquireLabel(), osg::QMFieldView::deleteAllLabels(), osg::QMFieldView::LabelInfo::getIndex(), osg::QMFieldView::redrawChanged(), osg::QMFieldView::releaseLabel(), osg::QVectorFieldValueLabel< VectorTypeT >::updateCache(), osg::QPointFieldValueLabel< PointTypeT >::updateCache(), osg::QMatrixFieldValueLabel< MatrixTypeT >::updateCache(), and osg::QGenericFieldValueLabel::updateCache().

00047 {
00048     return _uiIndex;
00049 }

QFieldViewBase * osg::QFieldValueLabelBase::getFieldView void   )  [inline, protected, inherited]
 

Definition at line 52 of file OSGQFieldValueLabel.inl.

References osg::QFieldValueLabelBase::_pView.

Referenced by osg::QVectorFieldValueLabel< VectorTypeT >::updateCache(), osg::QPointFieldValueLabel< PointTypeT >::updateCache(), osg::QMatrixFieldValueLabel< MatrixTypeT >::updateCache(), and osg::QGenericFieldValueLabel::updateCache().

00053 {
00054     return _pView;
00055 }

const QFieldViewBase * osg::QFieldValueLabelBase::getFieldView void   )  const [inline, protected, inherited]
 

Definition at line 58 of file OSGQFieldValueLabel.inl.

References osg::QFieldValueLabelBase::_pView.

00059 {
00060     return _pView;
00061 }

FieldContainerPtr & osg::QFieldValueLabelBase::getFieldContainer void   )  [inline, protected, inherited]
 

Definition at line 64 of file OSGQFieldValueLabel.inl.

References osg::QFieldValueLabelBase::_pView, and osg::QFieldViewBase::getFieldContainer().

00065 {
00066     return _pView->getFieldContainer();
00067 }

const FieldContainerPtr & osg::QFieldValueLabelBase::getFieldContainer void   )  const [inline, protected, inherited]
 

Definition at line 70 of file OSGQFieldValueLabel.inl.

References osg::QFieldValueLabelBase::_pView, and osg::QFieldViewBase::getFieldContainer().

00071 {
00072     return _pView->getFieldContainer();
00073 }

UInt32 osg::QFieldValueLabelBase::getFieldId void   )  const [inline, protected, inherited]
 

Definition at line 76 of file OSGQFieldValueLabel.inl.

References osg::QFieldValueLabelBase::_pView, and osg::QFieldViewBase::getFieldId().

00077 {
00078     return _pView->getFieldId();
00079 }

UInt32 osg::QFieldValueLabelBase::getAspect void   )  const [inline, protected, inherited]
 

Definition at line 82 of file OSGQFieldValueLabel.inl.

References osg::QFieldValueLabelBase::_pView, and osg::QFieldViewBase::getAspect().

00083 {
00084     return _pView->getAspect();
00085 }

Field * osg::QFieldValueLabelBase::getFieldPtr void   )  [inline, protected, inherited]
 

Definition at line 88 of file OSGQFieldValueLabel.inl.

References osg::QFieldValueLabelBase::_pView, and osg::QFieldViewBase::getFieldPtr().

Referenced by osg::QVectorFieldValueLabel< VectorTypeT >::updateCache(), osg::QPointFieldValueLabel< PointTypeT >::updateCache(), osg::QMatrixFieldValueLabel< MatrixTypeT >::updateCache(), and osg::QGenericFieldValueLabel::updateCache().

00089 {
00090     return _pView->getFieldPtr();
00091 }

const Field * osg::QFieldValueLabelBase::getFieldPtr void   )  const [inline, protected, inherited]
 

Definition at line 94 of file OSGQFieldValueLabel.inl.

References osg::QFieldValueLabelBase::_pView, and osg::QFieldViewBase::getFieldPtr().

00095 {
00096     return _pView->getFieldPtr();
00097 }


The documentation for this class was generated from the following file:
Generated on Thu Aug 25 04:31:36 2005 for OpenSG by  doxygen 1.4.3