VR-Exchange 2.7 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
DtProgressiveLineGraph Class Reference

Widget which draws a line graphic where the data is progressively added over time. More...

Inheritance diagram for DtProgressiveLineGraph:
Inheritance graph
[legend]

Classes

struct  Set
 

Public Member Functions

 DtProgressiveLineGraph (int rangeMin, int rangeMax, bool autoScale, QWidget *parent)
 CTOR for creating the graph. More...
 
virtual ~DtProgressiveLineGraph ()
 DTOR for graph. More...
 
void addSet (int set, QPen pen, int initial, bool valueCentered=false)
 Add a set with a color and initial value. More...
 
void insertValue (int set, double percent, int value)
 Insert a value into the middle of the graph. More...
 
virtual void resetAllValues (int value)
 Clear all sets and insert the initial value. More...
 
virtual void resetValues (int set, int value)
 Clear the values and insert the initial value. More...
 
virtual void clearValues (int set)
 Clear the values. More...
 
virtual void clearAllValues ()
 Clear all sets. More...
 
virtual void offsetPercentages (double percentOffset)
 Offset the percentages of all the values. More...
 
virtual void offsetPercentages (int set, double percentOffset)
 Offset the percentages of a set of values. More...
 
virtual void setRange (int min, int max)
 Sets the minimum and maximum range of the points. More...
 
virtual int rangeMinimum () const
 Get the Range minimum and maximum. More...
 
virtual int rangeMaximum () const
 
virtual bool autoScale () const
 Get whether auto scaling is used. More...
 
virtual void setAutoScale (bool value)
 Set whether auto scaling is used. More...
 
virtual void setNegativeReflection (bool positive)
 Set whether the scale is a reflect negative scale. More...
 
virtual void useBackgroundGradient (bool useIt)
 Set if the background gradient is used. More...
 
virtual bool usesBackgroundGradient () const
 Get if the background gradient is used. More...
 
virtual void drawAsVerticalLines (bool useVerticalLines)
 Set whether vertical line samples are used instead of connected samples. More...
 
virtual bool usesVerticalLines () const
 Get whether vertical line samples are used instead of connected samples. More...
 
void forceUpdate (bool widgetUpdate)
 Force a redraw and optionally a widget update. More...
 

Protected Types

typedef std::list< std::pair
< double, int > > 
PercentValueMap
 
typedef std::map< int,
DtProgressiveLineGraph::Set * > 
SetMap
 

Protected Member Functions

virtual void resizeEvent (QResizeEvent *e)
 Resize event needed to resize back buffer. More...
 
virtual void paintEvent (QPaintEvent *)
 Draw the widget. More...
 
virtual void draw (QPainter &painter, const QRect &rect)
 Draw the control. More...
 
virtual void paintBackground (QPainter &painter)
 Paint background. More...
 
virtual int getSeparation () const
 Get the line separation count. More...
 
virtual void paintLines (QPainter &painter, Set &set)
 Function to draw the lines in the foreground color. More...
 
virtual int desiredRange () const
 Get the desired Range. More...
 
void paintVerticalLines (PercentValueMap &set, QRectF svp, int rangeHeight, QPainter &painter, QPen pen, bool centered)
 Draw the graph as vertical lines. More...
 
void paintConnectedLines (PercentValueMap &set, QRectF svp, int rangeHeight, QPainter &painter, QPen pen)
 Draw the graph as a connected line. More...
 
int desiredMinimum () const
 Get the desired minimum. More...
 

Protected Attributes

int myInitialMinimumRange
 
int myInitialMaximumRange
 
int myMinimumRange
 
int myMaximumRange
 
bool myAutoScale
 
bool myActive
 
SetMap mySets
 
QPixmap myGradBack
 
QPixmap * myLineBuffer
 
QPolygon * myPointCache
 
bool myUseCachedGraph
 
bool myUseGradient
 
bool myGraphNeedsUpdating
 
bool myUseVerticalLines
 
bool myNegativeReflection
 

Detailed Description

Widget which draws a line graphic where the data is progressively added over time.

This is a strait QT Widget which may be moved into other MAK Products, as such it is not in the MAKvrExchange namespace.

Member Typedef Documentation

typedef std::list< std::pair<double,int> > DtProgressiveLineGraph::PercentValueMap
protected

Constructor & Destructor Documentation

DtProgressiveLineGraph::DtProgressiveLineGraph ( int  rangeMin,
int  rangeMax,
bool  autoScale,
QWidget parent 
)

CTOR for creating the graph.

virtual DtProgressiveLineGraph::~DtProgressiveLineGraph ( )
virtual

DTOR for graph.

Member Function Documentation

void DtProgressiveLineGraph::addSet ( int  set,
QPen  pen,
int  initial,
bool  valueCentered = false 
)

Add a set with a color and initial value.

virtual bool DtProgressiveLineGraph::autoScale ( ) const
virtual

Get whether auto scaling is used.

Auto scale will change the range dynamically as points are added.

virtual void DtProgressiveLineGraph::clearAllValues ( )
virtual

Clear all sets.

virtual void DtProgressiveLineGraph::clearValues ( int  set)
virtual

Clear the values.

int DtProgressiveLineGraph::desiredMinimum ( ) const
protected

Get the desired minimum.

virtual int DtProgressiveLineGraph::desiredRange ( ) const
protectedvirtual

Get the desired Range.

virtual void DtProgressiveLineGraph::draw ( QPainter &  painter,
const QRect &  rect 
)
protectedvirtual

Draw the control.

virtual void DtProgressiveLineGraph::drawAsVerticalLines ( bool  useVerticalLines)
virtual

Set whether vertical line samples are used instead of connected samples.

void DtProgressiveLineGraph::forceUpdate ( bool  widgetUpdate)

Force a redraw and optionally a widget update.

virtual int DtProgressiveLineGraph::getSeparation ( ) const
protectedvirtual

Get the line separation count.

void DtProgressiveLineGraph::insertValue ( int  set,
double  percent,
int  value 
)

Insert a value into the middle of the graph.

virtual void DtProgressiveLineGraph::offsetPercentages ( double  percentOffset)
virtual

Offset the percentages of all the values.

Any value with a negative percentage or a percentage > 100 will be dropped.

virtual void DtProgressiveLineGraph::offsetPercentages ( int  set,
double  percentOffset 
)
virtual

Offset the percentages of a set of values.

Any value with a negative percentage or a percentage > 100 will be dropped.

virtual void DtProgressiveLineGraph::paintBackground ( QPainter &  painter)
protectedvirtual

Paint background.

void DtProgressiveLineGraph::paintConnectedLines ( PercentValueMap set,
QRectF  svp,
int  rangeHeight,
QPainter &  painter,
QPen  pen 
)
protected

Draw the graph as a connected line.

virtual void DtProgressiveLineGraph::paintEvent ( QPaintEvent *  )
protectedvirtual

Draw the widget.

virtual void DtProgressiveLineGraph::paintLines ( QPainter &  painter,
Set set 
)
protectedvirtual

Function to draw the lines in the foreground color.

void DtProgressiveLineGraph::paintVerticalLines ( PercentValueMap set,
QRectF  svp,
int  rangeHeight,
QPainter &  painter,
QPen  pen,
bool  centered 
)
protected

Draw the graph as vertical lines.

virtual int DtProgressiveLineGraph::rangeMaximum ( ) const
virtual
virtual int DtProgressiveLineGraph::rangeMinimum ( ) const
virtual

Get the Range minimum and maximum.

virtual void DtProgressiveLineGraph::resetAllValues ( int  value)
virtual

Clear all sets and insert the initial value.

virtual void DtProgressiveLineGraph::resetValues ( int  set,
int  value 
)
virtual

Clear the values and insert the initial value.

virtual void DtProgressiveLineGraph::resizeEvent ( QResizeEvent *  e)
protectedvirtual

Resize event needed to resize back buffer.

virtual void DtProgressiveLineGraph::setAutoScale ( bool  value)
virtual

Set whether auto scaling is used.

Auto scale will change the range dynamically as points are added.

virtual void DtProgressiveLineGraph::setNegativeReflection ( bool  positive)
virtual

Set whether the scale is a reflect negative scale.

virtual void DtProgressiveLineGraph::setRange ( int  min,
int  max 
)
virtual

Sets the minimum and maximum range of the points.

As points are scaled clipped to the min and max. when drawn.

virtual void DtProgressiveLineGraph::useBackgroundGradient ( bool  useIt)
virtual

Set if the background gradient is used.

virtual bool DtProgressiveLineGraph::usesBackgroundGradient ( ) const
virtual

Get if the background gradient is used.

virtual bool DtProgressiveLineGraph::usesVerticalLines ( ) const
virtual

Get whether vertical line samples are used instead of connected samples.

Member Data Documentation

bool DtProgressiveLineGraph::myActive
protected
bool DtProgressiveLineGraph::myAutoScale
protected
QPixmap DtProgressiveLineGraph::myGradBack
protected
bool DtProgressiveLineGraph::myGraphNeedsUpdating
protected
int DtProgressiveLineGraph::myInitialMaximumRange
protected
int DtProgressiveLineGraph::myInitialMinimumRange
protected
QPixmap* DtProgressiveLineGraph::myLineBuffer
protected
int DtProgressiveLineGraph::myMaximumRange
protected
int DtProgressiveLineGraph::myMinimumRange
protected
bool DtProgressiveLineGraph::myNegativeReflection
protected
QPolygon* DtProgressiveLineGraph::myPointCache
protected
SetMap DtProgressiveLineGraph::mySets
protected
bool DtProgressiveLineGraph::myUseCachedGraph
protected
bool DtProgressiveLineGraph::myUseGradient
protected
bool DtProgressiveLineGraph::myUseVerticalLines
protected

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

Document ID: Generated on Mon Apr 19 15:55:22 EDT 2021 from SVN revision 227909
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)