MAK Data Logger API Documentation for HLA
List of all members | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
MAKLogger::DtProgressiveLineGraph Class Reference

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

+ Inheritance diagram for MAKLogger::DtProgressiveLineGraph:
+ Collaboration diagram for MAKLogger::DtProgressiveLineGraph:

Public Types

typedef std::set< std::pair
< double, int > > 
PercentValueMap

Public Member Functions

 DtProgressiveLineGraph (int rangeMin, int rangeMax, bool autoScale, QWidget *parent)
 CTOR for creating the graph.
virtual ~DtProgressiveLineGraph ()
 DTOR for graph.
void setModel (DtLgrGuiModel *myModel)
 Set the model, this is required for a number of features such as drawing a cursor.
int verticalMargin () const
 Get the vertical margin.
void setMargins (int horizontalMargin, int verticalMargin)
 set the Graph margins.
void addSet (int set, QPen pen, int initial, bool valueCentered=false)
 Add a set with a color and initial value.
void insertValue (int set, double percent, int value)
 Insert a value into the middle of the graph.
virtual void resetAllValues (int value)
 Clear all sets and insert the initial value.
virtual void resetValues (int set, int value)
 Clear the values and insert the initial value.
virtual void clearValues (int set)
 Clear the values.
virtual void clearAllValues ()
 Clear all sets.
virtual void offsetPercentages (double percentOffset)
 Offset the percentages of all the values.
virtual void offsetPercentages (int set, double percentOffset)
 Offset the percentages of a set of values.
virtual void setRange (int min, int max)
 Sets the minimum and maximum range of the points.
virtual int rangeMinimum () const
 Get the Range minimum and maximum.
virtual int rangeMaximum () const
virtual bool autoScale () const
 Get whether auto scaling is used.
virtual void setAutoScale (bool value)
 Set whether auto scaling is used.
virtual void setNegativeReflection (bool positive)
 Set whether the scale is a reflect negative scale.
virtual void useBackgroundGradient (bool useIt)
 Set if the background gradient is used.
virtual bool usesBackgroundGradient () const
 Get if the background gradient is used.
virtual void useAlphaBlending (bool useIt)
 Set whether to use alpha blending.
virtual bool usesAlphaBlending () const
 Get whether alpha blending is used.
void useBasicGui (bool basic)
 Set whether to use basic render settings.
virtual void drawAsVerticalLines (bool useVerticalLines)
 Set whether vertical line samples are used instead of connected samples.
virtual bool usesVerticalLines () const
 Get whether vertical line samples are used instead of connected samples.
virtual void setOffsets (float left, float right)
 Override base implementation.
void forceUpdate (bool widgetUpdate)
 Force a redraw and optionally a widget update.
bool updateNeeded () const
 Check to see if an update has been forced.
virtual void testForUpdate (DtLgrGuiModel &model)
 Override test for update.
- Public Member Functions inherited from MAKLogger::DtLgrZoomableWidget
 DtLgrZoomableWidget (QWidget *parent)
 CTOR.
virtual ~DtLgrZoomableWidget ()
 DTOR.
QRectF scaledViewport (QRect orignalViewport, QPoint margins) const
 Scale a viewport using the scaled settings and the provided margins.
void drawCursor (QPainter &painter, double firstVisibleTime, double lastVisibleTime, double cursorTime, int xOffset, bool active)
 Draw A cursor.
QRect cursorBounds (double firstVisibleTime, double lastVisibleTime, double cursorTime, int xOffset)
 Get the cursor bounds.
double firstVisibleTime (double firstTime, double lastTime) const
 Get the first visible time, based upon the scale.
double firstVisibleTime (DtLgrGuiModel &model) const
 Get the first visible time via the models display time.
double lastVisibleTime (double firstTime, double lastTime) const
 Get the last visible time, based upon the scale.
double lastVisibleTime (DtLgrGuiModel &model) const
 Get the last visible time via the models display time.
float leftOffset () const
 Get the left offset (percent 0-100.0), inline for performance reasons.
float rightOffset () const
 Get the right offset (percent 0-100.0), inline for performance reasons.
float horizontalMargin () const
 get the horizontal margin.
void setHorizontalMargin (float margin)
 set the horizontal margin.
void setDrawTimes (DtLgrGuiModel &model)

Protected Types

typedef std::map< int, Set * > SetMap

Protected Member Functions

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

Protected Attributes

int myInitialMinimumRange
int myInitialMaximumRange
int myMinimumRange
int myMaximumRange
int myVerticalMargin
bool myAutoScale
bool myActive
SetMap mySets
bool myUseGradient
bool myUseAlphaBlending
QLinearGradient * myLinearGradient
bool myGraphNeedsUpdating
bool myUseVerticalLines
bool myNegativeReflection
QPolygon * myPointCache
QPixmap * myLineBuffer
bool myUseCachedGraph
DtLgrGuiModelmyModel
double myDrawnRange
- Protected Attributes inherited from MAKLogger::DtLgrZoomableWidget
float myLeftOffset
float myRightOffset
float myHorizontalMargin
double myDrawnFirstVisibleTime
double myDrawnLastVisibleTime
double myDrawnCurrentVisibleTime

Additional Inherited Members

- Public Slots inherited from MAKLogger::DtLgrZoomableWidget
- Signals inherited from MAKLogger::DtLgrZoomableWidget
void offsetsChanged (float left, float right)

Detailed Description

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

Member Typedef Documentation

typedef std::set<std::pair<double,int> > MAKLogger::DtProgressiveLineGraph::PercentValueMap
typedef std::map<int,Set*> MAKLogger::DtProgressiveLineGraph::SetMap
protected

Constructor & Destructor Documentation

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

CTOR for creating the graph.

virtual MAKLogger::DtProgressiveLineGraph::~DtProgressiveLineGraph ( )
virtual

DTOR for graph.

Member Function Documentation

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

Add a set with a color and initial value.

virtual bool MAKLogger::DtProgressiveLineGraph::autoScale ( ) const
virtual

Get whether auto scaling is used.

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

virtual void MAKLogger::DtProgressiveLineGraph::clearAllValues ( )
virtual

Clear all sets.

virtual void MAKLogger::DtProgressiveLineGraph::clearValues ( int  set)
virtual

Clear the values.

virtual double MAKLogger::DtProgressiveLineGraph::currentTime ( ) const
protectedvirtual

Get the current time.

int MAKLogger::DtProgressiveLineGraph::desiredMinimum ( ) const
protected

Get the desired minimum.

virtual int MAKLogger::DtProgressiveLineGraph::desiredRange ( ) const
protectedvirtual

Get the desired Range.

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

Draw the control.

virtual void MAKLogger::DtProgressiveLineGraph::drawAsVerticalLines ( bool  useVerticalLines)
virtual

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

virtual double MAKLogger::DtProgressiveLineGraph::firstTime ( ) const
protectedvirtual

Get the current time.

void MAKLogger::DtProgressiveLineGraph::forceUpdate ( bool  widgetUpdate)

Force a redraw and optionally a widget update.

virtual int MAKLogger::DtProgressiveLineGraph::getSeparation ( ) const
protectedvirtual

Get the line separation count.

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

Insert a value into the middle of the graph.

virtual double MAKLogger::DtProgressiveLineGraph::lastTime ( ) const
protectedvirtual

Get the current time.

virtual void MAKLogger::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 MAKLogger::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 MAKLogger::DtProgressiveLineGraph::paintBackground ( QPainter &  painter)
protectedvirtual

Paint background.

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

Draw the graph as a connected line.

virtual void MAKLogger::DtProgressiveLineGraph::paintEvent ( QPaintEvent *  )
protectedvirtual

Draw the widget.

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

Function to draw the lines in the foreground color.

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

Draw the graph as vertical lines.

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

Get the Range minimum and maximum.

virtual void MAKLogger::DtProgressiveLineGraph::resetAllValues ( int  value)
virtual

Clear all sets and insert the initial value.

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

Clear the values and insert the initial value.

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

Resize event needed to resize back buffer.

virtual void MAKLogger::DtProgressiveLineGraph::setAutoScale ( bool  value)
virtual

Set whether auto scaling is used.

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

void MAKLogger::DtProgressiveLineGraph::setMargins ( int  horizontalMargin,
int  verticalMargin 
)

set the Graph margins.

void MAKLogger::DtProgressiveLineGraph::setModel ( DtLgrGuiModel myModel)

Set the model, this is required for a number of features such as drawing a cursor.

virtual void MAKLogger::DtProgressiveLineGraph::setNegativeReflection ( bool  positive)
virtual

Set whether the scale is a reflect negative scale.

virtual void MAKLogger::DtProgressiveLineGraph::setOffsets ( float  left,
float  right 
)
virtual

Override base implementation.

Reimplemented from MAKLogger::DtLgrZoomableWidget.

virtual void MAKLogger::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 MAKLogger::DtProgressiveLineGraph::testForUpdate ( DtLgrGuiModel model)
virtual

Override test for update.

Reimplemented from MAKLogger::DtLgrZoomableWidget.

bool MAKLogger::DtProgressiveLineGraph::updateNeeded ( ) const

Check to see if an update has been forced.

virtual void MAKLogger::DtProgressiveLineGraph::useAlphaBlending ( bool  useIt)
virtual

Set whether to use alpha blending.

virtual void MAKLogger::DtProgressiveLineGraph::useBackgroundGradient ( bool  useIt)
virtual

Set if the background gradient is used.

void MAKLogger::DtProgressiveLineGraph::useBasicGui ( bool  basic)

Set whether to use basic render settings.

virtual bool MAKLogger::DtProgressiveLineGraph::usesAlphaBlending ( ) const
virtual

Get whether alpha blending is used.

virtual bool MAKLogger::DtProgressiveLineGraph::usesBackgroundGradient ( ) const
virtual

Get if the background gradient is used.

virtual bool MAKLogger::DtProgressiveLineGraph::usesVerticalLines ( ) const
virtual

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

int MAKLogger::DtProgressiveLineGraph::verticalMargin ( ) const

Get the vertical margin.

Member Data Documentation

bool MAKLogger::DtProgressiveLineGraph::myActive
protected
bool MAKLogger::DtProgressiveLineGraph::myAutoScale
protected
double MAKLogger::DtProgressiveLineGraph::myDrawnRange
protected
bool MAKLogger::DtProgressiveLineGraph::myGraphNeedsUpdating
protected
int MAKLogger::DtProgressiveLineGraph::myInitialMaximumRange
protected
int MAKLogger::DtProgressiveLineGraph::myInitialMinimumRange
protected
QLinearGradient* MAKLogger::DtProgressiveLineGraph::myLinearGradient
protected
QPixmap* MAKLogger::DtProgressiveLineGraph::myLineBuffer
protected
int MAKLogger::DtProgressiveLineGraph::myMaximumRange
protected
int MAKLogger::DtProgressiveLineGraph::myMinimumRange
protected
DtLgrGuiModel* MAKLogger::DtProgressiveLineGraph::myModel
protected
bool MAKLogger::DtProgressiveLineGraph::myNegativeReflection
protected
QPolygon* MAKLogger::DtProgressiveLineGraph::myPointCache
protected
SetMap MAKLogger::DtProgressiveLineGraph::mySets
protected
bool MAKLogger::DtProgressiveLineGraph::myUseAlphaBlending
protected
bool MAKLogger::DtProgressiveLineGraph::myUseCachedGraph
protected
bool MAKLogger::DtProgressiveLineGraph::myUseGradient
protected
bool MAKLogger::DtProgressiveLineGraph::myUseVerticalLines
protected
int MAKLogger::DtProgressiveLineGraph::myVerticalMargin
protected

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

Document ID: Generated on Mon Jan 19 08:20:14 EST 2015 from SVN revision 149581
Copyright © 2005-2012 VT MÄK. All Rights Reserved (www.mak.com)