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

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 }
typedef GraphicStatisticsForegroundPtr Ptr
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
}

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)
Field Access *SFAttachmentMapgetSFAttachments (void)
Get Instance Type Information
UInt32 getTypeId (void) const
UInt16 getGroupId (void) const
const Char8getTypeName (void) const
Generic Field Access *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

std::vector< std::vector<
Real32 > > 
_history
std::vector< UInt32_historyID

Static Private Attributes

static TextTXFFace_face = 0
static TextureChunkPtr _texchunk

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

typedef GraphicStatisticsForegroundBase osg::GraphicStatisticsForeground::Inherited [private]
 

Reimplemented from osg::GraphicStatisticsForegroundBase.

Definition at line 65 of file OSGGraphicStatisticsForeground.h.

typedef GraphicStatisticsForegroundPtr osg::GraphicStatisticsForegroundBase::Ptr [inherited]
 

Reimplemented from osg::StatisticsForegroundBase.

Definition at line 105 of file OSGGraphicStatisticsForegroundBase.h.


Member Enumeration Documentation

enum osg::GraphicStatisticsForeground::Type
 

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     };

enum osg::GraphicStatisticsForeground::Mode
 

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     };

enum osg::GraphicStatisticsForeground::TextHA
 

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     };

enum osg::GraphicStatisticsForeground::TextVA
 

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