utils.cpp
Go to the documentation of this file.
00001 #include "utils.h"
00002 
00003 /*
00004 std::vector<double> BuiltTimepointsList(PlotDataMapRef &data)
00005 {
00006     {
00007         std::vector<size_t> index_num( data.numeric.size(), 0);
00008 
00009         std::vector<double> out;
00010 
00011         bool loop = true;
00012 
00013         const double MAX = std::numeric_limits<double>::max();
00014 
00015         while(loop)
00016         {
00017             double min_time = MAX;
00018             double prev_time = out.empty() ? -MAX : out.back();
00019             loop = false;
00020             size_t count = 0;
00021             for(const auto& it: data.numeric)
00022             {
00023                 const auto& plot = it.second;
00024                 out.reserve(plot.size());
00025 
00026                 size_t index = index_num[count];
00027 
00028                 while ( index < plot.size() && plot.at(index).x <= prev_time   )
00029                 {
00030                     index++;
00031                 }
00032                 if( index >= plot.size() )
00033                 {
00034                     count++;
00035                     continue;
00036                 }
00037                 else{
00038                     loop = true;
00039                 }
00040                 index_num[count] = index;
00041                 double time_val = plot.at(index).x;
00042                 min_time = std::min( min_time, time_val);
00043                 count++;
00044             }
00045             if( min_time < MAX)
00046             {
00047                 out.push_back( min_time );
00048             }
00049         }
00050         return out;
00051     }
00052 }
00053 */


plotjuggler
Author(s): Davide Faconti
autogenerated on Wed Jul 3 2019 19:28:05