osg::GraphicStatisticsForeground Class Reference

Graphics Statistics Foreground class. See Graphic Statistics Foreground for a description. More...

#include <OSGGraphicStatisticsForeground.h>

Inheritance diagram for osg::GraphicStatisticsForeground:

osg::GraphicStatisticsForegroundBase osg::StatisticsForeground osg::StatisticsForegroundBase osg::Foreground osg::ForegroundBase osg::AttachmentContainer osg::FieldContainer

List of all members.

Public Types

enum  Type {
  OSG_ANALOG = 0, OSG_BAR = 1, OSG_CHART = 2, OSG_LINE_CHART = 3,
  OSG_TEXT = 4
}
enum  Mode {
  OSG_OVERFLOW_RESIZE = 1, OSG_UNDERFLOW_RESIZE = 2, OSG_RECIPROC = 4, OSG_SMOOTH = 8,
  OSG_ENABLE_POINTS = 16, OSG_MAX_TEXT = 32, OSG_MIN_TEXT = 64
}
enum  TextHA { OSG_LEFT = 0, OSG_RIGHT = 1, OSG_CENTER = 2 }
enum  TextVA { OSG_BOTTOM = 0, OSG_MIDDLE = 1, OSG_TOP = 2 }
enum  {
  DisplayTypeFieldId = Inherited::NextFieldId, SizeFieldId = DisplayTypeFieldId + 1, PosFieldId = SizeFieldId + 1, ColorMaxFieldId = PosFieldId + 1,
  ColorMinFieldId = ColorMaxFieldId + 1, ColorCurrentFieldId = ColorMinFieldId + 1, MinValueFieldId = ColorCurrentFieldId + 1, MaxValueFieldId = MinValueFieldId + 1,
  FlagsFieldId = MaxValueFieldId + 1, HistorySizeFieldId = FlagsFieldId + 1, DescriptionFieldId = HistorySizeFieldId + 1, LineWidthFieldId = DescriptionFieldId + 1,
  BackgroundColorFieldId = LineWidthFieldId + 1, TextEnabledFieldId = BackgroundColorFieldId + 1, BackgroundEnabledFieldId = TextEnabledFieldId + 1, BorderEnabledFieldId = BackgroundEnabledFieldId + 1,
  NextFieldId = BorderEnabledFieldId + 1
}
typedef
GraphicStatisticsForegroundPtr 
Ptr
enum  { ElementIDsFieldId = Inherited::NextFieldId, CollectorFieldId = ElementIDsFieldId + 1, NextFieldId = CollectorFieldId + 1 }
enum  { ActiveFieldId = Inherited::NextFieldId, NextFieldId = ActiveFieldId + 1 }
enum  { AttachmentsFieldId = Inherited::NextFieldId, NextFieldId = AttachmentsFieldId + 1 }
enum  { NextFieldId = 1 }

Public Member Functions

Sync


virtual void changed (BitVector whichField, UInt32 from)
Output


virtual void dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const
void draw (DrawActionBase *, Viewport *)
 draws the forground
void addElement (StatElemDescBase &desc, UInt32 displayType, Vec2f pos, Vec2f size, Color4f highColor, Color4f lowColor, Color4f currentColor, Real32 minValue=0.0, Real32 maxValue=0.0, UInt32 Flags=OSG_UNDERFLOW_RESIZE|OSG_OVERFLOW_RESIZE, UInt32 historySize=0, std::string description="")
 Add an Element to be shown.
void removeElement (StatElemDescBase &desc)
FieldContainer Get


virtual FieldContainerTypegetType (void)
virtual const FieldContainerTypegetType (void) const
virtual UInt32 getContainerSize (void) const
Field Get


MFStringgetMFDescription (void)
 Get the GraphicStatisticsForeground::_mfDescription field.
SFReal32getSFLineWidth (void)
 Get the GraphicStatisticsForeground::_sfLineWidth field.
SFColor3fgetSFBackgroundColor (void)
 Get the GraphicStatisticsForeground::_sfBackgroundColor field.
SFBoolgetSFTextEnabled (void)
 Get the GraphicStatisticsForeground::_sfTextEnabled field.
SFBoolgetSFBackgroundEnabled (void)
 Get the GraphicStatisticsForeground::_sfBackgroundEnabled field.
SFBoolgetSFBorderEnabled (void)
 Get the GraphicStatisticsForeground::_sfBorderEnabled field.
Real32getLineWidth (void)
 Get the value of the GraphicStatisticsForeground::_sfLineWidth field.
const Real32getLineWidth (void) const
 Get the value of the GraphicStatisticsForeground::_sfLineWidth field.
Color3fgetBackgroundColor (void)
 Get the value of the GraphicStatisticsForeground::_sfBackgroundColor field.
const Color3fgetBackgroundColor (void) const
 Get the value of the GraphicStatisticsForeground::_sfBackgroundColor field.
bool & getTextEnabled (void)
 Get the value of the GraphicStatisticsForeground::_sfTextEnabled field.
const bool & getTextEnabled (void) const
 Get the value of the GraphicStatisticsForeground::_sfTextEnabled field.
bool & getBackgroundEnabled (void)
 Get the value of the GraphicStatisticsForeground::_sfBackgroundEnabled field.
const bool & getBackgroundEnabled (void) const
 Get the value of the GraphicStatisticsForeground::_sfBackgroundEnabled field.
bool & getBorderEnabled (void)
 Get the value of the GraphicStatisticsForeground::_sfBorderEnabled field.
const bool & getBorderEnabled (void) const
 Get the value of the GraphicStatisticsForeground::_sfBorderEnabled field.
std::string & getDescription (const UInt32 index)
 Get the value of the index element the GraphicStatisticsForeground::_mfDescription field.
MFStringgetDescription (void)
 Get the GraphicStatisticsForeground::_mfDescription field.
const MFStringgetDescription (void) const
 Get the GraphicStatisticsForeground::_mfDescription field.
Field Set


void setLineWidth (const Real32 &value)
 Set the value of the GraphicStatisticsForeground::_sfLineWidth field.
void setBackgroundColor (const Color3f &value)
 Set the value of the GraphicStatisticsForeground::_sfBackgroundColor field.
void setTextEnabled (const bool &value)
 Set the value of the GraphicStatisticsForeground::_sfTextEnabled field.
void setBackgroundEnabled (const bool &value)
 Set the value of the GraphicStatisticsForeground::_sfBackgroundEnabled field.
void setBorderEnabled (const bool &value)
 Set the value of the GraphicStatisticsForeground::_sfBorderEnabled field.
Binary Access
virtual UInt32 getBinSize (const BitVector &whichField)
virtual void copyToBin (BinaryDataHandler &pMem, const BitVector &whichField)
virtual void copyFromBin (BinaryDataHandler &pMem, const BitVector &whichField)
Copy


virtual FieldContainerPtr shallowCopy (void) const
Field Get


MFInt32getMFElementIDs (void)
 Get the StatisticsForeground::_mfElementIDs field.
SFStatCollectorgetSFCollector (void)
 Get the StatisticsForeground::_sfCollector field.
StatCollectorgetCollector (void)
 Get the value of the StatisticsForeground::_sfCollector field.
const StatCollectorgetCollector (void) const
 Get the value of the StatisticsForeground::_sfCollector field.
Int32getElementIDs (const UInt32 index)
 Get the value of the index element the StatisticsForeground::_mfElementIDs field.
MFInt32getElementIDs (void)
 Get the StatisticsForeground::_mfElementIDs field.
const MFInt32getElementIDs (void) const
 Get the StatisticsForeground::_mfElementIDs field.
Field Set


void setCollector (const StatCollector &value)
 Set the value of the StatisticsForeground::_sfCollector field.
Field Get


SFBoolgetSFActive (void)
 Get the Foreground::_sfActive field.
bool & getActive (void)
 Get the value of the Foreground::_sfActive field.
const bool & getActive (void) const
 Get the value of the Foreground::_sfActive field.
Field Set


void setActive (const bool &value)
 Set the value of the Foreground::_sfActive field.
Handle Attachments


void addAttachment (const AttachmentPtr &fieldContainerP, UInt16 binding=0)
void subAttachment (const AttachmentPtr &fieldContainerP, UInt16 binding=0)
AttachmentPtr findAttachment (UInt32 groupId, UInt16 binding=0)
AttachmentPtr findAttachment (const FieldContainerType &type, UInt16 binding=0)


SFAttachmentMapgetSFAttachments (void)
Get Instance Type Information


UInt32 getTypeId (void) const
UInt16 getGroupId (void) const
const Char8getTypeName (void) const


FieldgetField (UInt32 fieldId)
FieldgetField (const Char8 *fieldName)

Static Public Member Functions

Class Get


static FieldContainerTypegetClassType (void)
 access the type of the class
static UInt32 getClassTypeId (void)
 access the numerical type of the class
Construction


static
GraphicStatisticsForegroundPtr 
create (void)
 create a new instance of the class
static
GraphicStatisticsForegroundPtr 
createEmpty (void)
 create an empty new instance of the class, do not copy the prototype
Class Get


static const char * getClassname (void)
Get Class Type Information


static UInt16 getClassGroupId (void)

Static Public Attributes

static const osg::BitVector DisplayTypeFieldMask
static const osg::BitVector SizeFieldMask
static const osg::BitVector PosFieldMask
static const osg::BitVector ColorMaxFieldMask
static const osg::BitVector ColorMinFieldMask
static const osg::BitVector ColorCurrentFieldMask
static const osg::BitVector MinValueFieldMask
static const osg::BitVector MaxValueFieldMask
static const osg::BitVector FlagsFieldMask
static const osg::BitVector HistorySizeFieldMask
static const osg::BitVector DescriptionFieldMask
static const osg::BitVector LineWidthFieldMask
static const osg::BitVector BackgroundColorFieldMask
static const osg::BitVector TextEnabledFieldMask
static const osg::BitVector BackgroundEnabledFieldMask
static const osg::BitVector BorderEnabledFieldMask
static const osg::BitVector MTInfluenceMask
static const osg::BitVector ElementIDsFieldMask
static const osg::BitVector CollectorFieldMask
static const osg::BitVector ActiveFieldMask
static const BitVector AttachmentsFieldMask
static const BitVector NextFieldMask
CoredNodePtr helper


static const bool isNodeCore = false

Protected Member Functions

void drawAnalog (UInt32, StatElem *, DrawActionBase *, Viewport *)
 Draw an analog Display.
void drawChart (UInt32, StatElem *, DrawActionBase *, Viewport *)
 Draw a chart of the StatElem.
void drawLineChart (UInt32, StatElem *, DrawActionBase *, Viewport *)
 Draw a line-chart of the StatElem.
void drawBar (UInt32, StatElem *, DrawActionBase *, Viewport *)
 Draw a Bar of the StatElem.
void drawText (UInt32, StatElem *, DrawActionBase *, Viewport *)
 Draw just Text to represent the Statistics Data.
void initText (void)
 initializes the text
void drawString (DrawActionBase *base, const std::string &text, TextLayoutParam::Alignment majorAlignment=TextLayoutParam::ALIGN_FIRST, TextLayoutParam::Alignment minorAlignment=TextLayoutParam::ALIGN_END)
 Draws a string.
std::string real2String (Real32 value, char *format=0)
 Converts a Real32 to a string.
void calcPosAndSize (const UInt32 &elementID, Viewport *port, Vec2f *Position, Vec2f *Size)
 Calculate the position an size of an element.
void processValue (Real32 &value, const UInt32 &elementID)
 Calculate the "real" value based on the value and the Flags.
void processOnlyValue (Real32 &value, const UInt32 &elementID)
void addValueToHistory (Real32 &value, const UInt32 &elementID)
Constructors


 GraphicStatisticsForeground (void)
 GraphicStatisticsForeground (const GraphicStatisticsForeground &source)
Destructors


virtual ~GraphicStatisticsForeground (void)
Field Get


MFUInt32getMFDisplayType (void)
 Get the GraphicStatisticsForeground::_mfDisplayType field.
MFVec2fgetMFSize (void)
 Get the GraphicStatisticsForeground::_mfSize field.
MFVec2fgetMFPos (void)
 Get the GraphicStatisticsForeground::_mfPos field.
MFColor4fgetMFColorMax (void)
 Get the GraphicStatisticsForeground::_mfColorMax field.
MFColor4fgetMFColorMin (void)
 Get the GraphicStatisticsForeground::_mfColorMin field.
MFColor4fgetMFColorCurrent (void)
 Get the GraphicStatisticsForeground::_mfColorCurrent field.
MFReal32getMFMinValue (void)
 Get the GraphicStatisticsForeground::_mfMinValue field.
MFReal32getMFMaxValue (void)
 Get the GraphicStatisticsForeground::_mfMaxValue field.
MFUInt32getMFFlags (void)
 Get the GraphicStatisticsForeground::_mfFlags field.
MFUInt32getMFHistorySize (void)
 Get the GraphicStatisticsForeground::_mfHistorySize field.
UInt32getDisplayType (UInt32 index)
 Get the value of the index element the GraphicStatisticsForeground::_mfDisplayType field.
MFUInt32getDisplayType (void)
 Get the GraphicStatisticsForeground::_mfDisplayType field.
const MFUInt32getDisplayType (void) const
 Get the GraphicStatisticsForeground::_mfDisplayType field.
Vec2fgetSize (UInt32 index)
 Get the value of the index element the GraphicStatisticsForeground::_mfSize field.
MFVec2fgetSize (void)
 Get the GraphicStatisticsForeground::_mfSize field.
const MFVec2fgetSize (void) const
 Get the GraphicStatisticsForeground::_mfSize field.
Vec2fgetPos (UInt32 index)
 Get the value of the index element the GraphicStatisticsForeground::_mfPos field.
MFVec2fgetPos (void)
 Get the GraphicStatisticsForeground::_mfPos field.
const MFVec2fgetPos (void) const
 Get the GraphicStatisticsForeground::_mfPos field.
Color4fgetColorMax (UInt32 index)
 Get the value of the index element the GraphicStatisticsForeground::_mfColorMax field.
MFColor4fgetColorMax (void)
 Get the GraphicStatisticsForeground::_mfColorMax field.
const MFColor4fgetColorMax (void) const
 Get the GraphicStatisticsForeground::_mfColorMax field.
Color4fgetColorMin (UInt32 index)
 Get the value of the index element the GraphicStatisticsForeground::_mfColorMin field.
MFColor4fgetColorMin (void)
 Get the GraphicStatisticsForeground::_mfColorMin field.
const MFColor4fgetColorMin (void) const
 Get the GraphicStatisticsForeground::_mfColorMin field.
Color4fgetColorCurrent (UInt32 index)
 Get the value of the index element the GraphicStatisticsForeground::_mfColorCurrent field.
MFColor4fgetColorCurrent (void)
 Get the GraphicStatisticsForeground::_mfColorCurrent field.
const MFColor4fgetColorCurrent (void) const
 Get the GraphicStatisticsForeground::_mfColorCurrent field.
Real32getMinValue (UInt32 index)
 Get the value of the index element the GraphicStatisticsForeground::_mfMinValue field.
MFReal32getMinValue (void)
 Get the GraphicStatisticsForeground::_mfMinValue field.
const MFReal32getMinValue (void) const
 Get the GraphicStatisticsForeground::_mfMinValue field.
Real32getMaxValue (UInt32 index)
 Get the value of the index element the GraphicStatisticsForeground::_mfMaxValue field.
MFReal32getMaxValue (void)
 Get the GraphicStatisticsForeground::_mfMaxValue field.
const MFReal32getMaxValue (void) const
 Get the GraphicStatisticsForeground::_mfMaxValue field.
UInt32getFlags (UInt32 index)
 Get the value of the index element the GraphicStatisticsForeground::_mfFlags field.
MFUInt32getFlags (void)
 Get the GraphicStatisticsForeground::_mfFlags field.
const MFUInt32getFlags (void) const
 Get the GraphicStatisticsForeground::_mfFlags field.
UInt32getHistorySize (UInt32 index)
 Get the value of the index element the GraphicStatisticsForeground::_mfHistorySize field.
MFUInt32getHistorySize (void)
 Get the GraphicStatisticsForeground::_mfHistorySize field.
const MFUInt32getHistorySize (void) const
 Get the GraphicStatisticsForeground::_mfHistorySize field.
Sync
void executeSyncImpl (GraphicStatisticsForegroundBase *pOther, const BitVector &whichField)
virtual void executeSync (FieldContainer &other, const BitVector &whichField)
Sync


void executeSyncImpl (StatisticsForegroundBase *pOther, const BitVector &whichField)
Sync


void executeSyncImpl (ForegroundBase *pOther, const BitVector &whichField)
Sync


void executeSyncImpl (AttachmentContainer *pOther, const BitVector &whichField)
Sync


void executeSyncImpl (FieldContainer *pOther, const BitVector &whichField)
Pointer


AttachmentContainerPtr getPtr (void)
MT Edit


template<class FieldTypeT>
void beginEditX (const BitVector &whichField, FieldTypeT &field)
template<class FieldTypeT>
void endEditX (const BitVector &whichField, FieldTypeT &field)
MT Construction


void onCreate (const FieldContainer *source=NULL)
void onCreateAspect (const FieldContainer *aspect0, const FieldContainer *source=NULL)
MT Destruction


virtual void onDestroy (void)

Static Protected Member Functions

Create Fieldcontainer


template<class ObjectPtrT>
static void newPtr (ObjectPtrT &result, const typename ObjectPtrT::StoredObjectType *prototypeP)
template<class ObjectPtrT>
static void newPtr (ObjectPtrT &result)

Protected Attributes

Fields


MFUInt32 _mfDisplayType
MFVec2f _mfSize
MFVec2f _mfPos
MFColor4f _mfColorMax
MFColor4f _mfColorMin
MFColor4f _mfColorCurrent
MFReal32 _mfMinValue
MFReal32 _mfMaxValue
MFUInt32 _mfFlags
MFUInt32 _mfHistorySize
MFString _mfDescription
SFReal32 _sfLineWidth
SFColor3f _sfBackgroundColor
SFBool _sfTextEnabled
SFBool _sfBackgroundEnabled
SFBool _sfBorderEnabled
Fields


MFInt32 _mfElementIDs
SFStatCollector _sfCollector
Fields


SFBool _sfActive
Fields


SFAttachmentMap _attachmentMap
Member


UInt32 _shares

Private Types

typedef
GraphicStatisticsForegroundBase 
Inherited

Private Member Functions

void operator= (const GraphicStatisticsForeground &source)

Static Private Member Functions

static void initMethod (void)

Private Attributes

TextTXFFace_face
TextureChunkPtr _texchunk
std::vector< std::vector
< Real32 > > 
_history
std::vector< UInt32_historyID

Friends

class FieldContainer
class GraphicStatisticsForegroundBase


Detailed Description

GraphicStatisticsForeground displays the Statistics info as graphical displays. See Graphic Statistics Foreground for a description.

The different parameters for all the displays are spread over a lot of fields. Thus it is stringly advised to use the addElement and removeElement convenience functions to add and remove elements, to ensure consistency.

The _sfLineWidth, _sfBackgroundColor, _sfBackgroundEnabled and _sfBorderEnabled Fields control the parameters used for all displays.

Definition at line 61 of file OSGGraphicStatisticsForeground.h.


Member Typedef Documentation

Reimplemented from osg::GraphicStatisticsForegroundBase.

Definition at line 65 of file OSGGraphicStatisticsForeground.h.

Reimplemented from osg::StatisticsForegroundBase.

Definition at line 105 of file OSGGraphicStatisticsForegroundBase.h.


Member Enumeration Documentation

Enumerator:
OSG_ANALOG 
OSG_BAR 
OSG_CHART 
OSG_LINE_CHART 
OSG_TEXT 

Definition at line 70 of file OSGGraphicStatisticsForeground.h.

00070               {
00071       OSG_ANALOG     = 0,
00072       OSG_BAR        = 1,
00073       OSG_CHART      = 2,
00074       OSG_LINE_CHART = 3,
00075       OSG_TEXT       = 4
00076     };

Enumerator:
OSG_OVERFLOW_RESIZE 
OSG_UNDERFLOW_RESIZE 
OSG_RECIPROC 
OSG_SMOOTH 
OSG_ENABLE_POINTS 
OSG_MAX_TEXT 
OSG_MIN_TEXT 

Definition at line 78 of file OSGGraphicStatisticsForeground.h.

00078               {
00079       OSG_OVERFLOW_RESIZE  = 1,
00080       OSG_UNDERFLOW_RESIZE = 2,
00081       OSG_RECIPROC         = 4,
00082       OSG_SMOOTH           = 8,
00083       OSG_ENABLE_POINTS    = 16,
00084       OSG_MAX_TEXT         = 32,
00085       OSG_MIN_TEXT         = 64
00086     };

Enumerator:
OSG_LEFT 
OSG_RIGHT 
OSG_CENTER 

Definition at line 88 of file OSGGraphicStatisticsForeground.h.

00088                 {
00089       OSG_LEFT   = 0,
00090       OSG_RIGHT  = 1,
00091       OSG_CENTER = 2
00092     };

Enumerator:
OSG_BOTTOM 
OSG_MIDDLE 
OSG_TOP 

Definition at line 94 of file OSGGraphicStatisticsForeground.h.

00094                 {
00095       OSG_BOTTOM = 0,
00096       OSG_MIDDLE = 1,
00097       OSG_TOP    = 2
00098     };

anonymous enum [inherited]

Enumerator:
DisplayTypeFieldId 
SizeFieldId 
PosFieldId 
ColorMaxFieldId 
ColorMinFieldId 
ColorCurrentFieldId 
MinValueFieldId 
MaxValueFieldId 
FlagsFieldId 
HistorySizeFieldId 
DescriptionFieldId 
LineWidthFieldId 
BackgroundColorFieldId 
TextEnabledFieldId 
BackgroundEnabledFieldId 
BorderEnabledFieldId 
NextFieldId 

Definition at line 107 of file OSGGraphicStatisticsForegroundBase.h.

00108     {
00109         DisplayTypeFieldId       = Inherited::NextFieldId,
00110         SizeFieldId              = DisplayTypeFieldId       + 1,
00111         PosFieldId               = SizeFieldId              + 1,
00112         ColorMaxFieldId          = PosFieldId               + 1,
00113         ColorMinFieldId          = ColorMaxFieldId          + 1,
00114         ColorCurrentFieldId      = ColorMinFieldId          + 1,
00115         MinValueFieldId          = ColorCurrentFieldId      + 1,
00116         MaxValueFieldId          = MinValueFieldId          + 1,
00117         FlagsFieldId             = MaxValueFieldId          + 1,
00118         HistorySizeFieldId       = FlagsFieldId             + 1,
00119         DescriptionFieldId       = HistorySizeFieldId       + 1,
00120         LineWidthFieldId         = DescriptionFieldId       + 1,
00121         BackgroundColorFieldId   = LineWidthFieldId         + 1,
00122         TextEnabledFieldId       = BackgroundColorFieldId   + 1,
00123         BackgroundEnabledFieldId = TextEnabledFieldId       + 1,
00124         BorderEnabledFieldId     = BackgroundEnabledFieldId + 1,
00125         NextFieldId              = BorderEnabledFieldId     + 1
00126     };

anonymous enum [inherited]

Enumerator:
ElementIDsFieldId 
CollectorFieldId 
NextFieldId 

Definition at line 93 of file OSGStatisticsForegroundBase.h.

00094     {
00095         ElementIDsFieldId = Inherited::NextFieldId,
00096         CollectorFieldId  = ElementIDsFieldId + 1,
00097         NextFieldId       = CollectorFieldId  + 1
00098     };

anonymous enum [inherited]

Enumerator:
ActiveFieldId 
NextFieldId 

Definition at line 92 of file OSGForegroundBase.h.

00093     {
00094         ActiveFieldId = Inherited::NextFieldId,
00095         NextFieldId   = ActiveFieldId + 1
00096     };

anonymous enum [inherited]

Enumerator:
AttachmentsFieldId 
NextFieldId 

Definition at line 78 of file OSGAttachmentContainerImpl.h.

anonymous enum [inherited]

Enumerator:
NextFieldId 

Definition at line 73 of file OSGFieldContainerImpl.h.

00073 { NextFieldId = 1 };


Constructor & Destructor Documentation

GraphicStatisticsForeground::GraphicStatisticsForeground ( void   )  [protected]

Definition at line 79 of file OSGGraphicStatisticsForeground.cpp.

00079                                                              :
00080     Inherited(), _face(0), _texchunk()
00081 {
00082 }

GraphicStatisticsForeground::GraphicStatisticsForeground ( const GraphicStatisticsForeground source  )  [protected]

Definition at line 85 of file OSGGraphicStatisticsForeground.cpp.

References _face, _texchunk, osg::addRefCP(), osg::addRefP(), and osg::NullFC.

00085                                                                                                   :
00086         Inherited(source), _face(source._face), _texchunk(source._texchunk)
00087 {
00088     if (_face != 0)
00089         addRefP(_face);
00090     if (_texchunk != NullFC)
00091         addRefCP(_texchunk);
00092 }

GraphicStatisticsForeground::~GraphicStatisticsForeground ( void   )  [protected, virtual]

Definition at line 95 of file OSGGraphicStatisticsForeground.cpp.

References _face, _texchunk, osg::NullFC, osg::subRefCP(), and osg::subRefP().

00096 {
00097     if (_face != 0)
00098         subRefP(_face);
00099     if (_texchunk != NullFC)
00100         subRefCP(_texchunk);
00101 }


Member Function Documentation

void GraphicStatisticsForeground::changed ( BitVector  whichField,
UInt32  from 
) [virtual]

Reimplemented from osg::StatisticsForeground.

Definition at line 109 of file OSGGraphicStatisticsForeground.cpp.

References _history, _historyID, osg::GraphicStatisticsForegroundBase::getHistorySize(), osg::GraphicStatisticsForegroundBase::getMaxValue(), osg::GraphicStatisticsForegroundBase::getMinValue(), osg::GraphicStatisticsForegroundBase::HistorySizeFieldMask, and osg::MField< FieldTypeT, fieldNameSpace >::size().

00110 {
00111     UInt32  i, n = getHistorySize().size();
00112 
00113     /* Save the data  */
00114     if(whichField & HistorySizeFieldMask)
00115     {
00116         _historyID.resize(n, 0);
00117         _history.resize(n);
00118         for(i = 0; i < n; i++)
00119         {
00120             if(_history[i].size() == 0)
00121             {
00122                 _history[i].resize(getHistorySize()[i],
00123                                                    (getMaxValue()[i] - getMinValue()[i]) / 2.0f);
00124             }
00125         }
00126     }
00127 }

void GraphicStatisticsForeground::dump ( UInt32  uiIndent = 0,
const BitVector  bvFlags = 0 
) const [virtual]

Reimplemented from osg::StatisticsForeground.

Definition at line 130 of file OSGGraphicStatisticsForeground.cpp.

References SLOG.

00131 {
00132     SLOG << "Dump GraphicStatisticsForeground NI" << std::endl;
00133 }

void GraphicStatisticsForeground::draw ( DrawActionBase action,
Viewport port 
) [virtual]

Implements osg::StatisticsForeground.

Definition at line 136 of file OSGGraphicStatisticsForeground.cpp.

References _face, calcPosAndSize(), drawAnalog(), drawBar(), drawChart(), drawLineChart(), drawText(), osg::ForegroundBase::getActive(), osg::StatisticsForegroundBase::getCollector(), osg::GraphicStatisticsForegroundBase::getDisplayType(), osg::StatCollector::getElem(), osg::StatisticsForegroundBase::getElementIDs(), osg::GraphicStatisticsForegroundBase::getLineWidth(), osg::Viewport::getPixelHeight(), osg::Viewport::getPixelWidth(), initText(), OSG_ANALOG, OSG_BAR, OSG_CHART, OSG_LINE_CHART, OSG_TEXT, and osg::MField< FieldTypeT, fieldNameSpace >::size().

00137 {
00138     if (getActive() == false)
00139         return;
00140     
00141     // Check the height and width of the window
00142     if(port->getPixelWidth() < 1 || port->getPixelHeight() < 1)
00143     {
00144         return;
00145     }
00146 
00147     // initialize the text texture
00148     if(_face == 0)
00149     {
00150         initText();
00151     }
00152 
00153     // Save the current OpenGL state
00154     // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
00155     glPushAttrib(GL_ALL_ATTRIB_BITS);
00156 
00157     glMatrixMode(GL_MODELVIEW);
00158     glPushMatrix();
00159     glLoadIdentity();
00160 
00161     glMatrixMode(GL_PROJECTION);
00162     glPushMatrix();
00163     glLoadIdentity();
00164 
00165     // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
00166     // Finished saving and setting the matrices
00167     // Enable Alpha Blending
00168     glAlphaFunc(GL_NOTEQUAL, 0);
00169     glEnable(GL_ALPHA_TEST);
00170     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
00171     glEnable(GL_BLEND);
00172 
00173     // Enable the scissor test
00174     glEnable(GL_SCISSOR_TEST);
00175 
00176     // Initialize the viewport
00177     glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
00178 
00179     // set the standard line Width
00180     glLineWidth(getLineWidth());
00181 
00182     // Get the Collector
00183     StatCollector   *col = &getCollector();
00184 
00185     // temp StatElem
00186     StatElem        *el;
00187 
00188     // ratio = height / width
00189     //    Real32 ratio  =  ( (Real32)port->getPixelHeight()) /
00190     //                     ((Real32) port->getPixelWidth());
00191     // temp Variables for the loop
00192     Vec2f           pos;
00193     Vec2f           size;
00194 
00195     // Loop over all selected elements
00196     for(UInt32 i = 0; i < getElementIDs().size(); ++i)
00197     {
00198         // get the StatElem and check whether it exists
00199         el = col->getElem(getElementIDs()[i]);
00200         if(!el)
00201         {
00202             continue;
00203         }
00204 
00205         glMatrixMode(GL_MODELVIEW);
00206         glPushMatrix();
00207 
00208         // calculate position and size
00209         calcPosAndSize(i, port, &pos, &size);
00210         glTranslatef(pos[0], pos[1], 0.0);
00211         glScalef(size[0], size[1], 1.0);
00212 
00213         // calculate the pixel size of the display
00214         UInt32  pw = (UInt32) (port->getPixelWidth() * size[0]);
00215         UInt32  ph = (UInt32) (port->getPixelHeight() * size[1]);
00216         UInt32  px = (UInt32) (port->getPixelWidth() * pos[0]);
00217         UInt32  py = (UInt32) (port->getPixelHeight() * pos[1]);
00218         glScissor(px - 1, py - 1, pw + 2, ph + 2);
00219 
00220         //std::cout << pos << std::endl;
00221         //std::cout << size << std::endl;
00222         //std::cout << px << "/" << py << "/" << pw << "/" << ph
00223         //          << std::endl;
00224         // enable GL_POINT_SMOOTH
00225         glEnable(GL_POINT_SMOOTH);
00226 
00227         //select the Method to use for drawing
00228         switch(getDisplayType()[i])
00229         {
00230         case OSG_ANALOG:
00231             //draw an analog display
00232             drawAnalog(i, el, action, port);
00233             break;
00234         case OSG_BAR:
00235             //draw a bar display
00236             drawBar(i, el, action, port);
00237             break;
00238         case OSG_CHART:
00239             //draw a chart
00240             drawChart(i, el, action, port);
00241             break;
00242         case OSG_LINE_CHART:
00243             //draw a linechart
00244             drawLineChart(i, el, action, port);
00245             break;
00246         case OSG_TEXT:
00247             //draw a linechart
00248             drawText(i, el, action, port);
00249             break;
00250 
00251         default:
00252             break;
00253         }                                   //switch()
00254 
00255         glMatrixMode(GL_MODELVIEW);
00256         glPopMatrix();
00257     }                                       //for()
00258 
00259     //reset OpenGL matrices
00260     glMatrixMode(GL_PROJECTION);
00261     glPopMatrix();
00262     glMatrixMode(GL_MODELVIEW);
00263     glPopMatrix();
00264 
00265     // Restore all OpenGL states
00266     glPopAttrib();
00267 }

void GraphicStatisticsForeground::addElement ( StatElemDescBase desc,
UInt32  displayType,
Vec2f  pos,
Vec2f  size,
Color4f  highColor,
Color4f  lowColor,
Color4f  currentColor,
Real32  minValue = 0.0,
Real32  maxValue = 0.0,
UInt32  Flags = OSG_UNDERFLOW_RESIZE | OSG_OVERFLOW_RESIZE,
UInt32  historySize = 0,
std::string  description = "" 
)

Definition at line 272 of file OSGGraphicStatisticsForeground.cpp.

References osg::GraphicStatisticsForegroundBase::getColorCurrent(), osg::GraphicStatisticsForegroundBase::getColorMax(), osg::GraphicStatisticsForegroundBase::getColorMin(), osg::GraphicStatisticsForegroundBase::getDescription(), osg::GraphicStatisticsForegroundBase::getDisplayType(), osg::StatisticsForegroundBase::getElementIDs(), osg::GraphicStatisticsForegroundBase::getFlags(), osg::GraphicStatisticsForegroundBase::getHistorySize(), osg::StatElemDescBase::getID(), osg::GraphicStatisticsForegroundBase::getMaxValue(), osg::GraphicStatisticsForegroundBase::getMinValue(), osg::GraphicStatisticsForegroundBase::getPos(), osg::GraphicStatisticsForegroundBase::getSize(), and osg::MField< FieldTypeT, fieldNameSpace >::push_back().

00280 {
00281     /* get the ID of the StatElem to be added */
00282     // Save the given Data
00283     getElementIDs().push_back(desc.getID());
00284     getDisplayType().push_back(displayType);
00285     getPos().push_back(pos);
00286     getSize().push_back(size);
00287     getColorMax().push_back(highColor);
00288     getColorMin().push_back(lowColor);
00289     getColorCurrent().push_back(currentColor);
00290     getMinValue().push_back(minValue);
00291     getMaxValue().push_back(maxValue);
00292     getFlags().push_back(flags);
00293     getHistorySize().push_back(historySize ? historySize : 25);
00294     getDescription().push_back(description);
00295 
00296     // changed() must be called (automatically)
00297     // to sync the _history/_historyID values
00298 }

void GraphicStatisticsForeground::removeElement ( StatElemDescBase desc  ) 

Definition at line 303 of file OSGGraphicStatisticsForeground.cpp.

References _history, _historyID, osg::MField< FieldTypeT, fieldNameSpace >::erase(), osg::GraphicStatisticsForegroundBase::getColorCurrent(), osg::GraphicStatisticsForegroundBase::getColorMax(), osg::GraphicStatisticsForegroundBase::getColorMin(), osg::GraphicStatisticsForegroundBase::getDisplayType(), osg::StatisticsForegroundBase::getElementIDs(), osg::GraphicStatisticsForegroundBase::getFlags(), osg::GraphicStatisticsForegroundBase::getHistorySize(), osg::StatElemDescBase::getID(), osg::GraphicStatisticsForegroundBase::getMaxValue(), osg::GraphicStatisticsForegroundBase::getMinValue(), osg::GraphicStatisticsForegroundBase::getPos(), osg::GraphicStatisticsForegroundBase::getSize(), and osg::MField< FieldTypeT, fieldNameSpace >::size().

00304 {
00305     UInt32  id = desc.getID();
00306     UInt32  i = 0, n = getElementIDs().size();
00307 
00308     for(i = 0; n; i++)
00309     {
00310         if(getElementIDs()[i] == id)
00311             break;
00312     }
00313 
00314     /* Now i is the id of the Element in the MFields. */
00315     if(i != n)
00316     {
00317         /* Erase these entries in the MFields */
00318         getElementIDs().erase(getElementIDs().begin() + i);
00319         getDisplayType().erase(getDisplayType().begin() + i);
00320         getPos().erase(getPos().begin() + i);
00321         getSize().erase(getSize().begin() + i);
00322         getColorMax().erase(getColorMax().begin() + i);
00323         getColorMin().erase(getColorMin().begin() + i);
00324         getColorCurrent().erase(getColorCurrent().begin() + i);
00325         getMinValue().erase(getMinValue().begin() + i);
00326         getMaxValue().erase(getMaxValue().begin() + i);
00327         getFlags().erase(getFlags().begin() + i);
00328         getHistorySize().erase(getHistorySize().begin() + i);
00329 
00330         _history.erase(_history.begin() + i);
00331         _historyID.erase(_historyID.begin() + i);
00332     }
00333 }

void GraphicStatisticsForeground::drawAnalog ( UInt32  elementID,
StatElem el,
DrawActionBase base,
Viewport  
) [protected]

Definition at line 336 of file OSGGraphicStatisticsForeground.cpp.

References osg::TextLayoutParam::ALIGN_FIRST, osg::TextLayoutParam::ALIGN_MIDDLE, drawString(), osg::GraphicStatisticsForegroundBase::getBackgroundColor(), osg::GraphicStatisticsForegroundBase::getBackgroundEnabled(), osg::GraphicStatisticsForegroundBase::getBorderEnabled(), osg::GraphicStatisticsForegroundBase::getColorCurrent(), osg::GraphicStatisticsForegroundBase::getColorMax(), osg::GraphicStatisticsForegroundBase::getColorMin(), osg::GraphicStatisticsForegroundBase::getFlags(), osg::GraphicStatisticsForegroundBase::getMaxValue(), osg::GraphicStatisticsForegroundBase::getMinValue(), osg::GraphicStatisticsForegroundBase::getTextEnabled(), osg::StatElem::getValue(), OSG_SMOOTH, osg::Pi, processOnlyValue(), processValue(), and real2String().

Referenced by draw().

00338 {
00339     // helper Var
00340     Real32  xdist = 0.0;
00341 
00342     // get the current value to be digitised
00343     Real32  value = Real32(el->getValue());
00344     Real32  vsave = value;
00345 
00346     //std::cout << "Analog value: " << value << std::endl;
00347     // process this value according to the flags
00348     processValue(value, elementID);
00349     processOnlyValue(vsave, elementID);
00350 
00351     // calculate minimum value and maximun value
00352     Real32  minV = getMinValue()[elementID];
00353     Real32  maxV = getMaxValue()[elementID];
00354 
00355     // get the colors
00356     Color4f minColor = getColorMin()[elementID];
00357     Color4f currentColor = getColorCurrent()[elementID];
00358     Color4f maxColor = getColorMax()[elementID];
00359 
00360     // xdist helps to calculate the real size[0] of the quadstrip and the colors
00361     xdist = (value - minV) / (maxV - minV);
00362 
00363     // draw a filled circle  with alpha value if expected
00364     Color3f c = getBackgroundColor();
00365     Real32  angle = 0.0;
00366     if(getBackgroundEnabled())
00367     {
00368         // filled circle drawn with a triangle_strip
00369         glMatrixMode(GL_MODELVIEW);
00370         glPushMatrix();
00371         glTranslatef(0.5, 0.5, 0);
00372         glColor4f(c[0], c[1], c[2], 0.4);
00373         glBegin(GL_POLYGON);
00374 
00375         // glVertex2f(0.0, 0.0);
00376         for(angle = 0.0; angle < 2 * Pi; angle += Pi / 24)
00377         {
00378             glVertex2f(0.5f * cos(angle), 0.5f * sin(angle));
00379         }
00380 
00381         glEnd();
00382         glMatrixMode(GL_MODELVIEW);
00383         glPopMatrix();
00384     }
00385 
00386     // draw a Frame around the display
00387     if(getBorderEnabled())
00388     {
00389         glColor4f(c[0], c[1], c[2], 0.8);
00390 
00391         // non filled circle around the filled one
00392         angle = 0.0;
00393         glMatrixMode(GL_MODELVIEW);
00394         glPushMatrix();
00395         glTranslatef(0.5, 0.5, 0);
00396         glBegin(GL_LINE_LOOP);
00397 
00398         for(angle = 0.0; angle < 2 * Pi; angle += Pi / 24)
00399         {
00400             glVertex2f(0.5f * cos(angle), 0.5f * sin(angle));
00401         }
00402 
00403         glEnd();
00404         glMatrixMode(GL_MODELVIEW);
00405         glPopMatrix();
00406     }
00407 
00408     // draw the ticks
00409     glColor3f(1.0f - c[0], 1.0f - c[1], 1.0f - c[2]);
00410     glMatrixMode(GL_MODELVIEW);
00411     glPushMatrix();
00412     glTranslatef(0.5, 0.5, 0.0);
00413     glRotatef(135, 0.0, 0.0, 1.0);
00414 
00415     glColor3f(1.0f - c[0], 1.0f - c[1], 1.0f - c[2]);
00416     for(UInt32 r = 0; r < 10; r++)
00417     {
00418         glBegin(GL_LINES);
00419         glVertex2f(-0.5, 0.0);
00420         glVertex2f(-0.35, 0.0);
00421         glEnd();
00422         glRotatef(30, 0.0, 0.0, 1.0);
00423     }                                       // end for
00424 
00425     glMatrixMode(GL_MODELVIEW);
00426     glPopMatrix();
00427 
00428     // save current matrix, translate to the origin of the pointer and rotate
00429     glMatrixMode(GL_MODELVIEW);
00430     glPushMatrix();
00431     glTranslatef(0.5, 0.5, 0);
00432     glRotatef(45 - (xdist * 270.0f), 0.0, 0.0, 1.0);
00433 
00434     // draw arrow
00435     glColor3f(0.0, 1.0, 0.0);
00436     glBegin(GL_TRIANGLES);
00437     glVertex2f(0.0, 0.0);
00438     glVertex2f(-0.5, 0.0);
00439     glVertex2f(-0.4, 0.05);
00440 
00441     // next triangle -----
00442     glVertex2f(0.0, 0.0);
00443     glVertex2f(-0.5, 0.0);
00444     glVertex2f(-0.4, -0.05);
00445     glEnd();
00446 
00447     // and finally go back
00448     glMatrixMode(GL_MODELVIEW);
00449     glPopMatrix();
00450 
00451     //draw the center of the arrow...
00452     glMatrixMode(GL_MODELVIEW);
00453     glPushMatrix();
00454     glColor3f(1.0f - c[0], 1.0f - c[1], 1.0f - c[2]);
00455     glBegin(GL_QUADS);
00456     glVertex2f(0.475, 0.475);
00457     glVertex2f(0.525, 0.475);
00458     glVertex2f(0.525, 0.525);
00459     glVertex2f(0.475, 0.525);
00460 
00461     glEnd();
00462 
00463     glMatrixMode(GL_MODELVIEW);
00464     glPopMatrix();
00465 
00466     /* draw a line representing the real current value if the value is
00467        smoothed */
00468     UInt32  flags = getFlags()[elementID];
00469     if(flags & OSG_SMOOTH)
00470     {
00471         glMatrixMode(GL_MODELVIEW);
00472         glPushMatrix();
00473         glTranslatef(0.5, 0.5, 0);
00474 
00475         Real32  ang = 1 - ((vsave - minV) / (maxV - minV));
00476         glRotatef(45.0, 0.0, 0.0, 1.0);
00477         glRotatef((ang * 270.0f), 0.0, 0.0, 1.0);
00478         glColor4f(1.0, 1.0, 0.0, 1.0);
00479         glBegin(GL_LINES);
00480         glVertex2f(0.0, 0.0);
00481         glVertex2f(0.0, -0.5);
00482         glEnd();
00483 
00484         glMatrixMode(GL_MODELVIEW);
00485         glPopMatrix();
00486     }
00487 
00488     // draw some text ------------
00489     if(getTextEnabled())
00490     {
00491         // create some Strings to be drawn
00492         std::string maxstr = real2String(maxV);
00493         std::string minstr = real2String(minV);
00494 
00495         //set color for drawing the text
00496         glColor4f(1.0f - c[0], 1.0f - c[1], 1.0f - c[2], 1.0f);
00497 
00498         // Draw the current value under the center.
00499         glMatrixMode(GL_MODELVIEW);
00500         glPushMatrix();
00501         glTranslatef(0.5, 0.5, 0.0);
00502         glScalef(0.2, 0.2, 1.0);
00503         drawString(base, real2String(value), TextLayoutParam::ALIGN_MIDDLE,
00504                    TextLayoutParam::ALIGN_FIRST);
00505         glMatrixMode(GL_MODELVIEW);
00506         glPopMatrix();
00507 
00508         // scale and translate the text
00509         glMatrixMode(GL_MODELVIEW);
00510         glPushMatrix();
00511         glTranslatef(0.2, 0.3, 0.0);
00512         glScalef(0.12, 0.12, 1.0);
00513 
00514         //draw the text
00515         glTranslatef(0.0, -1.5, 0.0);
00516         drawString(base, minstr);
00517         glTranslatef(3.4, 0.0, 0.0);
00518         drawString(base, maxstr);
00519         glMatrixMode(GL_MODELVIEW);
00520         glPopMatrix();
00521     }
00522 
00523     // end of text drawing ------
00524 }

void GraphicStatisticsForeground::drawChart ( UInt32  elementID,
StatElem el,
DrawActionBase base,
Viewport port 
) [protected]

Definition at line 529 of file OSGGraphicStatisticsForeground.cpp.

References _history, _historyID, osg::TextLayoutParam::ALIGN_FIRST, osg::TextLayoutParam::ALIGN_MIDDLE, drawString(), osg::GraphicStatisticsForegroundBase::getBackgroundColor(), osg::GraphicStatisticsForegroundBase::getBackgroundEnabled(), osg::GraphicStatisticsForegroundBase::getBorderEnabled(), osg::GraphicStatisticsForegroundBase::getColorCurrent(), osg::GraphicStatisticsForegroundBase::getDescription(), osg::GraphicStatisticsForegroundBase::getMaxValue(), osg::GraphicStatisticsForegroundBase::getMinValue(), osg::Viewport::getPixelHeight(), osg::Viewport::getPixelWidth(), osg::GraphicStatisticsForegroundBase::getTextEnabled(), osg::StatElem::getValue(), processValue(), and real2String().

Referenced by draw().

00531 {
00532     // The amount of the display to be used for the text on the bottom
00533     Real32  textHeight = 0.0;
00534     Real32  textWidth = 0.0;
00535 
00536     if(getTextEnabled())
00537     {
00538         textHeight = 0.2;
00539         textWidth = 0.25;
00540     }
00541 
00542     /* Height of the current quad */
00543     Real32  currQuadheight = 0.0;
00544 
00545     /* Get the current value and process it */
00546     Real32  value = Real32(el->getValue());
00547     processValue(value, elementID);
00548 
00549     //std::cout << "Chart value: " << value << std::endl;
00550     /* calculate minimum value and maximun value */
00551     Real32  minV = getMinValue()[elementID];
00552     Real32  maxV = getMaxValue()[elementID];
00553 
00554     // draw a rectangle with alpha value
00555     Color3f c = getBackgroundColor();
00556     if(getBackgroundEnabled())
00557     {
00558         glColor4f(c[0], c[1], c[2], 0.4);
00559         glRectf(0.0, 0.0, 1.0, 1.0);
00560     }
00561 
00562     // draw a Frame around the display
00563     if(getBorderEnabled())
00564     {
00565         glColor4f(c[0], c[1], c[2], 0.8);
00566         glBegin(GL_LINE_STRIP);
00567         glVertex2f(textWidth, 0.0);
00568         glVertex2f(1.0, 0.0);
00569         glVertex2f(1.0, 1.0);
00570         glVertex2f(textWidth, 1.0);
00571         glEnd();
00572     }
00573 
00574     /* Number of elements in the cycle buffer */
00575     UInt32  number = _history[elementID].size();
00576 
00577     /* width of each Bar */
00578     Real32  step = (1.0f - textWidth) / number;
00579 
00580     /* The collor of the chart is set by the currentColor of this
00581        statistics Element */
00582     glColor4f(getColorCurrent()[elementID][0],
00583               getColorCurrent()[elementID][1],
00584               getColorCurrent()[elementID][2],
00585               getColorCurrent()[elementID][3]);
00586 
00587     /* Base coordiantes for the chart (lower left corner)
00588        Will be set to the current base coordinates of each bar in the
00589        loop */
00590     Real32  deltax = textWidth;
00591 
00592     glMatrixMode(GL_MODELVIEW);
00593     glPushMatrix();
00594     glTranslatef(0.0, textHeight, 0.0);
00595     glScalef(1.0f, 1.0f - textHeight, 1.0f);
00596 
00597     /* loop over all entries in the cycle buffer */
00598     for(UInt32 i = 0; i < number; i++)
00599     {
00600         /* get the current value out of the cycle Buffer */
00601         value = _history[elementID][((_historyID[elementID]) + i) % number];
00602 
00603         /* calculate the height of the quad to be drawn in this
00604                iteration */
00605         currQuadheight = ((value - minV) / (maxV - minV));
00606 
00607         /* draw the current bar */
00608         glBegin(GL_QUADS);
00609         glVertex2f(deltax, 0.0);
00610         glVertex2f(deltax + step, 0.0);
00611         glVertex2f(deltax + step, currQuadheight);
00612         glVertex2f(deltax, currQuadheight);
00613         glEnd();                            // finished drawing current Quad
00614         deltax += step;
00615     }                                       // end for
00616 
00617     glMatrixMode(GL_MODELVIEW);
00618     glPopMatrix();
00619 
00620     if(getTextEnabled())
00621     {
00622         // create some Strings to be drawn
00623         std::string minstr = real2String(minV, "%.0f");
00624         std::string maxstr = real2String(maxV, "%.0f");
00625         std::string valstr = getDescription()[elementID] + " " + real2String(value);
00626 
00627         // set color to draw the text with
00628         glColor4f(1.0f - c[0], 1.0f - c[1], 1.0f - c[2], 1.0f);
00629 
00630         // scale and translate the text
00631         Real32  ratio = ((Real32) port->getPixelHeight()) /
00632             ((Real32) port->getPixelWidth());
00633 
00634         // bottom: Current Value
00635         glMatrixMode(GL_MODELVIEW);
00636         glPushMatrix();
00637         glTranslatef(0.5, 0.01, 0.0);
00638         glScalef(0.2f * ratio, 0.2f, 1.0f);
00639         drawString(base, valstr, TextLayoutParam::ALIGN_MIDDLE);
00640         glMatrixMode(GL_MODELVIEW);
00641         glPopMatrix();
00642 
00643         //draw: min value
00644         glMatrixMode(GL_MODELVIEW);
00645         glPushMatrix();
00646         glTranslatef(0.0, 0.22, 0.0);
00647         glScalef(0.12f * ratio, 0.12f, 1.0f);
00648         drawString(base, minstr);
00649         glMatrixMode(GL_MODELVIEW);
00650         glPopMatrix();
00651 
00652         //draw: maximum value
00653         glMatrixMode(GL_MODELVIEW);
00654         glPushMatrix();
00655         glTranslatef(0.0, 1.0, 0.0);
00656         glScalef(0.12f * ratio, 0.12f, 1.0f);
00657         drawString(base, maxstr, TextLayoutParam::ALIGN_FIRST, TextLayoutParam::ALIGN_FIRST);
00658         glMatrixMode(GL_MODELVIEW);
00659         glPopMatrix();
00660     }
00661 
00662     // end of text drawing ------
00663 }

void GraphicStatisticsForeground::drawLineChart ( UInt32  elementID,
StatElem el,
DrawActionBase base,
Viewport port 
) [protected]

Definition at line 823 of file OSGGraphicStatisticsForeground.cpp.

References _history, _historyID, osg::TextLayoutParam::ALIGN_FIRST, osg::TextLayoutParam::ALIGN_MIDDLE, drawString(), osg::GraphicStatisticsForegroundBase::getBackgroundColor(), osg::GraphicStatisticsForegroundBase::getBackgroundEnabled(), osg::GraphicStatisticsForegroundBase::getBorderEnabled(), osg::GraphicStatisticsForegroundBase::getColorCurrent(), osg::GraphicStatisticsForegroundBase::getDescription(), osg::GraphicStatisticsForegroundBase::getFlags(), osg::GraphicStatisticsForegroundBase::getLineWidth(), osg::GraphicStatisticsForegroundBase::getMaxValue(), osg::GraphicStatisticsForegroundBase::getMinValue(), osg::Viewport::getPixelHeight(), osg::Viewport::getPixelWidth(), osg::GraphicStatisticsForegroundBase::getTextEnabled(), osg::StatElem::getValue(), OSG_ENABLE_POINTS, OSG_MAX_TEXT, OSG_MIN_TEXT, OSG_RECIPROC, processValue(), and real2String().

Referenced by draw().

00826 {
00827     // The amount of the display to be used for the text on the bottom
00828     Real32  textHeight = 0.0;
00829     Real32  textWidth = 0.0;
00830 
00831     if(getTextEnabled())
00832     {
00833         textHeight = 0.2;
00834         textWidth = 0.25;
00835     }
00836 
00837     /* Height of the current quad */
00838     Real32  currHeight = 0.0;
00839 
00840     /* Flags for check whether points should be drawn or not */
00841     UInt32  flags = getFlags()[elementID];
00842 
00843     /* Get the current value and process it */
00844     Real32  value = Real32(el->getValue());
00845     Real32  realValue = (flags & OSG_RECIPROC) ? 1.f / value : value;
00846 
00847     processValue(value, elementID);
00848 
00849     //std::cout << "LineChart value: " << value << std::endl;
00850     /* calculate minimum value and maximun value */
00851     Real32  minV = getMinValue()[elementID];
00852     Real32  maxV = getMaxValue()[elementID];
00853 
00854     // draw a rectangle with alpha value
00855     Color3f c = getBackgroundColor();
00856     if(getBackgroundEnabled())
00857     {
00858         glColor4f(c[0], c[1], c[2], 0.4);
00859         glRectf(0.0, 0.0, 1.0, 1.0);
00860     }
00861 
00862     // draw a Frame around the display
00863     if(getBorderEnabled())
00864     {
00865         glColor4f(c[0], c[1], c[2], 0.8);
00866         glBegin(GL_LINE_STRIP);
00867         glVertex2f(textWidth, 0.0);
00868         glVertex2f(1.0, 0.0);
00869         glVertex2f(1.0, 1.0);
00870         glVertex2f(textWidth, 1.0);
00871         glEnd();
00872     }
00873 
00874     /* Number of elements in the cycle buffer */
00875     UInt32  number = _history[elementID].size();
00876 
00877     /* width of each Bar */
00878     Real32  step = (1.0f - textWidth) / number;
00879 
00880     /* The collor of the chart is set by the currentColor of this
00881        statistics Element */
00882     glColor4f(getColorCurrent()[elementID][0], getColorCurrent()[elementID][1],
00883               getColorCurrent()[elementID][2], getColorCurrent()[elementID][3]);
00884 
00885     /* Base coordiantes for the chart (lower left corner)
00886        Will be set to the current base coordinates of each bar in the
00887        loop */
00888     Real32  deltax = textWidth;
00889 
00890     glMatrixMode(GL_MODELVIEW);
00891     glPushMatrix();
00892     glTranslatef(0.0, textHeight, 0.0);
00893     glScalef(1.0f, 1.0f - textHeight, 1.0f);
00894 
00895     /* loop over all entries in the cycle buffer */
00896     value = _history[elementID][_historyID[elementID]];
00897 
00898     /* save the last x und y value to draw the line in the next
00899        iterarion */
00900     Real32  lastx = textWidth;
00901     Real32  lasty = ((value - minV) / (maxV - minV));
00902 
00903     for(UInt32 i = 0; i < number; i++)
00904     {
00905         /* get the current value out of the cycle Buffer */
00906         value = _history[elementID][((_historyID[elementID]) + i) % number];
00907 
00908         /* calculate the height of the quad to be drawn in this
00909                iteration */
00910         currHeight = ((value - minV) / (maxV - minV));
00911 
00912         /* draw the current line */
00913         glBegin(GL_LINES);
00914         glVertex2f(lastx, lasty);
00915         glVertex2f(deltax, currHeight);
00916         glEnd();
00917 
00918         // save x und y position to draw the line in the next iteration */
00919         lastx = deltax;
00920         lasty = currHeight;
00921 
00922         //            Real32 angle = 0.0;
00923         /* draw Point if wanted */
00924         if(flags & OSG_ENABLE_POINTS)
00925         {
00926             /* filled circle
00927                        glPushMatrix();
00928                        glTranslatef(deltax, currHeight, 0.0);
00929                        glBegin(GL_POLYGON);
00930                        for (angle = 0.0; angle < 2 * Pi; angle += Pi / 24)
00931                        {
00932                        glVertex2f(0.0125 *cos(angle), 0.0125 * sin(angle));
00933                        }
00934                        glEnd();
00935                        glPopMatrix();*/
00936             // draw one single point with GL_POINT_SIZE =
00937             glPointSize(2.0f * getLineWidth());
00938             glBegin(GL_POINTS);
00939             glVertex2f(deltax, currHeight);
00940             glEnd();
00941         }                                   // end if
00942 
00943         deltax += step;
00944     }                                       // end for
00945 
00946     glMatrixMode(GL_MODELVIEW);
00947     glPopMatrix();
00948 
00949     // draw some text ------------
00950     if(getTextEnabled())
00951     {
00952         // create some Strings to be drawn
00953         std::string valstr = getDescription()[elementID] + " " +
00954                     real2String(realValue);
00955 
00956         // set color to draw the text with
00957         glColor4f(1.0f - c[0], 1.0f - c[1], 1.0f - c[2], 1.0f);
00958 
00959         // scale and translate the text
00960         Real32  ratio = ((Real32) port->getPixelHeight()) /
00961             ((Real32) port->getPixelWidth());
00962 
00963         // bottom: Current Value
00964         glMatrixMode(GL_MODELVIEW);
00965         glPushMatrix();
00966         glTranslatef(0.5, 0.01, 0.0);
00967         glScalef(0.2f * ratio, 0.2f, 1.0f);
00968         drawString(base, valstr, TextLayoutParam::ALIGN_MIDDLE);
00969         glMatrixMode(GL_MODELVIEW);
00970         glPopMatrix();
00971 
00972         //draw: min value
00973         if(flags & OSG_MAX_TEXT)
00974         {
00975             std::string minstr = real2String(minV, "%.0f");
00976             glMatrixMode(GL_MODELVIEW);
00977             glPushMatrix();
00978             glTranslatef(0.0, 0.22, 0.0);
00979             glScalef(0.12f * ratio, 0.12f, 1.0f);
00980             drawString(base, minstr);
00981             glMatrixMode(GL_MODELVIEW);
00982             glPopMatrix();
00983         }
00984 
00985         //draw: maximum value
00986         if(flags & OSG_MIN_TEXT)
00987         {
00988             std::string maxstr = real2String(maxV, "%.0f");
00989             glMatrixMode(GL_MODELVIEW);
00990             glPushMatrix();
00991             glTranslatef(0.0, 1.0, 0.0);
00992             glScalef(0.12f * ratio, 0.12f, 1.0f);
00993             drawString(base, maxstr, TextLayoutParam::ALIGN_FIRST,
00994                        TextLayoutParam::ALIGN_FIRST);
00995             glMatrixMode(GL_MODELVIEW);
00996             glPopMatrix();
00997         }
00998     }
00999 
01000     // end of text drawing ------
01001 }

void GraphicStatisticsForeground::drawBar ( UInt32  elementID,
StatElem el,
DrawActionBase base,
Viewport port 
) [protected]

Definition at line 666 of file OSGGraphicStatisticsForeground.cpp.

References _history, osg::TextLayoutParam::ALIGN_END, osg::TextLayoutParam::ALIGN_MIDDLE, drawString(), osg::GraphicStatisticsForegroundBase::getBackgroundColor(), osg::GraphicStatisticsForegroundBase::getBackgroundEnabled(), osg::GraphicStatisticsForegroundBase::getBorderEnabled(), osg::GraphicStatisticsForegroundBase::getColorCurrent(), osg::GraphicStatisticsForegroundBase::getColorMax(), osg::GraphicStatisticsForegroundBase::getColorMin(), osg::GraphicStatisticsForegroundBase::getDescription(), osg::GraphicStatisticsForegroundBase::getMaxValue(), osg::GraphicStatisticsForegroundBase::getMinValue(), osg::Viewport::getPixelHeight(), osg::Viewport::getPixelWidth(), osg::GraphicStatisticsForegroundBase::getTextEnabled(), osg::StatElem::getValue(), processOnlyValue(), processValue(), and real2String().

Referenced by draw().

00668 {
00669     // The amount of the display to be used for the text on the bottom
00670     Real32  textHeight = 0.0;
00671     Real32  textWidth = 0.0;
00672 
00673     if(getTextEnabled())
00674     {
00675         textHeight = 0.2;
00676         textWidth = 0.0;
00677     }
00678 
00679     Real32  xdist = 0;                      // helper Var
00680     Real32  minV = getMinValue()[elementID];
00681     Real32  maxV = getMaxValue()[elementID];
00682 
00683     Real32  value = Real32(el->getValue());
00684     Real32  vsave = value;
00685 
00686     //std::cout << "Bar value: " << value << std::endl;
00687     processValue(value, elementID);
00688     processOnlyValue(vsave, elementID);
00689 
00690     // draw a rectangle with alpha value
00691     Color3f c = getBackgroundColor();
00692     if(getBackgroundEnabled())
00693     {
00694         glColor4f(c[0], c[1], c[2], 0.4);
00695         glRectf(0.0, 0.0, 1.0, 1.0);
00696     }
00697 
00698     // draw a Frame around the display
00699     if(getBorderEnabled())
00700     {
00701         glColor4f(c[0], c[1], c[2], 0.8);
00702         glBegin(GL_LINE_STRIP);
00703         glVertex2f(0.0, 0.0);
00704         glVertex2f(1.0, 0.0);
00705         glVertex2f(1.0, 1.0);
00706         glVertex2f(0.0, 1.0);
00707         glEnd();
00708     }
00709 
00710     // get the Colors into private vars
00711     Color4f MinColor = getColorMin()[elementID];
00712     Color4f CurrentColor = getColorCurrent()[elementID];
00713     Color4f MaxColor = getColorMax()[elementID];
00714 
00715     // xdist helps to calculate the real size[0] of the quadstrip and the colors
00716     xdist = (value - minV) / (maxV - minV) * (1.0f - 2 * textWidth) + textWidth;
00717 
00718     /* draw the quads */
00719     if(xdist < 0.5)
00720     {
00721         glColor4f(MinColor[0], MinColor[1], MinColor[2], getColorMin()[elementID][3]);
00722         glBegin(GL_QUADS);
00723         glVertex2f(textWidth, textHeight);
00724         glVertex2f(textWidth, 1.0);
00725         glColor4f(CurrentColor[0] * 2 * xdist + MinColor[0] * (1 - (2 * xdist)),
00726                   CurrentColor[1] * 2 * xdist + MinColor[1] * (1 - (2 * xdist)),
00727                   CurrentColor[2] * 2 * xdist + MinColor[2] * (1 - (2 * xdist)),
00728                   getColorCurrent()[elementID][3]);
00729         glVertex2f(xdist, 1.0);
00730         glVertex2f(xdist, textHeight);
00731         glEnd();
00732     }                                       // end if
00733     else                                    //if xdist > 0.5
00734     {
00735         glBegin(GL_QUADS);
00736 
00737         // draw first quad
00738         glColor4f(MinColor[0], MinColor[1], MinColor[2], getColorMin()[elementID][3]);
00739         glVertex2f(textWidth, textHeight);
00740         glVertex2f(textWidth, 1.0);
00741         glColor4f(CurrentColor[0], CurrentColor[1], CurrentColor[2],
00742                   getColorCurrent()[elementID][3]);
00743         glVertex2f(0.5, 1.0);
00744         glVertex2f(0.5, textHeight);
00745 
00746         // draw second quad
00747         glVertex2f(0.5, textHeight);
00748         glVertex2f(0.5, 1.0);
00749         glColor4f(MaxColor[0] * ((xdist - 0.5f) * 2) + CurrentColor[0] *
00750                     (1 - ((xdist - 0.5f) * 2)),
00751                   MaxColor[1] * ((xdist - 0.5f) * 2) + CurrentColor[1] *
00752                     (1 - ((xdist - 0.5f) * 2)),
00753                   MaxColor[2] * ((xdist - 0.5f) * 2) + CurrentColor[2] *
00754                     (1 - ((xdist - 0.5f) * 2)), getColorMax()[elementID][3]);
00755         glVertex2f(0.5f + ((xdist - 0.5f)), 1.0);
00756         glVertex2f(0.5f + ((xdist - 0.5f)), textHeight);
00757         glEnd();
00758     }                                       // end else
00759 
00760     /* draw a line representing the real current value
00761        if the value to be digitized is smoothed */
00762     if(_history[elementID].size() > 0)
00763     {
00764         glColor4f(1.0, 1.0, 0.0, 1.0);
00765         glBegin(GL_LINES);
00766 
00767         glVertex2f((vsave - minV) / (maxV - minV) * (1.0f - 2 * textWidth) +
00768                            textWidth, 1.0f);
00769         glVertex2f((vsave - minV) / (maxV - minV) * (1.0f - 2 * textWidth) +
00770                            textWidth, textHeight);
00771         glEnd();
00772     }
00773 
00774     // Draw the text
00775     if(getTextEnabled())
00776     {
00777         // create some Strings to be drawn
00778         std::string valstr = getDescription()[elementID] + " " + real2String(value);
00779         std::string minstr = real2String(minV, "%.0f");
00780         std::string maxstr = real2String(maxV, "%.0f");
00781 
00782         // set color to draw the text with
00783         glColor4f(1.0f - c[0], 1.0f - c[1], 1.0f - c[2], 1.0f);
00784 
00785         // scale and translate the text
00786         Real32  ratio = ((Real32) port->getPixelHeight()) /
00787             ((Real32) port->getPixelWidth());
00788 
00789         // Left side: Min
00790         glMatrixMode(GL_MODELVIEW);
00791         glPushMatrix();
00792         glTranslatef(0.0, 0.7, 0.0);
00793         glScalef(0.15f * ratio, 0.15f, 1.0f);
00794         drawString(base, minstr);
00795         glMatrixMode(GL_MODELVIEW);
00796         glPopMatrix();
00797 
00798         // right side: Max
00799         glMatrixMode(GL_MODELVIEW);
00800         glPushMatrix();
00801         glTranslatef(1.0, 0.7, 0.0);
00802         glScalef(0.15f * ratio, 0.15f, 1.0f);
00803         drawString(base, maxstr, TextLayoutParam::ALIGN_END);
00804         glMatrixMode(GL_MODELVIEW);
00805         glPopMatrix();
00806 
00807         // bottom: Current Value
00808         glMatrixMode(GL_MODELVIEW);
00809         glPushMatrix();
00810         glTranslatef(0.5f, 0.01f, 0.0f);
00811         glScalef(0.2f * ratio, 0.2f, 1.0f);
00812         drawString(base, valstr, TextLayoutParam::ALIGN_MIDDLE);
00813         glMatrixMode(GL_MODELVIEW);
00814         glPopMatrix();
00815     }
00816 
00817     // end of text drawing ------
00818 }

void GraphicStatisticsForeground::drawText ( UInt32  elementID,
StatElem el,
DrawActionBase base,
Viewport port 
) [protected]

Definition at line 1004 of file OSGGraphicStatisticsForeground.cpp.

References drawString(), osg::GraphicStatisticsForegroundBase::getBackgroundColor(), osg::GraphicStatisticsForegroundBase::getBackgroundEnabled(), osg::GraphicStatisticsForegroundBase::getBorderEnabled(), osg::GraphicStatisticsForegroundBase::getDescription(), osg::GraphicStatisticsForegroundBase::getMaxValue(), osg::GraphicStatisticsForegroundBase::getMinValue(), osg::Viewport::getPixelHeight(), osg::Viewport::getPixelWidth(), osg::StatElem::getValue(), processOnlyValue(), and real2String().

Referenced by draw().

01006 {
01007     /* Get the current value and process it */
01008     Real32  value = Real32(el->getValue());
01009     processOnlyValue(value, elementID);
01010 
01011     //std::cout << "TextChart value: " << value << std::endl;
01012     /* get value, calculate minimum value and maximun value and
01013        convert into a string*/
01014     Real32      minV = getMinValue()[elementID];
01015     Real32      maxV = getMaxValue()[elementID];
01016     std::string minstr = real2String(minV, "%.0f");
01017     std::string maxstr = real2String(maxV, "%.0f");
01018     std::string valstr = getDescription()[elementID] + " " + real2String(value);
01019 
01020     // draw a rectangle with alpha value
01021     Color3f     c = getBackgroundColor();
01022     if(getBackgroundEnabled())
01023     {
01024         glColor4f(c[0], c[1], c[2], 0.4);
01025         glRectf(0.0, 0.0, 1.0, 1.0);
01026     }
01027 
01028     // draw a Frame around the display
01029     if(getBorderEnabled())
01030     {
01031         glColor4f(c[0], c[1], c[2], 0.8);
01032         glBegin(GL_LINE_STRIP);
01033         glVertex2f(0.0, 0.0);
01034         glVertex2f(1.0, 0.0);
01035         glVertex2f(1.0, 1.0);
01036         glVertex2f(0.0, 1.0);
01037         glEnd();
01038     }
01039 
01040     // set color to draw the text with
01041     glColor4f(1.0f - c[0], 1.0f - c[1], 1.0f - c[2], 1.0f);
01042 
01043     // scale and translate the text
01044     Real32  ratio = ((Real32) port->getPixelHeight()) /
01045         ((Real32) port->getPixelWidth());
01046 
01047     // Current Value
01048     glMatrixMode(GL_MODELVIEW);
01049     glPushMatrix();
01050     glTranslatef(0.02, 0.7, 0.0);
01051     glScalef(0.18f * ratio, 0.18f, 1.0f);
01052     drawString(base, valstr);
01053     glMatrixMode(GL_MODELVIEW);
01054     glPopMatrix();
01055 
01056     // MinValue
01057     glMatrixMode(GL_MODELVIEW);
01058     glPushMatrix();
01059     glTranslatef(0.02, 0.5, 0.0);
01060     glScalef(0.18f * ratio, 0.18f, 1.0f);
01061     drawString(base, "Min: " + minstr);
01062     glMatrixMode(GL_MODELVIEW);
01063     glPopMatrix();
01064 
01065     // MaxValue
01066     glMatrixMode(GL_MODELVIEW);
01067     glPushMatrix();
01068     glTranslatef(0.02, 0.3, 0.0);
01069     glScalef(0.18f * ratio, 0.18f, 1.0f);
01070     drawString(base, "Max: " + maxstr);
01071     glMatrixMode(GL_MODELVIEW);
01072     glPopMatrix();
01073 }

void GraphicStatisticsForeground::initText ( void   )  [protected]

initialize the text

Definition at line 1164 of file OSGGraphicStatisticsForeground.cpp.

References _face, _texchunk, osg::addRefCP(), osg::addRefP(), osg::getStatisticsDefaultFont(), osg::getStatisticsDefaultFontTexture(), osg::NullFC, osg::subRefCP(), and osg::subRefP().

Referenced by draw().

01165 {
01166     // Cleanup
01167     if (_face != 0)
01168         subRefP(_face);
01169     if (_texchunk != NullFC)
01170         subRefCP(_texchunk);
01171 
01172     _face = getStatisticsDefaultFont();
01173     _texchunk = getStatisticsDefaultFontTexture();
01174 
01175     // Increment reference counters
01176     addRefP(_face);
01177     addRefCP(_texchunk);
01178 }

void GraphicStatisticsForeground::drawString ( DrawActionBase base,
const std::string &  text,
TextLayoutParam::Alignment  majorAlignment = TextLayoutParam::ALIGN_FIRST,
TextLayoutParam::Alignment  minorAlignment = TextLayoutParam::ALIGN_END 
) [protected]

Draws a String.

Definition at line 1181 of file OSGGraphicStatisticsForeground.cpp.

References _face, _texchunk, osg::TextTXFGlyph::COORD_BOTTOM, osg::TextTXFGlyph::COORD_LEFT, osg::TextTXFGlyph::COORD_RIGHT, osg::TextTXFGlyph::COORD_TOP, osg::TextTXFGlyph::getHeight(), osg::TextLayoutResult::getNumGlyphs(), osg::TextTXFGlyph::getTexCoord(), osg::TextTXFFace::getTXFGlyph(), osg::TextTXFGlyph::getWidth(), osg::TextLayoutResult::indices, osg::TextTXFFace::layout(), osg::TextLayoutParam::majorAlignment, osg::TextLayoutParam::minorAlignment, and osg::TextLayoutResult::positions.

Referenced by drawAnalog(), drawBar(), drawChart(), drawLineChart(), and drawText().

01185 {
01186     std::vector < std::string > stat(1);
01187     stat[0] = text;
01188 
01189     TextLayoutParam layoutParam;
01190     layoutParam.majorAlignment = majorAlignment;
01191     layoutParam.minorAlignment = minorAlignment;
01192     TextLayoutResult layoutResult;
01193     _face->layout(stat, layoutParam, layoutResult);
01194 
01195     glMatrixMode(GL_MODELVIEW);
01196     glPushMatrix();
01197 
01198     // Draw the text
01199     _texchunk->activate(base);
01200 
01201     glBegin(GL_QUADS);
01202     UInt32 i, numGlyphs = layoutResult.getNumGlyphs();
01203     for(i = 0; i < numGlyphs; ++i)
01204     {
01205         const TextTXFGlyph &glyph = _face->getTXFGlyph(layoutResult.indices[i]);
01206         Real32 width = glyph.getWidth();
01207         Real32 height = glyph.getHeight();
01208         // No need to draw invisible glyphs
01209         if ((width <= 0.f) || (height <= 0.f))
01210             continue;
01211 
01212         // Calculate coordinates
01213         const Vec2f &pos = layoutResult.positions[i];
01214         Real32 posLeft = pos.x();
01215         Real32 posTop = pos.y();
01216         Real32 posRight = pos.x() + width;
01217         Real32 posBottom = pos.y() - height;
01218         Real32 texCoordLeft = glyph.getTexCoord(TextTXFGlyph::COORD_LEFT);
01219         Real32 texCoordTop = glyph.getTexCoord(TextTXFGlyph::COORD_TOP);
01220         Real32 texCoordRight = glyph.getTexCoord(TextTXFGlyph::COORD_RIGHT);
01221         Real32 texCoordBottom = glyph.getTexCoord(TextTXFGlyph::COORD_BOTTOM);
01222 
01223         // lower left corner
01224         glTexCoord2f(texCoordLeft, texCoordBottom);
01225         glVertex2f(posLeft, posBottom);
01226 
01227         // lower right corner
01228         glTexCoord2f(texCoordRight, texCoordBottom);
01229         glVertex2f(posRight, posBottom);
01230 
01231         // upper right corner
01232         glTexCoord2f(texCoordRight, texCoordTop);
01233         glVertex2f(posRight, posTop);
01234 
01235         // upper left corner
01236         glTexCoord2f(texCoordLeft, texCoordTop);
01237         glVertex2f(posLeft, posTop);
01238     }
01239     glEnd();
01240 
01241     _texchunk->deactivate(base);
01242 
01243     glMatrixMode(GL_MODELVIEW);
01244     glPopMatrix();
01245 }

std::string GraphicStatisticsForeground::real2String ( Real32  value,
char *  format = 0 
) [protected]

Definition at line 1248 of file OSGGraphicStatisticsForeground.cpp.

Referenced by drawAnalog(), drawBar(), drawChart(), drawLineChart(), and drawText().

01249 {
01250     char    buff[100];
01251 
01252     if(format == 0)
01253         sprintf(buff, "%.2f", value);
01254     else
01255         sprintf(buff, format, value);
01256 
01257     std::string Result(buff);
01258 
01259     return Result;
01260 }

void GraphicStatisticsForeground::calcPosAndSize ( const UInt32 elementID,
Viewport port,
Vec2f Position,
Vec2f Size 
) [protected]

Definition at line 1080 of file OSGGraphicStatisticsForeground.cpp.

References osg::Viewport::getPixelHeight(), osg::Viewport::getPixelWidth(), osg::GraphicStatisticsForegroundBase::getPos(), osg::GraphicStatisticsForegroundBase::getSize(), and osg::osgabs().

Referenced by draw().

01084 {
01085     // Width and Height of the current viewport
01086     // needed for pixel to relative conversion
01087     Real32  pw = Real32(port->getPixelWidth ());     // PixelWidth
01088     Real32  ph = Real32(port->getPixelHeight());    // PixelHeight
01089     Real32  ratio = pw / ph;
01090 
01091     /*
01092       Calculate the size
01093     */
01094     Vec2f size = getSize(id); // Temp Size
01095 
01096     // Check for values < 0
01097     // If both values a <0 fall back to
01098     if(size[0] < 0 && size[1] < 0)
01099     {
01100         size[0] = size[1] = 1.0;
01101     }
01102     else
01103     {
01104         if(size[0] < 0)
01105         {
01106             size[0] = osgabs(size[0]) * size[1] / ratio;
01107         }
01108 
01109         if(size[1] < 0)
01110         {
01111             size[1] = osgabs(size[1]) * size[0] * ratio;
01112         }
01113     }
01114 
01115     //convert pixel based sizes to relative ones
01116     if(size[0] > 1.0)
01117         size[0] = size[0] / pw;
01118     if(size[1] > 1.0)
01119         size[1] = size[1] / ph;
01120 
01121     // Save the Size
01122     (*Size) = size;
01123 
01124     /*
01125       calculate the position
01126     */
01127     Vec2f pos = getPos(id); // Temp Position
01128 
01129     // Hack the floats
01130     bool    xneg = false;
01131     bool    yneg = false;
01132 
01133     if(pos[0] < 0)
01134     {
01135         pos[0] = pos[0] + 1;
01136         xneg = true;
01137     }
01138 
01139     if(pos[1] < 0)
01140     {
01141         pos[1] = pos[1] + 1;
01142         yneg = true;
01143     }
01144 
01145     // convert the pixel Data to relative positions
01146     if(osgabs(pos[0]) > 1.0)
01147         pos[0] = pos[0] / pw;
01148     if(osgabs(pos[1]) > 1.0)
01149         pos[1] = pos[1] / ph;
01150 
01151     // check whether the positions are relative to the right/bottom
01152     if(xneg)
01153         pos[0] = 1.0f + pos[0] - size[0];
01154     if(yneg)
01155         pos[1] = 1.0f + pos[1] - size[1];
01156 
01157     // Save the calculated position
01158     (*Position) = pos;
01159 }

void osg::GraphicStatisticsForeground::processValue ( Real32 value,
const UInt32 elementID 
) [inline, protected]

Definition at line 43 of file OSGGraphicStatisticsForeground.inl.

References addValueToHistory(), and processOnlyValue().

Referenced by drawAnalog(), drawBar(), drawChart(), and drawLineChart().

00045 {
00046     processOnlyValue(value, elementID);
00047     addValueToHistory(value, elementID);
00048 }

void osg::GraphicStatisticsForeground::processOnlyValue ( Real32 value,
const UInt32 elementID 
) [inline, protected]

Definition at line 51 of file OSGGraphicStatisticsForeground.inl.

References osg::GraphicStatisticsForegroundBase::getFlags(), osg::GraphicStatisticsForegroundBase::getMaxValue(), osg::GraphicStatisticsForegroundBase::getMinValue(), OSG_OVERFLOW_RESIZE, OSG_RECIPROC, and OSG_UNDERFLOW_RESIZE.

Referenced by drawAnalog(), drawBar(), drawText(), and processValue().

00053 {
00054     UInt32  flags = getFlags()[elementID];
00055     Real32  minV = getMinValue()[elementID];
00056     Real32  maxV = getMaxValue()[elementID];
00057 
00058     /* check for invert */
00059     if(flags & OSG_RECIPROC)
00060     {
00061         value = 1.0f / value;
00062     }
00063 
00064     /* check for a to big Value */
00065     if(value > maxV)
00066     {
00067         if(flags & OSG_OVERFLOW_RESIZE)
00068         {
00069             getMaxValue()[elementID] = value;
00070         }
00071         else
00072         {
00073             value = maxV;
00074         }
00075     }
00076 
00077     /* check for to small values */
00078     if(value < minV)
00079     {
00080         if(flags & OSG_UNDERFLOW_RESIZE)
00081         {
00082             getMinValue()[elementID] = value;
00083         }
00084         else
00085         {
00086             value = minV;
00087         }
00088     }
00089 
00090     /* end of these checks */
00091 }

void osg::GraphicStatisticsForeground::addValueToHistory ( Real32 value,
const UInt32 elementID 
) [inline, protected]

Definition at line 94 of file OSGGraphicStatisticsForeground.inl.

References _history, _historyID, osg::GraphicStatisticsForegroundBase::getFlags(), osg::GraphicStatisticsForegroundBase::getMaxValue(), osg::GraphicStatisticsForegroundBase::getMinValue(), OSG_OVERFLOW_RESIZE, OSG_SMOOTH, OSG_UNDERFLOW_RESIZE, osg::osgMax(), and osg::osgMin().

Referenced by processValue().

00096 {
00097     UInt32  flags = getFlags()[elementID];
00098 
00099     /* Smooth the value, if asked for */
00100     UInt32  hSize = _history.size();
00101     UInt32  size = (elementID < hSize) ? _history[elementID].size() : 0;
00102 
00103     if(size > 0)
00104     {
00105         UInt32  queueEnd = _historyID[elementID];
00106         _history[elementID][queueEnd] = value;
00107 
00108         /* increment the queue end */
00109         _historyID[elementID] = (_historyID[elementID] + 1) % size;
00110 
00111         /* check whether the value should be smoothed */
00112         if((flags & OSG_SMOOTH) ||
00113                    (flags & OSG_OVERFLOW_RESIZE) ||
00114                    (flags & OSG_UNDERFLOW_RESIZE))
00115         {
00116             Real32  v = 0.0, max = 0.0, min = 0.0, sum = 0.0;
00117 
00118             for(UInt32 i = 0; i < size; i++)
00119             {
00120                 v = _history[elementID][i];
00121 
00122                 if(i)
00123                 {
00124                     if(v > max)
00125                         max = v;
00126                     else if(v < min)
00127                         min = v;
00128                 }
00129                 else
00130                     min = max = v;
00131 
00132                 sum += v;
00133             }
00134 
00135             if(flags & OSG_SMOOTH)
00136             {
00137                 value = sum / size;
00138 
00139                 //_history[ID][queueEnd] = value;
00140             }
00141 
00142             if((flags & OSG_OVERFLOW_RESIZE) && (max < getMaxValue()[elementID]))
00143             {
00144                 max += (getMaxValue()[elementID] - max) / 2.0f;
00145                 getMaxValue()[elementID] = osgMax(v, max);
00146             }
00147 
00148             if((flags & OSG_UNDERFLOW_RESIZE) && (min > getMinValue()[elementID]))
00149             {
00150                 min -= (min - getMinValue()[elementID]) / 2.0f;
00151                 getMinValue()[elementID] = osgMin(v, min);
00152             }
00153         }
00154     }
00155 }

void GraphicStatisticsForeground::initMethod ( void   )  [static, private]

Reimplemented from osg::StatisticsForeground.

Definition at line 104 of file OSGGraphicStatisticsForeground.cpp.

00105 {
00106 }

void osg::GraphicStatisticsForeground::operator= ( const GraphicStatisticsForeground source  )  [private]

osg::FieldContainerType & osg::GraphicStatisticsForegroundBase::getClassType ( void   )  [inline, static, inherited]

Reimplemented from osg::StatisticsForegroundBase.

Definition at line 58 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_type.

Referenced by osg::GraphicStatisticsForegroundBase::create().

00059 {
00060     return _type; 
00061 } 

osg::UInt32 osg::GraphicStatisticsForegroundBase::getClassTypeId ( void   )  [inline, static, inherited]

Reimplemented from osg::StatisticsForegroundBase.

Definition at line 65 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_type, and osg::TypeBase::getId().

00066 {
00067     return _type.getId(); 
00068 } 

FieldContainerType & GraphicStatisticsForegroundBase::getType ( void   )  [virtual, inherited]

Reimplemented from osg::StatisticsForegroundBase.

Definition at line 271 of file OSGGraphicStatisticsForegroundBase.cpp.

References osg::GraphicStatisticsForegroundBase::_type.

00272 {
00273     return _type; 
00274 } 

const FieldContainerType & GraphicStatisticsForegroundBase::getType ( void   )  const [virtual, inherited]

Reimplemented from osg::StatisticsForegroundBase.

Definition at line 276 of file OSGGraphicStatisticsForegroundBase.cpp.

References osg::GraphicStatisticsForegroundBase::_type.

00277 {
00278     return _type;
00279 } 

UInt32 GraphicStatisticsForegroundBase::getContainerSize ( void   )  const [virtual, inherited]

Reimplemented from osg::StatisticsForegroundBase.

Definition at line 291 of file OSGGraphicStatisticsForegroundBase.cpp.

00292 { 
00293     return sizeof(GraphicStatisticsForeground); 
00294 }

MFString * osg::GraphicStatisticsForegroundBase::getMFDescription ( void   )  [inline, inherited]

Definition at line 171 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfDescription.

00172 {
00173     return &_mfDescription;
00174 }

SFReal32 * osg::GraphicStatisticsForegroundBase::getSFLineWidth ( void   )  [inline, inherited]

Definition at line 178 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_sfLineWidth.

00179 {
00180     return &_sfLineWidth;
00181 }

SFColor3f * osg::GraphicStatisticsForegroundBase::getSFBackgroundColor ( void   )  [inline, inherited]

SFBool * osg::GraphicStatisticsForegroundBase::getSFTextEnabled ( void   )  [inline, inherited]

Definition at line 192 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_sfTextEnabled.

00193 {
00194     return &_sfTextEnabled;
00195 }

SFBool * osg::GraphicStatisticsForegroundBase::getSFBackgroundEnabled ( void   )  [inline, inherited]

SFBool * osg::GraphicStatisticsForegroundBase::getSFBorderEnabled ( void   )  [inline, inherited]

Definition at line 206 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_sfBorderEnabled.

00207 {
00208     return &_sfBorderEnabled;
00209 }

Real32 & osg::GraphicStatisticsForegroundBase::getLineWidth ( void   )  [inline, inherited]

const Real32 & osg::GraphicStatisticsForegroundBase::getLineWidth ( void   )  const [inline, inherited]

Color3f & osg::GraphicStatisticsForegroundBase::getBackgroundColor ( void   )  [inline, inherited]

const Color3f & osg::GraphicStatisticsForegroundBase::getBackgroundColor ( void   )  const [inline, inherited]

bool & osg::GraphicStatisticsForegroundBase::getTextEnabled ( void   )  [inline, inherited]

const bool & osg::GraphicStatisticsForegroundBase::getTextEnabled ( void   )  const [inline, inherited]

bool & osg::GraphicStatisticsForegroundBase::getBackgroundEnabled ( void   )  [inline, inherited]

const bool & osg::GraphicStatisticsForegroundBase::getBackgroundEnabled ( void   )  const [inline, inherited]

bool & osg::GraphicStatisticsForegroundBase::getBorderEnabled ( void   )  [inline, inherited]

const bool & osg::GraphicStatisticsForegroundBase::getBorderEnabled ( void   )  const [inline, inherited]

std::string & osg::GraphicStatisticsForegroundBase::getDescription ( const UInt32  index  )  [inline, inherited]

Definition at line 530 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfDescription.

00531 {
00532     return _mfDescription[index];
00533 }

MFString & osg::GraphicStatisticsForegroundBase::getDescription ( void   )  [inline, inherited]

const MFString & osg::GraphicStatisticsForegroundBase::getDescription ( void   )  const [inline, inherited]

Definition at line 544 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfDescription.

00545 {
00546     return _mfDescription;
00547 }

void osg::GraphicStatisticsForegroundBase::setLineWidth ( const Real32 value  )  [inline, inherited]

void osg::GraphicStatisticsForegroundBase::setBackgroundColor ( const Color3f value  )  [inline, inherited]

void osg::GraphicStatisticsForegroundBase::setTextEnabled ( const bool &  value  )  [inline, inherited]

void osg::GraphicStatisticsForegroundBase::setBackgroundEnabled ( const bool &  value  )  [inline, inherited]

void osg::GraphicStatisticsForegroundBase::setBorderEnabled ( const bool &  value  )  [inline, inherited]

UInt32 GraphicStatisticsForegroundBase::getBinSize ( const BitVector whichField  )  [virtual, inherited]

Reimplemented from osg::StatisticsForegroundBase.

Definition at line 394 of file OSGGraphicStatisticsForegroundBase.cpp.

References osg::GraphicStatisticsForegroundBase::_mfColorCurrent, osg::GraphicStatisticsForegroundBase::_mfColorMax, osg::GraphicStatisticsForegroundBase::_mfColorMin, osg::GraphicStatisticsForegroundBase::_mfDescription, osg::GraphicStatisticsForegroundBase::_mfDisplayType, osg::GraphicStatisticsForegroundBase::_mfFlags, osg::GraphicStatisticsForegroundBase::_mfHistorySize, osg::GraphicStatisticsForegroundBase::_mfMaxValue, osg::GraphicStatisticsForegroundBase::_mfMinValue, osg::GraphicStatisticsForegroundBase::_mfPos, osg::GraphicStatisticsForegroundBase::_mfSize, osg::GraphicStatisticsForegroundBase::_sfBackgroundColor, osg::GraphicStatisticsForegroundBase::_sfBackgroundEnabled, osg::GraphicStatisticsForegroundBase::_sfBorderEnabled, osg::GraphicStatisticsForegroundBase::_sfLineWidth, osg::GraphicStatisticsForegroundBase::_sfTextEnabled, osg::GraphicStatisticsForegroundBase::BackgroundColorFieldMask, osg::GraphicStatisticsForegroundBase::BackgroundEnabledFieldMask, osg::GraphicStatisticsForegroundBase::BorderEnabledFieldMask, osg::GraphicStatisticsForegroundBase::ColorCurrentFieldMask, osg::GraphicStatisticsForegroundBase::ColorMaxFieldMask, osg::GraphicStatisticsForegroundBase::ColorMinFieldMask, osg::GraphicStatisticsForegroundBase::DescriptionFieldMask, osg::GraphicStatisticsForegroundBase::DisplayTypeFieldMask, osg::GraphicStatisticsForegroundBase::FlagsFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::MField< FieldTypeT, fieldNameSpace >::getBinSize(), osg::StatisticsForegroundBase::getBinSize(), osg::GraphicStatisticsForegroundBase::HistorySizeFieldMask, osg::GraphicStatisticsForegroundBase::LineWidthFieldMask, osg::GraphicStatisticsForegroundBase::MaxValueFieldMask, osg::GraphicStatisticsForegroundBase::MinValueFieldMask, osg::FieldBits::NoField, osg::GraphicStatisticsForegroundBase::PosFieldMask, osg::GraphicStatisticsForegroundBase::SizeFieldMask, and osg::GraphicStatisticsForegroundBase::TextEnabledFieldMask.

00395 {
00396     UInt32 returnValue = Inherited::getBinSize(whichField);
00397 
00398     if(FieldBits::NoField != (DisplayTypeFieldMask & whichField))
00399     {
00400         returnValue += _mfDisplayType.getBinSize();
00401     }
00402 
00403     if(FieldBits::NoField != (SizeFieldMask & whichField))
00404     {
00405         returnValue += _mfSize.getBinSize();
00406     }
00407 
00408     if(FieldBits::NoField != (PosFieldMask & whichField))
00409     {
00410         returnValue += _mfPos.getBinSize();
00411     }
00412 
00413     if(FieldBits::NoField != (ColorMaxFieldMask & whichField))
00414     {
00415         returnValue += _mfColorMax.getBinSize();
00416     }
00417 
00418     if(FieldBits::NoField != (ColorMinFieldMask & whichField))
00419     {
00420         returnValue += _mfColorMin.getBinSize();
00421     }
00422 
00423     if(FieldBits::NoField != (ColorCurrentFieldMask & whichField))
00424     {
00425         returnValue += _mfColorCurrent.getBinSize();
00426     }
00427 
00428     if(FieldBits::NoField != (MinValueFieldMask & whichField))
00429     {
00430         returnValue += _mfMinValue.getBinSize();
00431     }
00432 
00433     if(FieldBits::NoField != (MaxValueFieldMask & whichField))
00434     {
00435         returnValue += _mfMaxValue.getBinSize();
00436     }
00437 
00438     if(FieldBits::NoField != (FlagsFieldMask & whichField))
00439     {
00440         returnValue += _mfFlags.getBinSize();
00441     }
00442 
00443     if(FieldBits::NoField != (HistorySizeFieldMask & whichField))
00444     {
00445         returnValue += _mfHistorySize.getBinSize();
00446     }
00447 
00448     if(FieldBits::NoField != (DescriptionFieldMask & whichField))
00449     {
00450         returnValue += _mfDescription.getBinSize();
00451     }
00452 
00453     if(FieldBits::NoField != (LineWidthFieldMask & whichField))
00454     {
00455         returnValue += _sfLineWidth.getBinSize();
00456     }
00457 
00458     if(FieldBits::NoField != (BackgroundColorFieldMask & whichField))
00459     {
00460         returnValue += _sfBackgroundColor.getBinSize();
00461     }
00462 
00463     if(FieldBits::NoField != (TextEnabledFieldMask & whichField))
00464     {
00465         returnValue += _sfTextEnabled.getBinSize();
00466     }
00467 
00468     if(FieldBits::NoField != (BackgroundEnabledFieldMask & whichField))
00469     {
00470         returnValue += _sfBackgroundEnabled.getBinSize();
00471     }
00472 
00473     if(FieldBits::NoField != (BorderEnabledFieldMask & whichField))
00474     {
00475         returnValue += _sfBorderEnabled.getBinSize();
00476     }
00477 
00478 
00479     return returnValue;
00480 }

void GraphicStatisticsForegroundBase::copyToBin ( BinaryDataHandler pMem,
const BitVector whichField 
) [virtual, inherited]

Reimplemented from osg::StatisticsForegroundBase.

Definition at line 482 of file OSGGraphicStatisticsForegroundBase.cpp.

References osg::GraphicStatisticsForegroundBase::_mfColorCurrent, osg::GraphicStatisticsForegroundBase::_mfColorMax, osg::GraphicStatisticsForegroundBase::_mfColorMin, osg::GraphicStatisticsForegroundBase::_mfDescription, osg::GraphicStatisticsForegroundBase::_mfDisplayType, osg::GraphicStatisticsForegroundBase::_mfFlags, osg::GraphicStatisticsForegroundBase::_mfHistorySize, osg::GraphicStatisticsForegroundBase::_mfMaxValue, osg::GraphicStatisticsForegroundBase::_mfMinValue, osg::GraphicStatisticsForegroundBase::_mfPos, osg::GraphicStatisticsForegroundBase::_mfSize, osg::GraphicStatisticsForegroundBase::_sfBackgroundColor, osg::GraphicStatisticsForegroundBase::_sfBackgroundEnabled, osg::GraphicStatisticsForegroundBase::_sfBorderEnabled, osg::GraphicStatisticsForegroundBase::_sfLineWidth, osg::GraphicStatisticsForegroundBase::_sfTextEnabled, osg::GraphicStatisticsForegroundBase::BackgroundColorFieldMask, osg::GraphicStatisticsForegroundBase::BackgroundEnabledFieldMask, osg::GraphicStatisticsForegroundBase::BorderEnabledFieldMask, osg::GraphicStatisticsForegroundBase::ColorCurrentFieldMask, osg::GraphicStatisticsForegroundBase::ColorMaxFieldMask, osg::GraphicStatisticsForegroundBase::ColorMinFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::MField< FieldTypeT, fieldNameSpace >::copyToBin(), osg::StatisticsForegroundBase::copyToBin(), osg::GraphicStatisticsForegroundBase::DescriptionFieldMask, osg::GraphicStatisticsForegroundBase::DisplayTypeFieldMask, osg::GraphicStatisticsForegroundBase::FlagsFieldMask, osg::GraphicStatisticsForegroundBase::HistorySizeFieldMask, osg::GraphicStatisticsForegroundBase::LineWidthFieldMask, osg::GraphicStatisticsForegroundBase::MaxValueFieldMask, osg::GraphicStatisticsForegroundBase::MinValueFieldMask, osg::FieldBits::NoField, osg::GraphicStatisticsForegroundBase::PosFieldMask, osg::GraphicStatisticsForegroundBase::SizeFieldMask, and osg::GraphicStatisticsForegroundBase::TextEnabledFieldMask.

00484 {
00485     Inherited::copyToBin(pMem, whichField);
00486 
00487     if(FieldBits::NoField != (DisplayTypeFieldMask & whichField))
00488     {
00489         _mfDisplayType.copyToBin(pMem);
00490     }
00491 
00492     if(FieldBits::NoField != (SizeFieldMask & whichField))
00493     {
00494         _mfSize.copyToBin(pMem);
00495     }
00496 
00497     if(FieldBits::NoField != (PosFieldMask & whichField))
00498     {
00499         _mfPos.copyToBin(pMem);
00500     }
00501 
00502     if(FieldBits::NoField != (ColorMaxFieldMask & whichField))
00503     {
00504         _mfColorMax.copyToBin(pMem);
00505     }
00506 
00507     if(FieldBits::NoField != (ColorMinFieldMask & whichField))
00508     {
00509         _mfColorMin.copyToBin(pMem);
00510     }
00511 
00512     if(FieldBits::NoField != (ColorCurrentFieldMask & whichField))
00513     {
00514         _mfColorCurrent.copyToBin(pMem);
00515     }
00516 
00517     if(FieldBits::NoField != (MinValueFieldMask & whichField))
00518     {
00519         _mfMinValue.copyToBin(pMem);
00520     }
00521 
00522     if(FieldBits::NoField != (MaxValueFieldMask & whichField))
00523     {
00524         _mfMaxValue.copyToBin(pMem);
00525     }
00526 
00527     if(FieldBits::NoField != (FlagsFieldMask & whichField))
00528     {
00529         _mfFlags.copyToBin(pMem);
00530     }
00531 
00532     if(FieldBits::NoField != (HistorySizeFieldMask & whichField))
00533     {
00534         _mfHistorySize.copyToBin(pMem);
00535     }
00536 
00537     if(FieldBits::NoField != (DescriptionFieldMask & whichField))
00538     {
00539         _mfDescription.copyToBin(pMem);
00540     }
00541 
00542     if(FieldBits::NoField != (LineWidthFieldMask & whichField))
00543     {
00544         _sfLineWidth.copyToBin(pMem);
00545     }
00546 
00547     if(FieldBits::NoField != (BackgroundColorFieldMask & whichField))
00548     {
00549         _sfBackgroundColor.copyToBin(pMem);
00550     }
00551 
00552     if(FieldBits::NoField != (TextEnabledFieldMask & whichField))
00553     {
00554         _sfTextEnabled.copyToBin(pMem);
00555     }
00556 
00557     if(FieldBits::NoField != (BackgroundEnabledFieldMask & whichField))
00558     {
00559         _sfBackgroundEnabled.copyToBin(pMem);
00560     }
00561 
00562     if(FieldBits::NoField != (BorderEnabledFieldMask & whichField))
00563     {
00564         _sfBorderEnabled.copyToBin(pMem);
00565     }
00566 
00567 
00568 }

void GraphicStatisticsForegroundBase::copyFromBin ( BinaryDataHandler pMem,
const BitVector whichField 
) [virtual, inherited]

Reimplemented from osg::StatisticsForegroundBase.

Definition at line 570 of file OSGGraphicStatisticsForegroundBase.cpp.

References osg::GraphicStatisticsForegroundBase::_mfColorCurrent, osg::GraphicStatisticsForegroundBase::_mfColorMax, osg::GraphicStatisticsForegroundBase::_mfColorMin, osg::GraphicStatisticsForegroundBase::_mfDescription, osg::GraphicStatisticsForegroundBase::_mfDisplayType, osg::GraphicStatisticsForegroundBase::_mfFlags, osg::GraphicStatisticsForegroundBase::_mfHistorySize, osg::GraphicStatisticsForegroundBase::_mfMaxValue, osg::GraphicStatisticsForegroundBase::_mfMinValue, osg::GraphicStatisticsForegroundBase::_mfPos, osg::GraphicStatisticsForegroundBase::_mfSize, osg::GraphicStatisticsForegroundBase::_sfBackgroundColor, osg::GraphicStatisticsForegroundBase::_sfBackgroundEnabled, osg::GraphicStatisticsForegroundBase::_sfBorderEnabled, osg::GraphicStatisticsForegroundBase::_sfLineWidth, osg::GraphicStatisticsForegroundBase::_sfTextEnabled, osg::GraphicStatisticsForegroundBase::BackgroundColorFieldMask, osg::GraphicStatisticsForegroundBase::BackgroundEnabledFieldMask, osg::GraphicStatisticsForegroundBase::BorderEnabledFieldMask, osg::GraphicStatisticsForegroundBase::ColorCurrentFieldMask, osg::GraphicStatisticsForegroundBase::ColorMaxFieldMask, osg::GraphicStatisticsForegroundBase::ColorMinFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::MField< FieldTypeT, fieldNameSpace >::copyFromBin(), osg::StatisticsForegroundBase::copyFromBin(), osg::GraphicStatisticsForegroundBase::DescriptionFieldMask, osg::GraphicStatisticsForegroundBase::DisplayTypeFieldMask, osg::GraphicStatisticsForegroundBase::FlagsFieldMask, osg::GraphicStatisticsForegroundBase::HistorySizeFieldMask, osg::GraphicStatisticsForegroundBase::LineWidthFieldMask, osg::GraphicStatisticsForegroundBase::MaxValueFieldMask, osg::GraphicStatisticsForegroundBase::MinValueFieldMask, osg::FieldBits::NoField, osg::GraphicStatisticsForegroundBase::PosFieldMask, osg::GraphicStatisticsForegroundBase::SizeFieldMask, and osg::GraphicStatisticsForegroundBase::TextEnabledFieldMask.

00572 {
00573     Inherited::copyFromBin(pMem, whichField);
00574 
00575     if(FieldBits::NoField != (DisplayTypeFieldMask & whichField))
00576     {
00577         _mfDisplayType.copyFromBin(pMem);
00578     }
00579 
00580     if(FieldBits::NoField != (SizeFieldMask & whichField))
00581     {
00582         _mfSize.copyFromBin(pMem);
00583     }
00584 
00585     if(FieldBits::NoField != (PosFieldMask & whichField))
00586     {
00587         _mfPos.copyFromBin(pMem);
00588     }
00589 
00590     if(FieldBits::NoField != (ColorMaxFieldMask & whichField))
00591     {
00592         _mfColorMax.copyFromBin(pMem);
00593     }
00594 
00595     if(FieldBits::NoField != (ColorMinFieldMask & whichField))
00596     {
00597         _mfColorMin.copyFromBin(pMem);
00598     }
00599 
00600     if(FieldBits::NoField != (ColorCurrentFieldMask & whichField))
00601     {
00602         _mfColorCurrent.copyFromBin(pMem);
00603     }
00604 
00605     if(FieldBits::NoField != (MinValueFieldMask & whichField))
00606     {
00607         _mfMinValue.copyFromBin(pMem);
00608     }
00609 
00610     if(FieldBits::NoField != (MaxValueFieldMask & whichField))
00611     {
00612         _mfMaxValue.copyFromBin(pMem);
00613     }
00614 
00615     if(FieldBits::NoField != (FlagsFieldMask & whichField))
00616     {
00617         _mfFlags.copyFromBin(pMem);
00618     }
00619 
00620     if(FieldBits::NoField != (HistorySizeFieldMask & whichField))
00621     {
00622         _mfHistorySize.copyFromBin(pMem);
00623     }
00624 
00625     if(FieldBits::NoField != (DescriptionFieldMask & whichField))
00626     {
00627         _mfDescription.copyFromBin(pMem);
00628     }
00629 
00630     if(FieldBits::NoField != (LineWidthFieldMask & whichField))
00631     {
00632         _sfLineWidth.copyFromBin(pMem);
00633     }
00634 
00635     if(FieldBits::NoField != (BackgroundColorFieldMask & whichField))
00636     {
00637         _sfBackgroundColor.copyFromBin(pMem);
00638     }
00639 
00640     if(FieldBits::NoField != (TextEnabledFieldMask & whichField))
00641     {
00642         _sfTextEnabled.copyFromBin(pMem);
00643     }
00644 
00645     if(FieldBits::NoField != (BackgroundEnabledFieldMask & whichField))
00646     {
00647         _sfBackgroundEnabled.copyFromBin(pMem);
00648     }
00649 
00650     if(FieldBits::NoField != (BorderEnabledFieldMask & whichField))
00651     {
00652         _sfBorderEnabled.copyFromBin(pMem);
00653     }
00654 
00655 
00656 }

GraphicStatisticsForegroundPtr osg::GraphicStatisticsForegroundBase::create ( void   )  [inline, static, inherited]

Definition at line 72 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::AttachmentContainerPtr::dcast(), osg::GraphicStatisticsForegroundBase::getClassType(), osg::NullFC, and osg::GraphicStatisticsForegroundBase::shallowCopy().

00073 {
00074     GraphicStatisticsForegroundPtr fc; 
00075 
00076     if(getClassType().getPrototype() != OSG::NullFC) 
00077     {
00078         fc = GraphicStatisticsForegroundPtr::dcast(
00079             getClassType().getPrototype()-> shallowCopy()); 
00080     }
00081     
00082     return fc; 
00083 }

GraphicStatisticsForegroundPtr osg::GraphicStatisticsForegroundBase::createEmpty ( void   )  [inline, static, inherited]

Definition at line 87 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::FieldContainer::newPtr().

00088 { 
00089     GraphicStatisticsForegroundPtr returnValue; 
00090     
00091     newPtr(returnValue); 
00092 
00093     return returnValue; 
00094 }

FieldContainerPtr GraphicStatisticsForegroundBase::shallowCopy ( void   )  const [virtual, inherited]

Implements osg::FieldContainer.

Definition at line 282 of file OSGGraphicStatisticsForegroundBase.cpp.

References osg::FieldContainer::newPtr().

Referenced by osg::GraphicStatisticsForegroundBase::create().

00283 { 
00284     GraphicStatisticsForegroundPtr returnValue; 
00285 
00286     newPtr(returnValue, dynamic_cast<const GraphicStatisticsForeground *>(this)); 
00287 
00288     return returnValue; 
00289 }

MFUInt32 * osg::GraphicStatisticsForegroundBase::getMFDisplayType ( void   )  [inline, protected, inherited]

Definition at line 101 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfDisplayType.

00102 {
00103     return &_mfDisplayType;
00104 }

MFVec2f * osg::GraphicStatisticsForegroundBase::getMFSize ( void   )  [inline, protected, inherited]

Definition at line 108 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfSize.

00109 {
00110     return &_mfSize;
00111 }

MFVec2f * osg::GraphicStatisticsForegroundBase::getMFPos ( void   )  [inline, protected, inherited]

Definition at line 115 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfPos.

00116 {
00117     return &_mfPos;
00118 }

MFColor4f * osg::GraphicStatisticsForegroundBase::getMFColorMax ( void   )  [inline, protected, inherited]

Definition at line 122 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfColorMax.

00123 {
00124     return &_mfColorMax;
00125 }

MFColor4f * osg::GraphicStatisticsForegroundBase::getMFColorMin ( void   )  [inline, protected, inherited]

Definition at line 129 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfColorMin.

00130 {
00131     return &_mfColorMin;
00132 }

MFColor4f * osg::GraphicStatisticsForegroundBase::getMFColorCurrent ( void   )  [inline, protected, inherited]

Definition at line 136 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfColorCurrent.

00137 {
00138     return &_mfColorCurrent;
00139 }

MFReal32 * osg::GraphicStatisticsForegroundBase::getMFMinValue ( void   )  [inline, protected, inherited]

Definition at line 143 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfMinValue.

00144 {
00145     return &_mfMinValue;
00146 }

MFReal32 * osg::GraphicStatisticsForegroundBase::getMFMaxValue ( void   )  [inline, protected, inherited]

Definition at line 150 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfMaxValue.

00151 {
00152     return &_mfMaxValue;
00153 }

MFUInt32 * osg::GraphicStatisticsForegroundBase::getMFFlags ( void   )  [inline, protected, inherited]

Definition at line 157 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfFlags.

00158 {
00159     return &_mfFlags;
00160 }

MFUInt32 * osg::GraphicStatisticsForegroundBase::getMFHistorySize ( void   )  [inline, protected, inherited]

Definition at line 164 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfHistorySize.

00165 {
00166     return &_mfHistorySize;
00167 }

UInt32 & osg::GraphicStatisticsForegroundBase::getDisplayType ( UInt32  index  )  [inline, protected, inherited]

Definition at line 320 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfDisplayType.

00321 {
00322     return _mfDisplayType[index];
00323 }

MFUInt32 & osg::GraphicStatisticsForegroundBase::getDisplayType ( void   )  [inline, protected, inherited]

Definition at line 327 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfDisplayType.

Referenced by addElement(), draw(), and removeElement().

00328 {
00329     return _mfDisplayType;
00330 }

const MFUInt32 & osg::GraphicStatisticsForegroundBase::getDisplayType ( void   )  const [inline, protected, inherited]

Definition at line 334 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfDisplayType.

00335 {
00336     return _mfDisplayType;
00337 }

Vec2f & osg::GraphicStatisticsForegroundBase::getSize ( UInt32  index  )  [inline, protected, inherited]

Definition at line 341 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfSize.

00342 {
00343     return _mfSize[index];
00344 }

MFVec2f & osg::GraphicStatisticsForegroundBase::getSize ( void   )  [inline, protected, inherited]

Definition at line 348 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfSize.

Referenced by addElement(), calcPosAndSize(), and removeElement().

00349 {
00350     return _mfSize;
00351 }

const MFVec2f & osg::GraphicStatisticsForegroundBase::getSize ( void   )  const [inline, protected, inherited]

Definition at line 355 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfSize.

00356 {
00357     return _mfSize;
00358 }

Vec2f & osg::GraphicStatisticsForegroundBase::getPos ( UInt32  index  )  [inline, protected, inherited]

Definition at line 362 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfPos.

00363 {
00364     return _mfPos[index];
00365 }

MFVec2f & osg::GraphicStatisticsForegroundBase::getPos ( void   )  [inline, protected, inherited]

Definition at line 369 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfPos.

Referenced by addElement(), calcPosAndSize(), and removeElement().

00370 {
00371     return _mfPos;
00372 }

const MFVec2f & osg::GraphicStatisticsForegroundBase::getPos ( void   )  const [inline, protected, inherited]

Definition at line 376 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfPos.

00377 {
00378     return _mfPos;
00379 }

Color4f & osg::GraphicStatisticsForegroundBase::getColorMax ( UInt32  index  )  [inline, protected, inherited]

Definition at line 383 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfColorMax.

00384 {
00385     return _mfColorMax[index];
00386 }

MFColor4f & osg::GraphicStatisticsForegroundBase::getColorMax ( void   )  [inline, protected, inherited]

Definition at line 390 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfColorMax.

Referenced by addElement(), drawAnalog(), drawBar(), and removeElement().

00391 {
00392     return _mfColorMax;
00393 }

const MFColor4f & osg::GraphicStatisticsForegroundBase::getColorMax ( void   )  const [inline, protected, inherited]

Definition at line 397 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfColorMax.

00398 {
00399     return _mfColorMax;
00400 }

Color4f & osg::GraphicStatisticsForegroundBase::getColorMin ( UInt32  index  )  [inline, protected, inherited]

Definition at line 404 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfColorMin.

00405 {
00406     return _mfColorMin[index];
00407 }

MFColor4f & osg::GraphicStatisticsForegroundBase::getColorMin ( void   )  [inline, protected, inherited]

Definition at line 411 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfColorMin.

Referenced by addElement(), drawAnalog(), drawBar(), and removeElement().

00412 {
00413     return _mfColorMin;
00414 }

const MFColor4f & osg::GraphicStatisticsForegroundBase::getColorMin ( void   )  const [inline, protected, inherited]

Definition at line 418 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfColorMin.

00419 {
00420     return _mfColorMin;
00421 }

Color4f & osg::GraphicStatisticsForegroundBase::getColorCurrent ( UInt32  index  )  [inline, protected, inherited]

Definition at line 425 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfColorCurrent.

00426 {
00427     return _mfColorCurrent[index];
00428 }

MFColor4f & osg::GraphicStatisticsForegroundBase::getColorCurrent ( void   )  [inline, protected, inherited]

const MFColor4f & osg::GraphicStatisticsForegroundBase::getColorCurrent ( void   )  const [inline, protected, inherited]

Definition at line 439 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfColorCurrent.

00440 {
00441     return _mfColorCurrent;
00442 }

Real32 & osg::GraphicStatisticsForegroundBase::getMinValue ( UInt32  index  )  [inline, protected, inherited]

Definition at line 446 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfMinValue.

00447 {
00448     return _mfMinValue[index];
00449 }

MFReal32 & osg::GraphicStatisticsForegroundBase::getMinValue ( void   )  [inline, protected, inherited]

const MFReal32 & osg::GraphicStatisticsForegroundBase::getMinValue ( void   )  const [inline, protected, inherited]

Definition at line 460 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfMinValue.

00461 {
00462     return _mfMinValue;
00463 }

Real32 & osg::GraphicStatisticsForegroundBase::getMaxValue ( UInt32  index  )  [inline, protected, inherited]

Definition at line 467 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfMaxValue.

00468 {
00469     return _mfMaxValue[index];
00470 }

MFReal32 & osg::GraphicStatisticsForegroundBase::getMaxValue ( void   )  [inline, protected, inherited]

const MFReal32 & osg::GraphicStatisticsForegroundBase::getMaxValue ( void   )  const [inline, protected, inherited]

Definition at line 481 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfMaxValue.

00482 {
00483     return _mfMaxValue;
00484 }

UInt32 & osg::GraphicStatisticsForegroundBase::getFlags ( UInt32  index  )  [inline, protected, inherited]

Definition at line 488 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfFlags.

00489 {
00490     return _mfFlags[index];
00491 }

MFUInt32 & osg::GraphicStatisticsForegroundBase::getFlags ( void   )  [inline, protected, inherited]

const MFUInt32 & osg::GraphicStatisticsForegroundBase::getFlags ( void   )  const [inline, protected, inherited]

Definition at line 502 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfFlags.

00503 {
00504     return _mfFlags;
00505 }

UInt32 & osg::GraphicStatisticsForegroundBase::getHistorySize ( UInt32  index  )  [inline, protected, inherited]

Definition at line 509 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfHistorySize.

00510 {
00511     return _mfHistorySize[index];
00512 }

MFUInt32 & osg::GraphicStatisticsForegroundBase::getHistorySize ( void   )  [inline, protected, inherited]

Definition at line 516 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfHistorySize.

Referenced by addElement(), changed(), and removeElement().

00517 {
00518     return _mfHistorySize;
00519 }

const MFUInt32 & osg::GraphicStatisticsForegroundBase::getHistorySize ( void   )  const [inline, protected, inherited]

Definition at line 523 of file OSGGraphicStatisticsForegroundBase.inl.

References osg::GraphicStatisticsForegroundBase::_mfHistorySize.

00524 {
00525     return _mfHistorySize;
00526 }

void GraphicStatisticsForegroundBase::executeSyncImpl ( GraphicStatisticsForegroundBase pOther,
const BitVector whichField 
) [protected, inherited]

Definition at line 659 of file OSGGraphicStatisticsForegroundBase.cpp.

References osg::GraphicStatisticsForegroundBase::_mfColorCurrent, osg::GraphicStatisticsForegroundBase::_mfColorMax, osg::GraphicStatisticsForegroundBase::_mfColorMin, osg::GraphicStatisticsForegroundBase::_mfDescription, osg::GraphicStatisticsForegroundBase::_mfDisplayType, osg::GraphicStatisticsForegroundBase::_mfFlags, osg::GraphicStatisticsForegroundBase::_mfHistorySize, osg::GraphicStatisticsForegroundBase::_mfMaxValue, osg::GraphicStatisticsForegroundBase::_mfMinValue, osg::GraphicStatisticsForegroundBase::_mfPos, osg::GraphicStatisticsForegroundBase::_mfSize, osg::GraphicStatisticsForegroundBase::_sfBackgroundColor, osg::GraphicStatisticsForegroundBase::_sfBackgroundEnabled, osg::GraphicStatisticsForegroundBase::_sfBorderEnabled, osg::GraphicStatisticsForegroundBase::_sfLineWidth, osg::GraphicStatisticsForegroundBase::_sfTextEnabled, osg::GraphicStatisticsForegroundBase::BackgroundColorFieldMask, osg::GraphicStatisticsForegroundBase::BackgroundEnabledFieldMask, osg::GraphicStatisticsForegroundBase::BorderEnabledFieldMask, osg::GraphicStatisticsForegroundBase::ColorCurrentFieldMask, osg::GraphicStatisticsForegroundBase::ColorMaxFieldMask, osg::GraphicStatisticsForegroundBase::ColorMinFieldMask, osg::GraphicStatisticsForegroundBase::DescriptionFieldMask, osg::GraphicStatisticsForegroundBase::DisplayTypeFieldMask, osg::StatisticsForegroundBase::executeSyncImpl(), osg::GraphicStatisticsForegroundBase::FlagsFieldMask, osg::GraphicStatisticsForegroundBase::HistorySizeFieldMask, osg::GraphicStatisticsForegroundBase::LineWidthFieldMask, osg::GraphicStatisticsForegroundBase::MaxValueFieldMask, osg::GraphicStatisticsForegroundBase::MinValueFieldMask, osg::FieldBits::NoField, osg::GraphicStatisticsForegroundBase::PosFieldMask, osg::GraphicStatisticsForegroundBase::SizeFieldMask, osg::SField< FieldTypeT, fieldNameSpace >::syncWith(), osg::MField< FieldTypeT, fieldNameSpace >::syncWith(), and osg::GraphicStatisticsForegroundBase::TextEnabledFieldMask.

Referenced by osg::GraphicStatisticsForegroundBase::executeSync().

00661 {
00662 
00663     Inherited::executeSyncImpl(pOther, whichField);
00664 
00665     if(FieldBits::NoField != (DisplayTypeFieldMask & whichField))
00666         _mfDisplayType.syncWith(pOther->_mfDisplayType);
00667 
00668     if(FieldBits::NoField != (SizeFieldMask & whichField))
00669         _mfSize.syncWith(pOther->_mfSize);
00670 
00671     if(FieldBits::NoField != (PosFieldMask & whichField))
00672         _mfPos.syncWith(pOther->_mfPos);
00673 
00674     if(FieldBits::NoField != (ColorMaxFieldMask & whichField))
00675         _mfColorMax.syncWith(pOther->_mfColorMax);
00676 
00677     if(FieldBits::NoField != (ColorMinFieldMask & whichField))
00678         _mfColorMin.syncWith(pOther->_mfColorMin);
00679 
00680     if(FieldBits::NoField != (ColorCurrentFieldMask & whichField))
00681         _mfColorCurrent.syncWith(pOther->_mfColorCurrent);
00682 
00683     if(FieldBits::NoField != (MinValueFieldMask & whichField))
00684         _mfMinValue.syncWith(pOther->_mfMinValue);
00685 
00686     if(FieldBits::NoField != (MaxValueFieldMask & whichField))
00687         _mfMaxValue.syncWith(pOther->_mfMaxValue);
00688 
00689     if(FieldBits::NoField != (FlagsFieldMask & whichField))
00690         _mfFlags.syncWith(pOther->_mfFlags);
00691 
00692     if(FieldBits::NoField != (HistorySizeFieldMask & whichField))
00693         _mfHistorySize.syncWith(pOther->_mfHistorySize);
00694 
00695     if(FieldBits::NoField != (DescriptionFieldMask & whichField))
00696         _mfDescription.syncWith(pOther->_mfDescription);
00697 
00698     if(FieldBits::NoField != (LineWidthFieldMask & whichField))
00699         _sfLineWidth.syncWith(pOther->_sfLineWidth);
00700 
00701     if(FieldBits::NoField != (BackgroundColorFieldMask & whichField))
00702         _sfBackgroundColor.syncWith(pOther->_sfBackgroundColor);
00703 
00704     if(FieldBits::NoField != (TextEnabledFieldMask & whichField))
00705         _sfTextEnabled.syncWith(pOther->_sfTextEnabled);
00706 
00707     if(FieldBits::NoField != (BackgroundEnabledFieldMask & whichField))
00708         _sfBackgroundEnabled.syncWith(pOther->_sfBackgroundEnabled);
00709 
00710     if(FieldBits::NoField != (BorderEnabledFieldMask & whichField))
00711         _sfBorderEnabled.syncWith(pOther->_sfBorderEnabled);
00712 
00713 
00714 }

void StatisticsForegroundBase::executeSyncImpl ( StatisticsForegroundBase pOther,
const BitVector whichField 
) [protected, inherited]

void ForegroundBase::executeSyncImpl ( ForegroundBase pOther,
const BitVector whichField 
) [protected, inherited]

void AttachmentContainer::executeSyncImpl ( AttachmentContainer pOther,
const BitVector whichField 
) [protected, inherited]

void osg::FieldContainer::executeSyncImpl ( FieldContainer pOther,
const BitVector whichField 
) [inline, protected, inherited]

void GraphicStatisticsForegroundBase::executeSync ( FieldContainer other,
const BitVector whichField 
) [protected, virtual, inherited]

Reimplemented from osg::StatisticsForegroundBase.

Definition at line 298 of file OSGGraphicStatisticsForegroundBase.cpp.

References osg::GraphicStatisticsForegroundBase::executeSyncImpl().

00300 {
00301     this->executeSyncImpl((GraphicStatisticsForegroundBase *) &other, whichField);
00302 }

MFInt32 * osg::StatisticsForegroundBase::getMFElementIDs ( void   )  [inline, inherited]

Definition at line 75 of file OSGStatisticsForegroundBase.inl.

References osg::StatisticsForegroundBase::_mfElementIDs.

00076 {
00077     return &_mfElementIDs;
00078 }

SFStatCollector * osg::StatisticsForegroundBase::getSFCollector ( void   )  [inline, inherited]

Definition at line 82 of file OSGStatisticsForegroundBase.inl.

References osg::StatisticsForegroundBase::_sfCollector.

00083 {
00084     return &_sfCollector;
00085 }

StatCollector & osg::StatisticsForegroundBase::getCollector ( void   )  [inline, inherited]

const StatCollector & osg::StatisticsForegroundBase::getCollector ( void   )  const [inline, inherited]

Int32 & osg::StatisticsForegroundBase::getElementIDs ( const UInt32  index  )  [inline, inherited]

Definition at line 112 of file OSGStatisticsForegroundBase.inl.

References osg::StatisticsForegroundBase::_mfElementIDs.

00113 {
00114     return _mfElementIDs[index];
00115 }

MFInt32 & osg::StatisticsForegroundBase::getElementIDs ( void   )  [inline, inherited]

const MFInt32 & osg::StatisticsForegroundBase::getElementIDs ( void   )  const [inline, inherited]

Definition at line 126 of file OSGStatisticsForegroundBase.inl.

References osg::StatisticsForegroundBase::_mfElementIDs.

00127 {
00128     return _mfElementIDs;
00129 }

void osg::StatisticsForegroundBase::setCollector ( const StatCollector value  )  [inline, inherited]

static const char* osg::Foreground::getClassname ( void   )  [inline, static, inherited]

Reimplemented in osg::ImageForeground.

Definition at line 74 of file OSGForeground.h.

00074 { return "Foreground"; };

SFBool * osg::ForegroundBase::getSFActive ( void   )  [inline, inherited]

Definition at line 75 of file OSGForegroundBase.inl.

References osg::ForegroundBase::_sfActive.

00076 {
00077     return &_sfActive;
00078 }

bool & osg::ForegroundBase::getActive ( void   )  [inline, inherited]

const bool & osg::ForegroundBase::getActive ( void   )  const [inline, inherited]

Definition at line 90 of file OSGForegroundBase.inl.

References osg::ForegroundBase::_sfActive, and osg::SField< FieldTypeT, fieldNameSpace >::getValue().

00091 {
00092     return _sfActive.getValue();
00093 }

void osg::ForegroundBase::setActive ( const bool &  value  )  [inline, inherited]

void AttachmentContainer::addAttachment ( const AttachmentPtr fieldContainerP,
UInt16  binding = 0 
) [inherited]

Definition at line 84 of file OSGAttachmentContainer.cpp.

References osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), osg::NullFC, and osg::subRefCP().

Referenced by osg::AttachmentContainer::AttachmentContainer(), osg::Node::onCreate(), and osg::Image::setAttachmentField().

00086 {
00087     UInt32 key;
00088 
00089     if(fieldContainerP == NullFC)
00090         return;
00091 
00092     key = (UInt32 (fieldContainerP->getGroupId()) << 16) | binding;
00093 
00094     addRefCP(fieldContainerP);
00095 
00096     beginEditCP(fieldContainerP, Attachment::ParentsFieldMask);
00097     {
00098         fieldContainerP->addParent(getPtr());
00099     }
00100     endEditCP  (fieldContainerP, Attachment::ParentsFieldMask);
00101 
00102     AttachmentMap::iterator fcI = _attachmentMap.getValue().find(key);
00103 
00104     if(fcI != _attachmentMap.getValue().end())
00105     {
00106         beginEditCP((*fcI).second, Attachment::ParentsFieldMask);
00107         {
00108             (*fcI).second->subParent(getPtr());
00109         }
00110         endEditCP  ((*fcI).second, Attachment::ParentsFieldMask);
00111 
00112         subRefCP((*fcI).second);
00113 
00114         (*fcI).second = fieldContainerP;
00115     }
00116     else
00117     {
00118         _attachmentMap.getValue()[key] = fieldContainerP;
00119     }
00120 }

void AttachmentContainer::subAttachment ( const AttachmentPtr fieldContainerP,
UInt16  binding = 0 
) [inherited]

Definition at line 122 of file OSGAttachmentContainer.cpp.

References osg::AttachmentContainer::_attachmentMap, osg::beginEditCP(), osg::endEditCP(), osg::AttachmentContainer::getPtr(), osg::SField< FieldTypeT, fieldNameSpace >::getValue(), osg::NullFC, osg::Attachment::ParentsFieldMask, and osg::subRefCP().

00124 {
00125     UInt32 key;
00126 
00127     AttachmentMap::iterator fcI;
00128 
00129     if(fieldContainerP == NullFC)
00130         return;
00131 
00132     key = (UInt32(fieldContainerP->getGroupId()) << 16) | binding;
00133 
00134     fcI = _attachmentMap.getValue().find(key);
00135 
00136     if(fcI != _attachmentMap.getValue().end())
00137     {
00138         beginEditCP(fieldContainerP, Attachment::ParentsFieldMask);
00139         {
00140             (*fcI).second->subParent(getPtr());
00141         }
00142         endEditCP  (fieldContainerP, Attachment::ParentsFieldMask);
00143 
00144         subRefCP((*fcI).second);
00145 
00146         _attachmentMap.getValue().erase(fcI);
00147     }
00148 }

AttachmentPtr AttachmentContainer::findAttachment ( UInt32  groupId,
UInt16  binding = 0 
) [inherited]

Definition at line 150 of file OSGAttachmentContainer.cpp.

References osg::AttachmentContainer::_attachmentMap, osg::SField< FieldTypeT, fieldNameSpace >::getValue(), and osg::NullFC.

Referenced by osg::Image::findAttachmentField(), and osg::Image::setAttachmentField().

00152 {
00153     UInt32 key = (UInt32(groupId) << 16) | binding;
00154 
00155     AttachmentMap::iterator fcI = _attachmentMap.getValue().find(key);
00156 
00157     if(fcI == _attachmentMap.getValue().end())
00158     {
00159         return NullFC;
00160     }
00161     else
00162     {
00163         return (*fcI).second;
00164     }
00165 }

AttachmentPtr osg::AttachmentContainer::findAttachment ( const FieldContainerType type,
UInt16  binding = 0 
) [inline, inherited]

Definition at line 57 of file OSGAttachmentContainerImpl.inl.

00060 {
00061     return findAttachment(type.getGroupId(), binding);
00062 }

SFAttachmentMap * AttachmentContainer::getSFAttachments ( void   )  [inherited]

Field Access

Definition at line 170 of file OSGAttachmentContainer.cpp.

References osg::AttachmentContainer::_attachmentMap.

00171 {
00172     return &_attachmentMap;
00173 }

AttachmentContainerPtr AttachmentContainer::getPtr ( void   )  [protected, inherited]

UInt16 osg::FieldContainer::getClassGroupId ( void   )  [inline, static, inherited]

Definition at line 71 of file OSGFieldContainerImpl.inl.

References osg::FieldContainer::_type, and osg::FieldContainerType::getGroupId().

00072 {
00073     return _type.getGroupId();
00074 }

UInt32 osg::FieldContainer::getTypeId ( void   )  const [inline, inherited]

Definition at line 77 of file OSGFieldContainerImpl.inl.

References osg::TypeBase::getId(), and osg::FieldContainer::getType().

Referenced by osg::TextureChunk::changeFrom(), and osg::CubeTextureChunk::changeFrom().

00078 {
00079     return getType().getId();
00080 }

UInt16 osg::FieldContainer::getGroupId ( void   )  const [inline, inherited]

const Char8 * osg::FieldContainer::getTypeName ( void   )  const [inline, inherited]

Definition at line 89 of file OSGFieldContainerImpl.inl.

References osg::TypeBase::getCName(), and osg::FieldContainer::getType().

00090 {
00091     return getType().getCName();
00092 }

Field * osg::FieldContainer::getField ( UInt32  fieldId  )  [inline, inherited]

Generic Field Access

Definition at line 95 of file OSGFieldContainerImpl.inl.

References osg::FieldDescription::getField(), osg::FieldContainerType::getFieldDescription(), and osg::FieldContainer::getType().

Referenced by osg::QFCItem::expand(), osg::VRMLShapeDesc::getFieldAndDesc(), osg::QFieldViewBase::getFieldPtr(), osg::QFieldEditorBase::getFieldPtr(), osg::getParentsField(), and osg::QFCItem::setup().

00096 {
00097     const FieldDescription *desc = getType().getFieldDescription(fieldId);
00098 
00099     return desc ? desc->getField(*this) : NULL;
00100 }

Field * osg::FieldContainer::getField ( const Char8 fieldName  )  [inline, inherited]

Generic Field Access

Definition at line 103 of file OSGFieldContainerImpl.inl.

References osg::FieldContainerType::findFieldDescription(), osg::FieldDescription::getField(), and osg::FieldContainer::getType().

00104 {
00105     const FieldDescription *desc =getType().findFieldDescription(fieldName);
00106 
00107     return desc ? desc->getField(*this) : NULL;
00108 }

template<class ObjectPtrT>
void osg::FieldContainer::newPtr ( ObjectPtrT &  result,
const typename ObjectPtrT::StoredObjectType *  prototypeP 
) [inline, static, protected, inherited]

Definition at line 138 of file OSGFieldContainerImpl.inl.

References osg::ChangeList::addCreated(), osg::PThreadBase::getAspect(), osg::PThreadBase::getCurrentChangeList(), osg::ThreadManager::getNumAspects(), osg::FieldContainerFactory::registerFieldContainer(), and osg::FieldContainerFactory::the().

Referenced by osg::XWindowBase::createEmpty(), osg::WIN32WindowBase::createEmpty(), osg::ViewportBase::createEmpty(), osg::VertexProgramChunkBase::createEmpty(), osg::TwoSidedLightingChunkBase::createEmpty(), osg::TransformChunkBase::createEmpty(), osg::TransformBase::createEmpty(), osg::TileCameraDecoratorBase::createEmpty(), osg::TextureTransformChunkBase::createEmpty(), osg::TextureGrabForegroundBase::createEmpty(), osg::TextureGrabBackgroundBase::createEmpty(), osg::TextureChunkBase::createEmpty(), osg::TextureBackgroundBase::createEmpty(), osg::TexGenChunkBase::createEmpty(), osg::SwitchMaterialBase::createEmpty(), osg::SwitchBase::createEmpty(), osg::SurfaceBase::createEmpty(), osg::StringAttributeMapBase::createEmpty(), osg::StereoBufferViewportBase::createEmpty(), osg::StencilChunkBase::createEmpty(), osg::StateSortingGroupBase::createEmpty(), osg::StateBase::createEmpty(), osg::SpotLightBase::createEmpty(), osg::SortFirstWindowBase::createEmpty(), osg::SolidBackgroundBase::createEmpty(), osg::SlicesBase::createEmpty(), osg::SkyBackgroundBase::createEmpty(), osg::SimpleTexturedMaterialBase::createEmpty(), osg::SimpleStatisticsForegroundBase::createEmpty(), osg::SimpleMaterialBase::createEmpty(), osg::SHLParameterChunkBase::createEmpty(), osg::SHLChunkBase::createEmpty(), osg::ShearedStereoCameraDecoratorBase::createEmpty(), osg::ShaderParameterVec4fBase::createEmpty(), osg::ShaderParameterVec3fBase::createEmpty(), osg::ShaderParameterVec2fBase::createEmpty(), osg::ShaderParameterStringBase::createEmpty(), osg::ShaderParameterRealBase::createEmpty(), osg::ShaderParameterMVec4fBase::createEmpty(), osg::ShaderParameterMVec3fBase::createEmpty(), osg::ShaderParameterMVec2fBase::createEmpty(), osg::ShaderParameterMRealBase::createEmpty(), osg::ShaderParameterMMatrixBase::createEmpty(), osg::ShaderParameterMIntBase::createEmpty(), osg::ShaderParameterMatrixBase::createEmpty(), osg::ShaderParameterIntBase::createEmpty(), osg::ShaderParameterBoolBase::createEmpty(), osg::ScreenGroupBase::createEmpty(), osg::SClipPlaneChunkBase::createEmpty(), osg::ResolutionDisplayFilterBase::createEmpty(), osg::RenderOptionsBase::createEmpty(), osg::RegisterCombinersChunkBase::createEmpty(), osg::QTWindowBase::createEmpty(), osg::ProxyGroupBase::createEmpty(), osg::ProjectionCameraDecoratorBase::createEmpty(), osg::PolygonForegroundBase::createEmpty(), osg::PolygonChunkBase::createEmpty(), osg::PolygonBackgroundBase::createEmpty(), osg::PointLightBase::createEmpty(), osg::PointChunkBase::createEmpty(), osg::PhongMaterialBase::createEmpty(), osg::PerspectiveCameraBase::createEmpty(), osg::PassiveWindowBase::createEmpty(), osg::PassiveViewportBase::createEmpty(), osg::PassiveBackgroundBase::createEmpty(), osg::ParticlesBase::createEmpty(), osg::OrthographicCameraBase::createEmpty(), osg::OffCenterPerspectiveCameraBase::createEmpty(), osg::MultiPassMaterialBase::createEmpty(), osg::MultiDisplayWindowBase::createEmpty(), osg::MatrixCameraDecoratorBase::createEmpty(), osg::MatrixCameraBase::createEmpty(), osg::MaterialPoolBase::createEmpty(), osg::MaterialGroupBase::createEmpty(), osg::MaterialChunkBase::createEmpty(), osg::LogicOpChunkBase::createEmpty(), osg::LineChunkBase::createEmpty(), osg::LightModelChunkBase::createEmpty(), osg::LightEnvBase::createEmpty(), osg::LightChunkBase::createEmpty(), osg::InverseTransformBase::createEmpty(), osg::InlineBase::createEmpty(), osg::ImageForegroundBase::createEmpty(), osg::ImageBase::createEmpty(), osg::ImageBackgroundBase::createEmpty(), osg::GroupBase::createEmpty(), osg::GraphicStatisticsForegroundBase::createEmpty(), osg::GradientBackgroundBase::createEmpty(), osg::GrabForegroundBase::createEmpty(), osg::GLUTWindowBase::createEmpty(), osg::GeometryBase::createEmpty(), osg::FresnelMaterialBase::createEmpty(), osg::FragmentProgramChunkBase::createEmpty(), osg::FileGrabForegroundBase::createEmpty(), osg::FCPtrAttributeMapBase::createEmpty(), osg::FBOViewportBase::createEmpty(), osg::FatBorderChunkBase::createEmpty(), osg::DVRVolumeTextureBase::createEmpty(), osg::DVRVolumeBase::createEmpty(), osg::DVRSimpleShaderBase::createEmpty(), osg::DVRSimpleLUTShaderBase::createEmpty(), osg::DVRMtexLUTShaderBase::createEmpty(), osg::DVRLookupTableBase::createEmpty(), osg::DVRIsoSurfaceBase::createEmpty(), osg::DVRIsoShaderBase::createEmpty(), osg::DVRGeometryBase::createEmpty(), osg::DVRClipObjectsBase::createEmpty(), osg::DVRClipGeometryBase::createEmpty(), osg::DVRAppearanceBase::createEmpty(), osg::DistortionDisplayFilterBase::createEmpty(), osg::DistanceLODBase::createEmpty(), osg::DisplayFilterForegroundBase::createEmpty(), osg::DisplayCalibrationBase::createEmpty(), osg::DirectionalLightBase::createEmpty(), osg::DepthClearBackgroundBase::createEmpty(), osg::DepthChunkBase::createEmpty(), osg::CubeTextureChunkBase::createEmpty(), osg::ComponentTransformBase::createEmpty(), osg::ColorMaskChunkBase::createEmpty(), osg::ColorDisplayFilterBase::createEmpty(), osg::ColorBufferViewportBase::createEmpty(), osg::ClusterWindowBase::createEmpty(), osg::ClipPlaneChunkBase::createEmpty(), osg::ClipPlaneBase::createEmpty(), osg::ChunkMaterialBase::createEmpty(), osg::BlendChunkBase::createEmpty(), osg::BillboardBase::createEmpty(), osg::XWindowBase::shallowCopy(), osg::WIN32WindowBase::shallowCopy(), osg::ViewportBase::shallowCopy(), osg::VertexProgramChunkBase::shallowCopy(), osg::TwoSidedLightingChunkBase::shallowCopy(), osg::TransformChunkBase::shallowCopy(), osg::TransformBase::shallowCopy(), osg::TileCameraDecoratorBase::shallowCopy(), osg::TextureTransformChunkBase::shallowCopy(), osg::TextureGrabForegroundBase::shallowCopy(), osg::TextureGrabBackgroundBase::shallowCopy(), osg::TextureChunkBase::shallowCopy(), osg::TextureBackgroundBase::shallowCopy(), osg::TexGenChunkBase::shallowCopy(), osg::SwitchMaterialBase::shallowCopy(), osg::SwitchBase::shallowCopy(), osg::SurfaceBase::shallowCopy(), osg::StringAttributeMapBase::shallowCopy(), osg::StereoBufferViewportBase::shallowCopy(), osg::StencilChunkBase::shallowCopy(), osg::StateSortingGroupBase::shallowCopy(), osg::StateBase::shallowCopy(), osg::SpotLightBase::shallowCopy(), osg::SortFirstWindowBase::shallowCopy(), osg::SolidBackgroundBase::shallowCopy(), osg::SlicesBase::shallowCopy(), osg::SkyBackgroundBase::shallowCopy(), osg::SimpleTexturedMaterialBase::shallowCopy(), osg::SimpleStatisticsForegroundBase::shallowCopy(), osg::SimpleMaterialBase::shallowCopy(), osg::SHLParameterChunkBase::shallowCopy(), osg::SHLChunkBase::shallowCopy(), osg::ShearedStereoCameraDecoratorBase::shallowCopy(), osg::ShaderParameterVec4fBase::shallowCopy(), osg::ShaderParameterVec3fBase::shallowCopy(), osg::ShaderParameterVec2fBase::shallowCopy(), osg::ShaderParameterStringBase::shallowCopy(), osg::ShaderParameterRealBase::shallowCopy(), osg::ShaderParameterMVec4fBase::shallowCopy(), osg::ShaderParameterMVec3fBase::shallowCopy(), osg::ShaderParameterMVec2fBase::shallowCopy(), osg::ShaderParameterMRealBase::shallowCopy(), osg::ShaderParameterMMatrixBase::shallowCopy(), osg::ShaderParameterMIntBase::shallowCopy(), osg::ShaderParameterMatrixBase::shallowCopy(), osg::ShaderParameterIntBase::shallowCopy(), osg::ShaderParameterBoolBase::shallowCopy(), osg::ScreenGroupBase::shallowCopy(), osg::SClipPlaneChunkBase::shallowCopy(), osg::ResolutionDisplayFilterBase::shallowCopy(), osg::RenderOptionsBase::shallowCopy(), osg::RegisterCombinersChunkBase::shallowCopy(), osg::QTWindowBase::shallowCopy(), osg::ProxyGroupBase::shallowCopy(), osg::ProjectionCameraDecoratorBase::shallowCopy(), osg::PolygonForegroundBase::shallowCopy(), osg::PolygonChunkBase::shallowCopy(), osg::PolygonBackgroundBase::shallowCopy(), osg::PointLightBase::shallowCopy(), osg::PointChunkBase::shallowCopy(), osg::PhongMaterialBase::shallowCopy(), osg::PerspectiveCameraBase::shallowCopy(), osg::PassiveWindowBase::shallowCopy(), osg::PassiveViewportBase::shallowCopy(), osg::PassiveBackgroundBase::shallowCopy(), osg::ParticlesBase::shallowCopy(), osg::OrthographicCameraBase::shallowCopy(), osg::OffCenterPerspectiveCameraBase::shallowCopy(), osg::MultiPassMaterialBase::shallowCopy(), osg::MultiDisplayWindowBase::shallowCopy(), osg::MatrixCameraDecoratorBase::shallowCopy(), osg::MatrixCameraBase::shallowCopy(), osg::MaterialPoolBase::shallowCopy(), osg::MaterialGroupBase::shallowCopy(), osg::MaterialChunkBase::shallowCopy(), osg::LogicOpChunkBase::shallowCopy(), osg::LineChunkBase::shallowCopy(), osg::LightModelChunkBase::shallowCopy(), osg::LightEnvBase::shallowCopy(), osg::LightChunkBase::shallowCopy(), osg::InverseTransformBase::shallowCopy(), osg::InlineBase::shallowCopy(), osg::ImageForegroundBase::shallowCopy(), osg::ImageBase::shallowCopy(), osg::ImageBackgroundBase::shallowCopy(), osg::GroupBase::shallowCopy(), osg::GraphicStatisticsForegroundBase::shallowCopy(), osg::GradientBackgroundBase::shallowCopy(), osg::GrabForegroundBase::shallowCopy(), osg::GLUTWindowBase::shallowCopy(), osg::GeometryBase::shallowCopy(), osg::FresnelMaterialBase::shallowCopy(), osg::FragmentProgramChunkBase::shallowCopy(), osg::FileGrabForegroundBase::shallowCopy(), osg::FCPtrAttributeMapBase::shallowCopy(), osg::FBOViewportBase::shallowCopy(), osg::FatBorderChunkBase::shallowCopy(), osg::DVRVolumeTextureBase::shallowCopy(), osg::DVRVolumeBase::shallowCopy(), osg::DVRSimpleShaderBase::shallowCopy(), osg::DVRSimpleLUTShaderBase::shallowCopy(), osg::DVRMtexLUTShaderBase::shallowCopy(), osg::DVRLookupTableBase::shallowCopy(), osg::DVRIsoSurfaceBase::shallowCopy(), osg::DVRIsoShaderBase::shallowCopy(), osg::DVRGeometryBase::shallowCopy(), osg::DVRClipObjectsBase::shallowCopy(), osg::DVRClipGeometryBase::shallowCopy(), osg::DVRAppearanceBase::shallowCopy(), osg::DistortionDisplayFilterBase::shallowCopy(), osg::DistanceLODBase::shallowCopy(), osg::DisplayFilterForegroundBase::shallowCopy(), osg::DisplayCalibrationBase::shallowCopy(), osg::DirectionalLightBase::shallowCopy(), osg::DepthClearBackgroundBase::shallowCopy(), osg::DepthChunkBase::shallowCopy(), osg::CubeTextureChunkBase::shallowCopy(), osg::ComponentTransformBase::shallowCopy(), osg::ColorMaskChunkBase::shallowCopy(), osg::ColorDisplayFilterBase::shallowCopy(), osg::ColorBufferViewportBase::shallowCopy(), osg::ClusterWindowBase::shallowCopy(), osg::ClipPlaneChunkBase::shallowCopy(), osg::ClipPlaneBase::shallowCopy(), osg::ChunkMaterialBase::shallowCopy(), osg::BlendChunkBase::shallowCopy(), and osg::BillboardBase::shallowCopy().

00141 {
00142     typedef typename ObjectPtrT::StoredObjectType ObjectType;
00143     
00144     UInt8 *pTmp;
00145     
00146     result._containerSize = sizeof(ObjectType);
00147     
00148     pTmp        = 
00149         static_cast<UInt8 *>(operator new(
00150             sizeof(Int32)      + // ReferenceCount
00151             sizeof(UInt32)     + // ContainerId
00152             sizeof(ObjectType) * ThreadManager::getNumAspects()));
00153     
00154     *(reinterpret_cast<Int32 *>(pTmp)) = 0;
00155     
00156     pTmp += sizeof(Int32);
00157     
00158     result._storeP = (pTmp + sizeof(UInt32));
00159 
00160 #ifdef OSG_DEBUG_FCPTR
00161     result._typedStoreP = reinterpret_cast<FieldContainer *>(result._storeP);
00162 #endif
00163 
00164     *(reinterpret_cast<UInt32 *>(pTmp)) = 
00165         FieldContainerFactory::the()->registerFieldContainer(result);
00166     
00167     Thread::getCurrentChangeList()->addCreated(
00168         *(reinterpret_cast<UInt32 *>(pTmp)));
00169     
00170     pTmp += sizeof(UInt32);
00171     
00172     ObjectType *aObject = reinterpret_cast<ObjectType *>(pTmp);
00173 
00174     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00175     {
00176         pTmp = 
00177             reinterpret_cast<UInt8 *>(new (pTmp) ObjectType(*prototypeP));
00178         
00179         pTmp += sizeof(ObjectType);
00180     }
00181     
00182     result->onCreate(prototypeP);
00183 
00184     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00185     {
00186         aObject[i].onCreateAspect(aObject, prototypeP);
00187     }
00188 
00189 #if defined(OSG_GV_BETA) && defined(OSG_DBG_MEM)
00190 
00191     fprintf(stderr, "GV_MEM_FC_DBG : (%u) cc (%p|%u)\n", 
00192             Thread::getAspect(),
00193             result._storeP,
00194 //            ObjectType::getClassType().getCName(),
00195             ObjectType::getClassType().getId());
00196 #endif
00197 
00198 #ifdef OSG_DEBUG_TYPED_FCPTR
00199     result.updateTypedStore();
00200 #endif
00201 }

template<class ObjectPtrT>
void osg::FieldContainer::newPtr ( ObjectPtrT &  result  )  [inline, static, protected, inherited]

Definition at line 204 of file OSGFieldContainerImpl.inl.

References osg::ChangeList::addCreated(), osg::PThreadBase::getAspect(), osg::PThreadBase::getCurrentChangeList(), osg::ThreadManager::getNumAspects(), osg::FieldContainerFactory::registerFieldContainer(), and osg::FieldContainerFactory::the().

00205 {
00206     typedef typename ObjectPtrT::StoredObjectType ObjectType;
00207     
00208     UInt8 *pTmp;
00209     
00210     result._containerSize = sizeof(ObjectType);
00211     
00212     pTmp        =             
00213         static_cast<UInt8 *>(operator new(
00214             sizeof(Int32)      + // ReferenceCount
00215             sizeof(UInt32)     + // ContainerId
00216             sizeof(ObjectType) * ThreadManager::getNumAspects()));
00217     
00218     *(reinterpret_cast<Int32 *>(pTmp)) = 0;
00219     
00220     pTmp  += sizeof(Int32);
00221     
00222     result._storeP = (pTmp + sizeof(UInt32));
00223     
00224 #ifdef OSG_DEBUG_FCPTR
00225     result._typedStoreP = reinterpret_cast<FieldContainer *>(result._storeP);
00226 #endif
00227 
00228     *(reinterpret_cast<UInt32 *>(pTmp)) = 
00229         FieldContainerFactory::the()->registerFieldContainer(result);
00230     
00231     Thread::getCurrentChangeList()->addCreated(
00232         *(reinterpret_cast<UInt32 *>(pTmp)));
00233     
00234     pTmp += sizeof(UInt32);
00235     
00236     ObjectType *aObject = reinterpret_cast<ObjectType *>(pTmp);
00237 
00238     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00239     {
00240         pTmp = reinterpret_cast<UInt8 *>(new (pTmp) ObjectType());
00241         
00242         pTmp += sizeof(ObjectType);
00243     }
00244     
00245     result->onCreate();
00246     
00247     for(UInt32 i = 0; i < ThreadManager::getNumAspects(); i++)
00248     {
00249         aObject[i].onCreateAspect(aObject);
00250     }
00251 
00252 #if defined(OSG_GV_BETA) && defined(OSG_DBG_MEM)
00253     fprintf(stderr, "GV_MEM_FC_DBG : (%u) c (%p|%u)\n", 
00254             Thread::getAspect(),
00255             result._storeP,
00256 //            ObjectType::getClassType().getCName(),
00257             ObjectType::getClassType().getId());
00258 #endif
00259     
00260 #ifdef OSG_DEBUG_TYPED_FCPTR
00261     result.updateTypedStore();
00262 #endif
00263 }

template<class FieldTypeT>
void osg::FieldContainer::beginEditX ( const BitVector whichField,
FieldTypeT &  field 
) [inline, protected, inherited]

Definition at line 285 of file OSGFieldContainerImpl.inl.

00286 {
00287 //    fieldR.beginEdit();
00288 }

template<class FieldTypeT>
void osg::FieldContainer::endEditX ( const BitVector whichField,
FieldTypeT &  field 
) [inline, protected, inherited]

Definition at line 291 of file OSGFieldContainerImpl.inl.

References osg::endEditCP().

00292 {
00293     FieldContainerPtr tmpPtr(this);
00294     endEditCP(tmpPtr, whichField);
00295 }

void osg::FieldContainer::onCreate ( const FieldContainer source = NULL  )  [inline, protected, inherited]

Definition at line 318 of file OSGFieldContainerImpl.inl.

Referenced by osg::ShaderParameterChunk::onCreate().

00319 {
00320 }

void osg::FieldContainer::onCreateAspect ( const FieldContainer aspect0,
const FieldContainer source = NULL 
) [inline, protected, inherited]

Definition at line 323 of file OSGFieldContainerImpl.inl.

00325 {
00326 }

void FieldContainer::onDestroy ( void   )  [protected, virtual, inherited]


Friends And Related Function Documentation

friend class FieldContainer [friend]

Reimplemented from osg::GraphicStatisticsForegroundBase.

Definition at line 207 of file OSGGraphicStatisticsForeground.h.

friend class GraphicStatisticsForegroundBase [friend]

Definition at line 208 of file OSGGraphicStatisticsForeground.h.


Member Data Documentation

std::vector< std::vector< Real32> > osg::GraphicStatisticsForeground::_history [private]

Initial value:

 
    (Inherited::MTInfluenceMask) | 
    (static_cast<BitVector>(0x0) << Inherited::NextFieldId)

Reimplemented from osg::StatisticsForegroundBase.

Definition at line 146 of file OSGGraphicStatisticsForegroundBase.h.

std::string GraphicStatisticsForegroundBase::_mfDescription [protected, inherited]

bool ForegroundBase::_sfActive [protected, inherited]

const BitVector osg::FieldContainer::NextFieldMask [static, inherited]

Initial value:

 
                    (TypeTraits<BitVector>::One << NextFieldId)

Definition at line 75 of file OSGFieldContainerImpl.h.

const bool osg::FieldContainer::isNodeCore = false [static, inherited]

Reimplemented in osg::NodeCore.

Definition at line 181 of file OSGFieldContainerImpl.h.

UInt32 osg::FieldContainer::_shares [protected, inherited]

Definition at line 199 of file OSGFieldContainerImpl.h.


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

Generated on Mon Mar 17 12:14:49 2008 for OpenSG by  doxygen 1.5.5