proj home

Files   Classes   Functions   Hierarchy  

pointsgraphtimeD2 Class Reference

Plot fixed number of points in time. More...

#include <pointsgraphtimeD2.h>

Inheritance diagram for pointsgraphtimeD2:
Collaboration diagram for pointsgraphtimeD2:

List of all members.

Public Member Functions

 pointsgraphtimeD2 (uintc N_, windowscaleD2 const &screen_, windowscaleD2 const &world_)
void push_back (doublec y)
 Add the point to the back.
void push_front (doublec y)
 Add the point to the front.
void update ()
 Update so draw() draws the current state.

Public Attributes

uint N
 Number of points.
uint Ncurrent
 Current number of points.
deque< double > ytime
 y values in time.


Detailed Description

Plot fixed number of points in time.

The newest point is plotted furthest to the right. As the x-axis is in time.

Definition at line 10 of file pointsgraphtimeD2.h.


Constructor & Destructor Documentation

pointsgraphtimeD2::pointsgraphtimeD2 ( uintc  N_,
windowscaleD2 const &  screen_,
windowscaleD2 const &  world_ 
)


Member Function Documentation

void pointsgraphtimeD2::push_back ( doublec  y  ) 

Add the point to the back.

Definition at line 13 of file pointsgraphtimeD2.cpp.

References N, Ncurrent, and ytime.

00014 {
00015   if (Ncurrent==N)
00016   {
00017     ytime.popfront();
00018     ytime.push_back(y);
00019     return;
00020   }
00021   assert(Ncurrent<=N);
00022 
00023   ++Ncurrent;
00024   ytime.push_back(y);
00025 }

void pointsgraphtimeD2::push_front ( doublec  y  ) 

Add the point to the front.

void pointsgraphtimeD2::update (  ) 

Update so draw() draws the current state.

Reimplemented from pointsgraph.


Member Data Documentation

Number of points.

Definition at line 15 of file pointsgraphtimeD2.h.

Referenced by push_back().

Current number of points.

Definition at line 18 of file pointsgraphtimeD2.h.

Referenced by push_back().

deque<double> pointsgraphtimeD2::ytime

y values in time.

Definition at line 21 of file pointsgraphtimeD2.h.

Referenced by push_back().


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

Generated on Fri Mar 4 00:50:10 2011 for Chelton Evans Source by  doxygen 1.5.8