@@ -1,6 +1,9 | |||||
1 | INCLUDEPATH += $$PWD |
|
1 | INCLUDEPATH += $$PWD | |
2 | DEPENDPATH += $$PWD |
|
2 | DEPENDPATH += $$PWD | |
3 |
|
3 | |||
|
4 | QMAKE_CXXFLAGS+= -fopenmp | |||
|
5 | QMAKE_LFLAGS += -fopenmp | |||
|
6 | ||||
4 | SOURCES += \ |
|
7 | SOURCES += \ | |
5 | $$PWD/qcolormapseries.cpp \ |
|
8 | $$PWD/qcolormapseries.cpp \ | |
6 | $$PWD/colormapchart.cpp \ |
|
9 | $$PWD/colormapchart.cpp \ |
@@ -8,8 +8,8 | |||||
8 | #include <private/qchart_p.h> |
|
8 | #include <private/qchart_p.h> | |
9 | #include <QtGui/QPainter> |
|
9 | #include <QtGui/QPainter> | |
10 |
|
10 | |||
11 | //#include <algorithm> |
|
|||
12 | #include <cmath> |
|
11 | #include <cmath> | |
|
12 | #include "omp.h" | |||
13 |
|
13 | |||
14 | #include "qcolorbaraxis.h" |
|
14 | #include "qcolorbaraxis.h" | |
15 |
|
15 | |||
@@ -152,8 +152,8 void QColorMapSeries::setPen(const QPen | |||||
152 | //bool emitColorChanged = d->m_pen.color() != pen.color(); |
|
152 | //bool emitColorChanged = d->m_pen.color() != pen.color(); | |
153 | d->m_pen = pen; |
|
153 | d->m_pen = pen; | |
154 | emit d->updated(); |
|
154 | emit d->updated(); | |
155 | // if (emitColorChanged) |
|
155 | // if (emitColorChanged) | |
156 | // emit colorChanged(pen.color()); |
|
156 | // emit colorChanged(pen.color()); | |
157 | emit penChanged(pen); |
|
157 | emit penChanged(pen); | |
158 | } |
|
158 | } | |
159 | } |
|
159 | } | |
@@ -438,14 +438,18 void QColorMapSeriesPrivate::getUniformG | |||||
438 | double dx = (m_maxX - m_minX)/(double)width; |
|
438 | double dx = (m_maxX - m_minX)/(double)width; | |
439 | double dy = (m_maxY - m_minY)/(double)height; |
|
439 | double dy = (m_maxY - m_minY)/(double)height; | |
440 |
|
440 | |||
441 | int x=0; |
|
441 | int index=0; | |
442 | int y=0; |
|
|||
443 |
|
442 | |||
444 | QVector<Point3D> cluster; |
|
443 | QVector<Point3D> cluster; | |
445 | cluster.reserve(height*width/1000); |
|
444 | cluster.reserve(height*width/1000); | |
|
445 | ||||
|
446 | int x = 0; | |||
|
447 | int y = 0; | |||
446 |
|
448 | |||
447 | for (auto cell= grid.begin();cell<grid.end();++cell) |
|
449 | for (auto cell= grid.begin();cell<grid.end();++cell) | |
448 | { |
|
450 | { | |
|
451 | x = index%width; | |||
|
452 | y = index/width; | |||
449 | cluster.resize(0); |
|
453 | cluster.resize(0); | |
450 | this->buildCluster(x,y,dx,dy,cluster); |
|
454 | this->buildCluster(x,y,dx,dy,cluster); | |
451 | if(strategy == QColorMapSeries::LastPixel) |
|
455 | if(strategy == QColorMapSeries::LastPixel) | |
@@ -454,16 +458,30 cluster.reserve(height*width/1000); | |||||
454 | *cell=this->clusterStrategyMean(cluster); |
|
458 | *cell=this->clusterStrategyMean(cluster); | |
455 | else if(strategy == QColorMapSeries::MedianPixel) |
|
459 | else if(strategy == QColorMapSeries::MedianPixel) | |
456 | *cell=this->clusterStrategyMedian(cluster); |
|
460 | *cell=this->clusterStrategyMedian(cluster); | |
457 | if(x<width-1) |
|
461 | index++; | |
458 | { |
|
|||
459 | x++; |
|
|||
460 | } |
|
|||
461 | else |
|
|||
462 | { |
|
|||
463 | x=0; |
|
|||
464 | y++; |
|
|||
465 | } |
|
|||
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