Go to the documentation of this file.00001 #include <iostream>
00002 #include <boost/thread.hpp>
00003 #include <pangolin/pangolin.h>
00004
00005 using namespace pangolin;
00006 using namespace std;
00007
00008 #include <pangolin/display_internal.h>
00009
00010 int main( int , char* argv[] )
00011 {
00012
00013 pangolin::CreateGlutWindowAndBind("Main",640,480);
00014
00015
00016 glEnable (GL_BLEND);
00017 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
00018
00019
00020 DataLog log;
00021
00022
00023 Plotter plotter(&log);
00024 plotter.SetBounds(0.0, 1.0, 0.0, 1.0);
00025 DisplayBase().AddDisplay(plotter);
00026
00027 double t = 0;
00028
00029
00030 vector<std::string> labels;
00031 labels.push_back(std::string("sin(t)"));
00032 labels.push_back(std::string("cos(t)"));
00033 labels.push_back(std::string("tan(t)"));
00034 labels.push_back(std::string("sin(t)+cos(t)"));
00035 log.SetLabels(labels);
00036
00037 const double tinc = 0.01;
00038
00039
00040 while( !pangolin::ShouldQuit() )
00041 {
00042 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
00043
00044 log.Log(sin(t),cos(t),tan(t),sin(t)+cos(t));
00045 t += tinc;
00046
00047
00048 pangolin::FinishGlutFrame();
00049
00050 boost::this_thread::sleep(boost::posix_time::milliseconds(10));
00051 }
00052
00053 return 0;
00054 }