@@ -1,6 +1,9 | |||
|
1 | 1 | INCLUDEPATH += $$PWD |
|
2 | 2 | DEPENDPATH += $$PWD |
|
3 | 3 | |
|
4 | QMAKE_CXXFLAGS+= -fopenmp | |
|
5 | QMAKE_LFLAGS += -fopenmp | |
|
6 | ||
|
4 | 7 | SOURCES += \ |
|
5 | 8 | $$PWD/qcolormapseries.cpp \ |
|
6 | 9 | $$PWD/colormapchart.cpp \ |
@@ -8,8 +8,8 | |||
|
8 | 8 | #include <private/qchart_p.h> |
|
9 | 9 | #include <QtGui/QPainter> |
|
10 | 10 | |
|
11 | //#include <algorithm> | |
|
12 | 11 | #include <cmath> |
|
12 | #include "omp.h" | |
|
13 | 13 | |
|
14 | 14 | #include "qcolorbaraxis.h" |
|
15 | 15 | |
@@ -152,8 +152,8 void QColorMapSeries::setPen(const QPen | |||
|
152 | 152 | //bool emitColorChanged = d->m_pen.color() != pen.color(); |
|
153 | 153 | d->m_pen = pen; |
|
154 | 154 | emit d->updated(); |
|
155 | // if (emitColorChanged) | |
|
156 | // emit colorChanged(pen.color()); | |
|
155 | // if (emitColorChanged) | |
|
156 | // emit colorChanged(pen.color()); | |
|
157 | 157 | emit penChanged(pen); |
|
158 | 158 | } |
|
159 | 159 | } |
@@ -438,14 +438,18 void QColorMapSeriesPrivate::getUniformG | |||
|
438 | 438 | double dx = (m_maxX - m_minX)/(double)width; |
|
439 | 439 | double dy = (m_maxY - m_minY)/(double)height; |
|
440 | 440 | |
|
441 | int x=0; | |
|
442 | int y=0; | |
|
441 | int index=0; | |
|
443 | 442 | |
|
444 | QVector<Point3D> cluster; | |
|
445 | cluster.reserve(height*width/1000); | |
|
443 | QVector<Point3D> cluster; | |
|
444 | cluster.reserve(height*width/1000); | |
|
445 | ||
|
446 | int x = 0; | |
|
447 | int y = 0; | |
|
446 | 448 | |
|
447 | 449 | for (auto cell= grid.begin();cell<grid.end();++cell) |
|
448 | 450 | { |
|
451 | x = index%width; | |
|
452 | y = index/width; | |
|
449 | 453 | cluster.resize(0); |
|
450 | 454 | this->buildCluster(x,y,dx,dy,cluster); |
|
451 | 455 | if(strategy == QColorMapSeries::LastPixel) |
@@ -454,16 +458,30 cluster.reserve(height*width/1000); | |||
|
454 | 458 | *cell=this->clusterStrategyMean(cluster); |
|
455 | 459 | else if(strategy == QColorMapSeries::MedianPixel) |
|
456 | 460 | *cell=this->clusterStrategyMedian(cluster); |
|
457 | if(x<width-1) | |
|
458 | { | |
|
459 | x++; | |
|
460 | } | |
|
461 | else | |
|
462 | { | |
|
463 | x=0; | |
|
464 | y++; | |
|
465 | } | |
|
461 | index++; | |
|
466 | 462 | } |
|
463 | ||
|
464 | //#pragma omp for | |
|
465 | // for(int y = 0;y<height;y++) | |
|
466 | // { | |
|
467 | // for(int x =0;x<width;x++) | |
|
468 | // { | |
|
469 | // cluster.resize(0); | |
|
470 | // this->buildCluster(x,y,dx,dy,cluster); | |
|
471 | // if(strategy == QColorMapSeries::LastPixel) | |
|
472 | // grid[width*y+x] = this->clusterStrategyLast(cluster); | |
|
473 | // else if(strategy == QColorMapSeries::MeanPixel) | |
|
474 | // grid[width*y+x] = this->clusterStrategyMean(cluster); | |
|
475 | // else if(strategy == QColorMapSeries::MedianPixel) | |
|
476 | // grid[width*y+x] = this->clusterStrategyMedian(cluster); | |
|
477 | // } | |
|
478 | // } | |
|
479 | } | |
|
480 | ||
|
481 | double QColorMapSeriesPrivate::computeValuePixel() | |
|
482 | { | |
|
483 | ||
|
484 | ||
|
467 | 485 | } |
|
468 | 486 | |
|
469 | 487 | /*! |
General Comments 0
You need to be logged in to leave comments.
Login now