53 using namespace DISPLIB;
54 using namespace Eigen;
63 , m_pPixmapColorbar(NULL)
73 , m_pPixmapColorbar(NULL)
84 , m_pPixmapColorbar(NULL)
95 , m_pPixmapColorbar(NULL)
138 if(p_dMat.rows() > 0 && p_dMat.cols() > 0)
158 MatrixXd t_dMat = p_fMat.cast<
double>();
166 MatrixXd t_dMat = p_iMat.cast<
double>();
191 QImage t_qImageData(x, y, QImage::Format_RGB32);
192 for(i = 0; i < x; ++i)
193 for(j = 0; j < y; ++j)
196 m_pPixmapData =
new QPixmap(QPixmap::fromImage(t_qImageData));
205 t_qImageColorbar.setPixel(0, j, t_qRgb);
256 QPainter painter(
this);
259 QPoint t_qPointTopLeft(0,0);
267 QPixmap t_qPixmapScaledData =
m_pPixmapData->scaled(t_qSizePixmapData, Qt::IgnoreAspectRatio);
269 t_qPointTopLeft.setX((
m_qSizeWidget.width()-t_qPixmapScaledData.width())/2);
270 t_qPointTopLeft.setY((
m_qSizeWidget.height()-t_qPixmapScaledData.height())/2);
272 painter.drawPixmap(t_qPointTopLeft,t_qPixmapScaledData);
274 painter.drawRect(t_qPointTopLeft.x()-1, t_qPointTopLeft.y()-1, t_qPixmapScaledData.width()+1, t_qPixmapScaledData.height()+1);
282 t_qSizePixmapColorbar.setHeight(t_qPixmapScaledData.height());
285 QPixmap t_qPixmapScaledColorbar =
m_pPixmapColorbar->scaled(t_qSizePixmapColorbar, Qt::IgnoreAspectRatio);
287 t_qPointTopLeft.setY(t_qPointTopLeft.y());
288 t_qPointTopLeft.setX(t_qPointTopLeft.x() + t_qPixmapScaledData.width() +
m_iBorderLeftRight/3);
290 painter.drawPixmap(t_qPointTopLeft,t_qPixmapScaledColorbar);
292 painter.drawRect(t_qPointTopLeft.x()-1, t_qPointTopLeft.y()-1,
m_iColorbarWidth+1, t_qPixmapScaledData.height()+1);
305 painter.translate(x, y_max-1);
306 painter.drawText(QRect(0, 0, 100, 12), Qt::AlignLeft, QString::number(
m_dMaxValue));
310 painter.drawLine(x_markLeft,y_max_mark,x_markLeft+2,y_max_mark);
311 painter.drawLine(x_markRight-3,y_max_mark,x_markRight-1,y_max_mark);
315 qint32 y_min = t_qPointTopLeft.y() + t_qSizePixmapColorbar.height()-1 -
m_qFontColorbar.pixelSize()/2;
316 painter.translate(x, y_min-1);
317 painter.drawText(QRect(0, 0, 100, 12), Qt::AlignLeft, QString::number(
m_dMinValue));
321 painter.drawLine(x_markLeft,y_min_mark,x_markLeft+2,y_min_mark);
322 painter.drawLine(x_markRight-3,y_min_mark,x_markRight-1,y_min_mark);
325 qint32 y_dist = y_min - y_max;
328 qint32 y_current = y_min - (minPercent*y_dist);
329 qint32 y_current_mark;
334 painter.translate(x, y_current-1);
335 painter.drawText(QRect(0, 0, 100, 12), Qt::AlignLeft, QString::number(
m_qVecScaleValues[i]));
339 painter.drawLine(x_markLeft,y_current_mark,x_markLeft+2,y_current_mark);
340 painter.drawLine(x_markRight-3,y_current_mark,x_markRight-1,y_current_mark);
342 y_current -= distPercent*y_dist;