\( \def\bold#1{\bf #1} \newcommand{\d}{\mathrm{d}} \) BTP: Manual and Source Code Documentation

Power Uphill

bike mass [kg]
body mass [kg]
altitude gain [m]
climb length [km]
gradient [%]
time [s]
speed [km/h]
power [W]
power/mass [W/kg]
climbrate [m/min]

average power on climb stage

BTP  3.0
Routing/ClimbAnalysis/PowerCalculation
plot2D.cpp
1 #include "plot2D.h"
2 
3 plot2D::plot2D(QWidget *parent){
4  setBackgroundRole(QPalette::Dark);
5  setAutoFillBackground(true);
6  setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
7  setMouseTracking(true);
8  init_s0();
9  s = &s0;
10  dataarea.setRect(0,0,width(),height());
11  count = count1 = count2 = 0;
12  marker = s->xmin;
13  xdata = ydata = xdata1 = ydata1 = xdata2 = ydata2 = NULL;
15 }
16 plot2D::plot2D(plot2D *src){
17  setBackgroundRole(QPalette::Dark);
18  setAutoFillBackground(true);
19  setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
20  setMouseTracking(true);
21  init_s0();
22  s = src->s;
23  dataarea.setRect(0,0,width(),height());
24  count = count1 = count2 = 0;
25  marker = s->xmin;
26  if(src->count > 0){
27  count = src->count;
28  xdata = new double[count];
29  ydata = new double[count];
30  memcpy(xdata,src->xdata,count*sizeof(double));
31  memcpy(ydata,src->ydata,count*sizeof(double));
32  }
33  else{
34  count = 0;
35  xdata = ydata = NULL;
36  }
37  if(src->count1 > 0){
38  count1 = src->count1;
39  xdata1 = new double[count1];
40  ydata1 = new double[count1];
41  memcpy(xdata1,src->xdata1,count1*sizeof(double));
42  memcpy(ydata1,src->ydata1,count1*sizeof(double));
43  }
44  else{
45  count1 = 0;
46  xdata1 = ydata1 = NULL;
47  }
48  if(src->count2 > 0){
49  count2 = src->count2;
50  xdata2 = new double[count2];
51  ydata2 = new double[count2];
52  memcpy(xdata2,src->xdata2,count2*sizeof(double));
53  memcpy(ydata2,src->ydata2,count2*sizeof(double));
54  }
55  else{
56  count2 = 0;
57  xdata2 = ydata2 = NULL;
58  }
59  title =src->title;
60  xbarlabel = src->xbarlabel;
61  ybarlabel = src->ybarlabel;
63 
64 }
65 plot2D::~plot2D(){
66  if(xdata != NULL) delete xdata;
67  if(xdata1 != NULL) delete xdata1;
68  if(xdata2 != NULL) delete xdata2;
69  if(ydata != NULL) delete ydata;
70  if(ydata1 != NULL) delete ydata1;
71  if(ydata2 != NULL) delete ydata2;
72 }
74  s0.autoscale = 1;
75  s0.bgcolor = QColor(Qt::white).rgba();
76  s0.drawtitle = 1;
77  s0.drawxbarlabel = 1;
78  s0.drawxlattice = 1;
79  s0.drawybarlabel = 1;
80  s0.drawylattice = 1;
81  strcpy(s0.font,"Arial");
82  s0.fontcolor = QColor(Qt::black).rgba();
83  s0.fsnormal = 6;
84  s0.fstitle = 10;
85  s0.height = this->height();
86  s0.latticecolor = QColor(0,0,0,100).rgba();
87  s0.margin = 5;
88  s0.width = this->width();
89  s0.xmax = 1;
90  s0.xmin = -1;
91  s0.ymin = -1;
92  s0.ymax = 1;
93  s0.singlecolor = false;
94  s0.fillcolor = QColor(0,255,0,150).rgba();
95  s0.showline = true;
96  s0.linecolor = QColor(Qt::black).rgba();
97  s0.showreduceddata = true;
98 }
99 
100 void plot2D::zoom_out(){
101  double x = s->xmax-s->xmin, y = s->ymax-s->ymin;
102  s->xmin = s->xmin - x/2.;
103  s->xmax = s->xmax + x/2.;
104  s->ymin = s->ymin - y/2.;
105  s->ymax = s->ymax + y/2.;
106  refresh_pixmap();
107 }
108 void plot2D::zoom_in(){
109  double x = s->xmax-s->xmin, y = s->ymax-s->ymin;
110  s->xmin = s->xmin + x/4.;
111  s->xmax = s->xmax - x/4.;
112  s->ymin = s->ymin + y/4.;
113  s->ymax = s->ymax - y/4.;
114  refresh_pixmap();
115 }
116 QSize plot2D::sizeHint() const{
117  return QSize(250,100);
118 }
119 QSize plot2D::minimumSizeHint() const{
120  return QSize(100,100);
121 }
122 void plot2D::paintEvent(QPaintEvent *){
123  QPainter p(this);
124  p.drawPixmap(0,0,pm);
125  if(showzoombox){
126  p.setBrush(QBrush(QColor(0,255,0,100)));
127  p.setPen(palette().light().color());
128  p.drawRect(zoombox.normalized());
129  }
130  if(marker != s->xmin){
131  p.setPen(QPen(Qt::black));
132  p.drawLine(xdatatox(marker),dataarea.bottom(),
133  xdatatox(marker),dataarea.top());
134  }
135 }
136 void plot2D::resizeEvent(QResizeEvent *){
137  refresh_pixmap();
138 }
139 void plot2D::mousePressEvent(QMouseEvent *event){
140  if(dataarea.contains(event->pos())){
141  if( event->button() == Qt::LeftButton){
142  showzoombox = 1;
143  marker = s->xmin;
144  xold = event->pos().x();
145  yold = event->pos().y();
146  zoombox.setHeight(dataarea.height());
147  zoombox.setBottom(dataarea.bottom());
148  zoombox.setTop(dataarea.top());
149  zoombox.setLeft(xold);
150  }
151  }
152 }
153 void plot2D::mouseMoveEvent(QMouseEvent *event){
154  this->setFocus();
155  if(showzoombox){
156  if(event->pos().x()>xold)
157  zoombox.setWidth(event->pos().x()-xold);
158  else{
159  zoombox.setLeft(event->pos().x());
160  zoombox.setWidth(xold-event->pos().x());
161  }
162  }
163  else{
164  if(dataarea.contains(event->pos()))
165  emit mousex(xtoxdata(event->pos().x()));
166  marker = xtoxdata(event->pos().x());
167  }
168  update();
169 }
170 void plot2D::mouseReleaseEvent(QMouseEvent *event){
171  if( event->button() == Qt::LeftButton
172  && showzoombox){
173  showzoombox = 0;
174  if(event->pos().x()!=xold){
175  if(event->pos().x()>xold)
176  zoombox.setWidth(event->pos().x()-xold);
177  else{
178  zoombox.setLeft(event->pos().x());
179  zoombox.setWidth(xold-event->pos().x());
180  }
181  if(zoombox.normalized().width() < 2 || zoombox.normalized().height()<2)
182  return;
183  double xmint = xtoxdata(zoombox.normalized().left());
184  double xmaxt = xtoxdata(zoombox.normalized().right());
185  double ymint = ytoydata(zoombox.normalized().bottom());
186  double ymaxt = ytoydata(zoombox.normalized().top());
187  s->xmin = xmint;
188  s->ymin = ymint;
189  s->xmax = xmaxt;
190  s->ymax = ymaxt;
191  emit call_zoom_repaint(s->xmin,s->xmax);
192  }
193  if(event->pos().y() == yold)
194  emit clicked(xtoxdata(event->pos().x()));
195  }
196 }
197 void plot2D::keyPressEvent(QKeyEvent *event){
198  switch(event->key()){
199  case Qt::Key_Plus:
200  title="";
201  zoom_in();
202  break;
203  case Qt::Key_Minus:
204  title="";
205  zoom_out();
206  break;
207  case Qt::Key_Escape:
208  emit call_fullview();
209  break;
210  default:
211  emit keypressed(event);
212  }
213 }
215  pm = QPixmap(size());
216  QPainter p(&pm);
217  p.fillRect(pm.rect(),QColor::fromRgba(s->bgcolor));
218  add_axis_labels(&p);
219  add_grid(&p);
220  p.setRenderHint(QPainter::Antialiasing);
221  add_data(&p);
222  update();
223 }
224 double plot2D::xtoxdata(int x){
225  return s->xmin + 1.*(x-dataarea.x())/dataarea.width()*(s->xmax-s->xmin);
226 }
227 double plot2D::ytoydata(int y){
228  return s->ymax - 1.*(y-dataarea.y())/dataarea.height()*(s->ymax-s->ymin);
229 }
230 double plot2D::xdatatox(double x){
231  return dataarea.left() + ((x-s->xmin)/(s->xmax-s->xmin)*dataarea.width());
232 }
233 double plot2D::ydatatoy(double y){
234  return dataarea.bottom() - ((y-s->ymin)/(s->ymax-s->ymin)*dataarea.height());
235 }
236 void plot2D::add_axis_labels(QPainter* p){
237  p->setFont(QFont(QString(s->font),s->fsnormal));
238  QFontMetricsF q(p->font());
239  float textheight = q.height();
240  QFontMetricsF qt(QFont(QString(s->font),s->fstitle));
241  float titleheight = qt.height();
242  float ticklength = textheight /2;
243  int daxmin = s->margin + ticklength,
244  daxmax = this->width()-s->margin,
245  daymin = s->margin ,
246  daymax = this->height()-s->margin-ticklength-s->margin-textheight;
247  if(s->drawtitle && !title.isEmpty())
248  daymin = daymin + titleheight + s->margin;
249  if(s->drawxbarlabel && !xbarlabel.isEmpty())
250  daymax = daymax - s->margin - textheight;
251  if(s->drawybarlabel && !ybarlabel.isEmpty())
252  daxmin = daxmin + s->margin + textheight;
253 
254  /*y-Achsen Beschriftungsintervall festlegen*/
255  ysteps = floor((daymax-daymin-s->margin)/(textheight + s->margin));
256  double step = 1.*(s->ymax-s->ymin)/ysteps;
257  yprecission = floor(log10(step));
258  step = step/pow(10,yprecission+1);
259  ystep = 0.1;
260  if(step > 0.1) ystep = 0.2;
261  if(step > 0.2) ystep = 0.25;
262  if(step > 0.25) ystep = 0.5;
263  if(step > 0.5) ystep = 1.;
264  ystep = ystep * pow(10,yprecission+1);
265  ystep0 = ystep*ceil(s->ymin/ystep);
266  ysteps = floor((s->ymax-ystep0)/ystep);
267 
268  QString a = QString("%1").arg(ystep0,0,'f',qMax(0.,-yprecission));
269  QString b = QString("%1").arg(ystep0+ysteps*ystep,0,'f',qMax(0.,-yprecission));
270 
271  daxmin += s->margin + qMax(q.width(a), q.width(b));
272 
273  /*x-Achsen Beschriftungsintervall festlegen*/
274  double ww;
275  int OK = 1, End = 0, tickcount = 0;
276  while(OK){
277  if(End){ tickcount--; OK = 0;}
278  else tickcount++;
279  step = 1.*(s->xmax-s->xmin)/tickcount;
280  xprecission = floor(log10(step));
281  step = step/pow(10,xprecission+1);
282  xstep = 0.1;
283  if(step > 0.1) xstep = 0.2;
284  if(step > 0.2) xstep = 0.25;
285  if(step > 0.25) xstep = 0.5;
286  if(step > 0.5) xstep = 1.;
287  xstep = xstep * pow(10,xprecission+1);
288  xstep0 = xstep*ceil(s->xmin/xstep);
289  xsteps = qMax(1.,floor((s->xmax-xstep0)/xstep));
290  ww = q.width(QString("-%1").arg(xstep0,0,'f',qMax(0.,-xprecission)));
291  if( (daxmax-daxmin)/(xsteps) - s->margin
292  < q.width(QString("-%1").arg(xstep0,0,'f',qMax(0.,-xprecission))))
293  End = 1;
294  }
295 
296  /*Zeichenbereich festetzen*/
297  dataarea = QRect(daxmin,daymin,daxmax-daxmin,daymax-daymin);
298 
299  p->setPen(QColor::fromRgba(s->fontcolor));
300  /*y-Achsen Zeichnen*/
301  p->drawLine(dataarea.topLeft(),dataarea.bottomLeft());
302  p->drawLine(dataarea.topRight(),dataarea.bottomRight());
303  double y0;
304  for(double y = ystep0; y < s->ymax; y = y + ystep){
305  y0 = ydatatoy(y);
306  p->drawLine(dataarea.left(), y0,
307  dataarea.left()-ticklength,y0);
308  p->drawText(0,y0-textheight/2,dataarea.left()-ticklength-s->margin,textheight,
309  Qt::AlignRight,QString("%1").arg(y,0,'f',qMax(0.,-yprecission)));
310  }
311  if(!ybarlabel.isNull()){
312  p->save();
313  //p->translate(100,100);
314  p->rotate(-90);
315  p->drawText(0,s->margin,-height(),textheight,Qt::AlignCenter,ybarlabel);
316  p->restore();
317  }
318 
319 
320  /*x-Achsen Zeichnen*/
321  p->drawLine(dataarea.bottomLeft(),dataarea.bottomRight());
322  p->drawLine(dataarea.topLeft(),dataarea.topRight());
323  double x0;
324  for(double x = xstep0; x < s->xmax; x = x + xstep){
325  x0 = xdatatox(x);
326  p->drawLine(x0, dataarea.bottom(),
327  x0, dataarea.bottom()+ticklength);
328  QString t = QString("%1").arg(x,0,'f',qMax(0.,-xprecission));
329  if(q.width(t)/2+x0+s->margin < width())
330  p->drawText(x0-1000,dataarea.bottom()+ticklength+s->margin,2001,
331  textheight,Qt::AlignCenter,t);
332  }
333  if(s->drawxbarlabel && !xbarlabel.isNull())
334  p->drawText(dataarea.left(),dataarea.bottom()+2*s->margin+ticklength+textheight,
335  dataarea.width(),textheight,Qt::AlignCenter,xbarlabel);
336 
337  /*Titel zeichnen*/
338  if(s->drawtitle && !title.isNull()){
339  p->setFont(QFont(QString(s->font),s->fstitle));
340  p->drawText(0,s->margin,width(),titleheight,Qt::AlignCenter,title);
341  }
342 }
343 void plot2D::add_grid(QPainter* p){
344  p->setPen(QColor::fromRgba(s->latticecolor));
345  p->setClipRect(dataarea.adjusted(+1,+1,-1,-1));
346  if(s->drawylattice)
347  for(double y = ystep0; y < s->ymax; y = y + ystep){
348  p->drawLine(dataarea.left() ,ydatatoy(y),
349  dataarea.right(),ydatatoy(y));
350  }
351  if(s->drawxlattice)
352  for(double x = xstep0; x < s->xmax; x = x + xstep){
353  p->drawLine(xdatatox(x), dataarea.bottom(),
354  xdatatox(x), dataarea.top());
355  }
356 }
357 void plot2D::add_data(QPainter* p){
358  p->setClipRect(dataarea.adjusted(+1,+1,-1,-1));
359  QPointF d[4];
360  p->setPen(Qt::NoPen);
361  if(s->singlecolor)
362  p->setBrush(QBrush(QColor::fromRgba(s->fillcolor)));
363  double slope;
364  int iold = 0;
365  double dxmin;
366  if(s->showreduceddata)
367  dxmin = (s->xmax-s->xmin)/(dataarea.width()/5);
368  else{
369  dxmin = 0;
370  p->setRenderHint(QPainter::Antialiasing);
371  }
372  for(int i = 1; i < count; i++){
373  if( xdata[i]-xdata[iold] > dxmin
374  && ( (xdata[i] >= s->xmin && xdata[i] <= s->xmax)
375  ||(xdata[i-1]>=s->xmin && xdata[i-1]<=s->xmax))){
376  d[0].setX(xdatatox(xdata[iold]));
377  d[1].setX(xdatatox(xdata[i]));
378  if(!s->showreduceddata
379  ||d[1].x()-d[0].x()>5){
380  d[0].setY(ydatatoy(ydata[iold]));
381  d[1].setY(ydatatoy(ydata[i]));
382  d[2].setX(d[1].x());
383  d[2].setY(dataarea.bottom());
384  d[3].setX(d[0].x());
385  d[3].setY(dataarea.bottom());
386  slope = qAbs((ydata[i]-ydata[iold])/(xdata[i]-xdata[iold]))*0.001;
387  if(!s->singlecolor)
388  p->setBrush(QBrush(slopetocolor(slope)));
389  p->drawPolygon(d,4);
390  if(s->showline){
391  p->setPen(QPen(QColor::fromRgba(s->linecolor),4,Qt::SolidLine,Qt::RoundCap));
392  p->drawLine(d[0],d[1]);
393  p->setPen(Qt::NoPen);
394  }
395  iold = i;
396  }
397  }
398  }
399  double tmin, tmax;
400  p->setPen(QPen(Qt::red,1.0));
401  if(count1 > 0){
402  tmin = tmax = ydata1[0];
403  for(int i = 1; i < count1; i++){
404  tmin = qMin(tmin,ydata1[i]);
405  tmax = qMax(tmax,ydata1[i]);
406  }
407  tmin -= (tmax-tmin)/20;
408  tmax += (tmax-tmin)/20;
409  QPointF* P = new QPointF[count1];
410  int ci = 1;
411  P[0].setX(xdatatox(xdata1[0]));
412  P[0].setY(dataarea.bottom()
413  -dataarea.height()*
414  (ydata1[0]-tmin)/(tmax-tmin));
415  for(int i = 1; i < count1; i++)
416  if( (xdata1[i-1]/1000. > s->xmin && xdata1[i-1]/1000. < s->xmax)
417  ||(xdata1[i ]/1000. > s->xmin && xdata1[i ]/1000. < s->xmax)){
418  P[ci].setX(xdatatox(xdata1[i]/1000.));
419  P[ci].setY(dataarea.bottom()
420  -dataarea.height()*
421  (ydata1[i]-tmin)/(tmax-tmin));
422  ci++;
423  }
424  if(ci < count1){
425  P[ci].setX(xdatatox(xdata1[count1-1]));
426  P[ci].setY(dataarea.bottom()
427  -dataarea.height()*
428  (ydata1[count1-1]-tmin)/(tmax-tmin));
429  ci++;
430  }
431  p->drawPolyline(P,ci);
432  delete P;
433  }
434  p->setPen(QPen(Qt::blue,1.0));
435  if(count2 > 0){
436  tmin = tmax = ydata2[0];
437  for(int i = 1; i < count2; i++){
438  tmin = qMin(tmin,ydata2[i]);
439  tmax = qMax(tmax,ydata2[i]);
440  }
441  tmin -= (tmax-tmin)/20;
442  tmax += (tmax-tmin)/20;
443  QPointF* P = new QPointF[count2];
444  int ci = 1;
445  P[0].setX(xdatatox(xdata2[0]));
446  P[0].setY(dataarea.bottom()
447  -dataarea.height()*
448  (ydata2[0]-tmin)/(tmax-tmin));
449  for(int i = 1; i < count2; i++)
450  if( (xdata2[i-1]/1000. > s->xmin && xdata2[i-1]/1000. < s->xmax)
451  ||(xdata2[i ]/1000. > s->xmin && xdata2[i ]/1000. < s->xmax)){
452  P[ci].setX(xdatatox(xdata2[i]/1000.));
453  P[ci].setY(dataarea.bottom()
454  -dataarea.height()*
455  (ydata2[i]-tmin)/(tmax-tmin));
456  ci++;
457  }
458  if(ci < count2){
459  P[ci].setX(xdatatox(xdata2[count2-1]));
460  P[ci].setY(dataarea.bottom()
461  -dataarea.height()*
462  (ydata2[count2-1]-tmin)/(tmax-tmin));
463  ci++;
464  }
465  p->drawPolyline(P,ci);
466  delete P;
467  }
468  p->setClipRect(this->rect());
469 }
470 void plot2D::set_labels(QString title, QString xbarlabel, QString ybarlabel){
471  this->title = title;
472  this->xbarlabel = xbarlabel;
473  this->ybarlabel = ybarlabel;
474 }
475 void plot2D::set_data(double** dataxy,int count){
476  set_data(dataxy,count,NULL,0,NULL,0);
477 }
478 void plot2D::set_data(double** dataxy, int count,
479  double** data1xy, int count1,
480  double** data2xy, int count2){
481  if(xdata != NULL || ydata != NULL){
482  delete xdata;
483  delete ydata;
484  xdata1 = ydata1 = NULL;
485  }
486  if(xdata1 != NULL || ydata1 != NULL){
487  delete xdata1;
488  delete ydata1;
489  xdata1 = ydata1 = NULL;
490  }
491  if(xdata2 != NULL || ydata2 != NULL){
492  delete xdata2;
493  delete ydata2;
494  xdata2 = ydata2 = NULL;
495  }
496  this->count = count;
497  if(count>0){
498  xdata = new double[count];
499  ydata = new double[count];
500  for(int i= 0; i < count; i++){
501  xdata[i] = dataxy[0][i];
502  ydata[i] = dataxy[1][i];
503  }
504  }
505  else
506  xdata = ydata = NULL;
507  this->count1 = count1;
508  if(count1>0){
509  xdata1 = new double[count1];
510  ydata1 = new double[count1];
511  for(int i= 0; i < count1; i++){
512  xdata1[i] = data1xy[0][i];
513  ydata1[i] = data1xy[1][i];
514  }
515  }
516  else
517  xdata1 = ydata1 = NULL;
518  this->count2 = count2;
519  if(count2>0){
520  xdata2 = new double[count2];
521  ydata2 = new double[count2];
522  for(int i= 0; i < count2; i++){
523  xdata2[i] = data2xy[0][i];
524  ydata2[i] = data2xy[1][i];
525  }
526  }
527  else
528  xdata2 = ydata2 = NULL;
529 
530 
531  if(s->autoscale)
532  autoset_axis();
533  else
534  refresh_pixmap();
535 
536 }
537 
538 QColor plot2D::slopetocolor(double x){
539  if(x<0.03) return QColor(255,255,255,150);
540  if(x<0.05) return QColor(150,255,150,150);
541  if(x<0.07) return QColor(0,255,0,150);
542  if(x<0.09) return QColor(255,255,0,150);
543  if(x<0.12)return QColor(255,0,0,150);
544  return QColor(0,0,0,150);
545 }
547  if(xdata == NULL)
548  s->ymin = s->ymax = s->xmin = s->xmax = 0;
549  else{
550  s->ymax = s->xmax = -1e300;
551  s->ymin = s->xmin = +1e300;
552  }
553  for(int i = 0; i < count; i++){
554  if(xdata[i] > s->xmax) s->xmax = xdata[i];
555  if(ydata[i] > s->ymax) s->ymax = ydata[i];
556  if(xdata[i] < s->xmin) s->xmin = xdata[i];
557  if(ydata[i] < s->ymin) s->ymin = ydata[i];
558  }
559  if(s->xmin == s->xmax){s->xmin--; s->xmax++;}
560  if(s->ymin == s->ymax){s->ymin--; s->ymax++;}
561  s->ymax += (s->ymax-s->ymin)/10.;
562  s->ymin -= (s->ymax-s->ymin)/20.;
563  refresh_pixmap();
564 }
565 void plot2D::set_marker(double x){
566  if(marker != x){
567  marker = x;
568  update();
569  }
570 }
571 double plot2D::get_xmin(){
572  return s->xmin;
573 }
574 void plot2D::set_size(int w,int h){
575  resize(w,h);
576  dataarea.setRect(0,0,width(),height());
577  refresh_pixmap();
578 }
579 void plot2D::save_to_png(QString filename){
580  pm.save(filename,"PNG");
581 }
583  this->s = s;
584 }
bool showreduceddata
average data over multiple screen pixels to sensfully show fill color
Definition: DataTyps.h:211
void call_zoom_repaint(double xmin, double xmax)
indicate wish to be repainted
void add_data(QPainter *p)
rendering subfunction
Definition: plot2D.cpp:357
double xdatatox(double x)
transform data value to pic-px
Definition: plot2D.cpp:230
ProfilSettings s0
intrinsic settings
Definition: plot2D.h:51
QRect dataarea
coordinates of plot inset
Definition: plot2D.h:61
holds data grid information
Definition: HeightData.h:9
void autoset_axis()
autoscale plot to full data view
Definition: plot2D.cpp:546
double ytoydata(int y)
transform pic-px to data value
Definition: plot2D.cpp:227
double * ydata2
linedata blue
Definition: plot2D.h:48
void add_axis_labels(QPainter *p)
rendering subfunction
Definition: plot2D.cpp:236
void call_fullview()
indicate wish to be rescaled
QRect zoombox
rect to be drawn green when zoomed
Definition: plot2D.h:62
void set_marker(double x)
draws vertical black line at x pos
Definition: plot2D.cpp:565
double yprecission
axis label precission
Definition: plot2D.h:55
QColor slopetocolor(double x)
calc fill color of profil data
Definition: plot2D.cpp:538
setting for 2D plot
Definition: DataTyps.h:196
void mousex(double x)
int count2
data point count
Definition: plot2D.h:49
double xtoxdata(int x)
transform pic-px to data value
Definition: plot2D.cpp:224
plotting 2D-Data sets as the height profile of a track or poweranalysis data
Definition: plot2D.h:20
QPixmap pm
plot pixel data
Definition: plot2D.h:50
float titleheight
text size
Definition: plot2D.h:58
ProfilSettings * s
assigned settings to be used
Definition: plot2D.h:52
void refresh_pixmap()
repaints the plot&#39;s pixmap
Definition: plot2D.cpp:214
double * ydata
profile data
Definition: plot2D.h:46
void set_data(double **dataxy, int count)
setting one dataset and repaint plot
Definition: plot2D.cpp:475
void init_s0()
initialize intrinsic settings
Definition: plot2D.cpp:73
double ydatatoy(double y)
transform data value to pic-px
Definition: plot2D.cpp:233
double * ydata1
linedata red
Definition: plot2D.h:47
void settings(ProfilSettings *s)
asign settings to plot
Definition: plot2D.cpp:582
void add_grid(QPainter *p)
rendering subfunction
Definition: plot2D.cpp:343