void TutorialStateChecklistWizardAbstract::begin ()
{
  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateChecklistWizardAbstract::begin ()";

  m_title = createTitle ("Checklist Wizard and Checklist Guide");
  m_background = createPixmapItem (":/engauge/img/panel_checklist.png",
                                   QPoint (0, 30));
  m_text0 = createTextItem ("For new Engauge users, a Checklist Wizard\n"
                            "is available when importing an image file.\n"
                            "This wizard produces a helpful checklist of\n"
                            "steps to follow to digitize the image file.",
                            QPoint (260, 30));
  m_text1 = createTextItem ("Step 1 - Enable the menu option Help /\n"
                            "Checklist Guide Wizard.",
                            QPoint (285, 125));
  m_text2 = createTextItem ("Step 2 - Import the file using File /\n"
                            "Import. The Checklist Wizard will appear\n"
                            "and ask some simple questions to\n"
                            "determine how the image can be\n"
                            "digitized.",
                            QPoint (285, 175));
  m_text3 = createTextItem ("Additional options are available in\n"
                            "the various Settings menus.\n\n"
                            "This ends the tutorial. Good luck!",
                            QPoint (285, 270));

  QSize backgroundSize = context().tutorialDlg().backgroundSize();

  m_previous = new TutorialButton ("Previous",
                                   context().tutorialDlg().scene());
  m_previous->setGeometry (QPoint (buttonMargin (),
                                   backgroundSize.height () - buttonMargin() - m_previous->size().height()));
}
void TutorialStateIntroduction::begin ()
{
  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateIntroduction::begin ()";

  m_title = createTitle (tr ("Introduction"));
  m_background = createPixmapItem (":/engauge/img/SpreadsheetsForDoc.png",
                                   QPoint (0, 0));
  m_text0 = createTextItem (tr ("Engauge Digitizer starts with\n"
                                "images of graphs and maps."),
                            QPoint (200, 40));
  m_text1 = createTextItem (tr ("You create (or digitize) points along\n"
                                "the graph and map curves."),
                            QPoint (240, 180));
  m_text2 = createTextItem (tr ("The digitized curve points can be\n"
                                "exported, as numbers, to other software tools."),
                            QPoint (210, 330));

  QSize backgroundSize = context().tutorialDlg().backgroundSize();

  m_next = new TutorialButton (tr ("Next"),
                               context().tutorialDlg().scene());
  m_next->setGeometry (QPoint (backgroundSize.width () - buttonMargin () - m_next->size ().width (),
                               backgroundSize.height () - buttonMargin () - m_next->size ().height ()));
  connect (m_next, SIGNAL (signalTriggered ()), this, SLOT (slotNext ()));
}
Пример #3
0
void UniAssociation::setRole(const Association::Role& role) {
    //items.clear();
    QList< QSharedPointer< RoleTextItem > > newItems;

    if (!role.name.isEmpty()) {
        qreal trans = !_role.name.isEmpty() ? items[0]->translation() : defaultTranslation;
        qreal rot = !_role.name.isEmpty() ? items[0]->translation() : defaultRoleRotation;
        QSharedPointer< RoleTextItem > item = createTextItem(Member::visibilityText(role.visibility) + " " + role.name,
                    trans, rot);
        newItems.append(item);
    }

    if (!role.multiplicity.isEmpty()) {
        int oldItemIndex = _role.name.isEmpty() ? 0 : 1;
        qreal trans = !_role.name.isEmpty() ? items[oldItemIndex]->translation() : defaultTranslation;
        qreal rot = !_role.name.isEmpty() ? items[oldItemIndex]->translation() : defaultMultiplicityRotation;
        QSharedPointer< RoleTextItem > item = createTextItem(role.multiplicity, trans, rot);

        newItems.append(item);
    }

    items.clear();
    items.append(newItems);

    intersectionPointsChanged();

    _role = role;
}
void TutorialStateCurveSelection::begin ()
{
  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveSelection::begin ()";

  m_title = createTitle ("Curve Selection");
  m_background = createPixmapItem (":/engauge/img/panel_curve_selection.png",
                                   QPoint (0, 30));
  m_text0 = createTextItem ("After the axis points have been created, a\n"
                            "curve is selected to receive curve points.\n"
                            "Step 1 - click on Curve, Point Match, Color\n"
                            "Picker or Segment Fill buttons.",
                            QPoint (250, 40));
  m_text1 = createTextItem ("Step 2 - Select the desired curve name. If\n"
                            "that curve name has not been created yet,\n"
                            "use the menu option Settings / Curve Names\n"
                            "to create it.",
                            QPoint (250, 120));
  m_text2 = createTextItem ("Step 3 - Change the background from the\n"
                            "original image to the filtered image\n"
                            "produced for the current curve, using the\n"
                            "menu option View / Background / Filtered\n"
                            "Image. This filtering enables the powerful\n"
                            "automated algorithms discussed later in\n"
                            "the tutorial.",
                            QPoint (250, 200));
  m_text3 = createTextItem ("If the current curve is no longer visible\n"
                            "in the filtered image, then change the\n"
                            "current Color Filter settings. In the figure,\n"
                            "the orange points have disappeared.",
                            QPoint (250, 330));

  QSize backgroundSize = context().tutorialDlg().backgroundSize();

  m_previous = new TutorialButton ("Previous",
                                   context().tutorialDlg().scene());
  m_previous->setGeometry (QPoint (buttonMargin (),
                                   backgroundSize.height() - buttonMargin() - m_previous->size().height()));
  connect (m_previous, SIGNAL (signalTriggered ()), this, SLOT (slotPrevious ()));

  m_colorFilter = new TutorialButton ("Color Filter Settings",
                                      context().tutorialDlg().scene());
  m_colorFilter->setGeometry (QPoint (backgroundSize.width () / 2.0 - m_colorFilter->size ().width () / 2,
                                      backgroundSize.height () - buttonMargin () - m_colorFilter->size ().height ()));
  connect (m_colorFilter, SIGNAL (signalTriggered ()), this, SLOT (slotColorFilter ()));

  m_next = new TutorialButton ("Next",
                               context().tutorialDlg().scene());
  m_next->setGeometry (QPoint (backgroundSize.width () - buttonMargin () - m_next->size ().width (),
                               backgroundSize.height () - buttonMargin () - m_next->size ().height ()));
  connect (m_next, SIGNAL (signalTriggered ()), this, SLOT (slotNext ()));
}
Пример #5
0
void DiveTemperatureItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
	int last = -300, last_printed_temp = 0, sec = 0, last_valid_temp = 0;
	// We don't have enougth data to calculate things, quit.
	if (!shouldCalculateStuff(topLeft, bottomRight))
		return;

	qDeleteAll(texts);
	texts.clear();
	// Ignore empty values. things do not look good with '0' as temperature in kelvin...
	QPolygonF poly;
	for (int i = 0, modelDataCount = dataModel->rowCount(); i < modelDataCount; i++) {
		int mkelvin = dataModel->index(i, vDataColumn).data().toInt();
		if (!mkelvin)
			continue;
		last_valid_temp = mkelvin;
		sec = dataModel->index(i, hDataColumn).data().toInt();
		QPointF point(hAxis->posAtValue(sec), vAxis->posAtValue(mkelvin));
		poly.append(point);

		/* don't print a temperature
		 * if it's been less than 5min and less than a 2K change OR
		 * if it's been less than 2min OR if the change from the
		 * last print is less than .4K (and therefore less than 1F) */
		if (((sec < last + 300) && (abs(mkelvin - last_printed_temp) < 2000)) ||
		    (sec < last + 120) ||
		    (abs(mkelvin - last_printed_temp) < 400))
			continue;
		last = sec;
		if (mkelvin > 200000)
			createTextItem(sec, mkelvin);
		last_printed_temp = mkelvin;
	}
	setPolygon(poly);

	/* it would be nice to print the end temperature, if it's
	* different or if the last temperature print has been more
	* than a quarter of the dive back */
	if (last_valid_temp > 200000 &&
	    ((abs(last_valid_temp - last_printed_temp) > 500) || ((double)last / (double)sec < 0.75))) {
		createTextItem(sec, last_valid_temp);
	}
	if (texts.count())
		texts.last()->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
}
Пример #6
0
void DiveHeartrateItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
	int last = -300, last_printed_hr = 0, sec = 0;
	struct {
		int sec;
		int hr;
	} hist[3] = {};

	// We don't have enougth data to calculate things, quit.
	if (!shouldCalculateStuff(topLeft, bottomRight))
		return;

	qDeleteAll(texts);
	texts.clear();
	// Ignore empty values. a heartrate of 0 would be a bad sign.
	QPolygonF poly;
	for (int i = 0, modelDataCount = dataModel->rowCount(); i < modelDataCount; i++) {
		int hr = dataModel->index(i, vDataColumn).data().toInt();
		if (!hr)
			continue;
		sec = dataModel->index(i, hDataColumn).data().toInt();
		QPointF point(hAxis->posAtValue(sec), vAxis->posAtValue(hr));
		poly.append(point);
		if (hr == hist[2].hr)
			// same as last one, no point in looking at printing
			continue;
		hist[0] = hist[1];
		hist[1] = hist[2];
		hist[2].sec = sec;
		hist[2].hr = hr;
		// don't print a HR
		// if it's not a local min / max
		// if it's been less than 5min and less than a 20 beats change OR
		// if it's been less than 2min OR if the change from the
		// last print is less than 10 beats
		// to test min / max requires three points, so we now look at the
		// previous one
		sec = hist[1].sec;
		hr = hist[1].hr;
		if ((hist[0].hr < hr && hr < hist[2].hr) ||
		    (hist[0].hr > hr && hr > hist[2].hr) ||
		    ((sec < last + 300) && (abs(hr - last_printed_hr) < 20)) ||
		    (sec < last + 120) ||
		    (abs(hr - last_printed_hr) < 10))
			continue;
		last = sec;
		createTextItem(sec, hr);
		last_printed_hr = hr;
	}
	setPolygon(poly);

	if (texts.count())
		texts.last()->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
}
void TutorialStateColorFilter::begin ()
{
  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateColorFilter::begin ()";

  m_title = createTitle (tr ("Color Filter"));
  m_background = createPixmapItem (":/engauge/img/panel_color_filter.png",
                                   QPoint (0, 30));
  m_text0 = createTextItem (tr ("Each curve has Color Filter settings that\n"
                                "are applied in Segment Fill mode. For\n"
                                "black lines the defaults work well, but for\n"
                                "colored lines the settings can be improved."),
                            QPoint (260, 30));
  m_text1 = createTextItem (tr ("Step 1 - Select the Settings / Color\n"
                                "Filter menu option."),
                            QPoint (285, 115));
  m_text2 = createTextItem (tr ("Step 2 - Select the curve that will\n"
                                "be given the new settings."),
                            QPoint (285, 165));
  m_text3 = createTextItem (tr ("Step 3 - Select the mode. Intensity is\n"
                                "suggested for uncolored lines, and Hue\n"
                                "is suggested for colored lines."),
                            QPoint (285, 210));
  m_text4 = createTextItem (tr ("Step 4 - Adjust the included range by\n"
                                "dragging the green handles, until the\n"
                                "curve is clear in the preview window\n"
                                "below. The graph shows a histogram\n"
                                "distribution of the values underneath.\n"
                                "Click Ok when finished."),
                            QPoint (285, 280));

  QSize backgroundSize = context().tutorialDlg().backgroundSize();

  m_back = new TutorialButton (tr ("Back"),
                               context().tutorialDlg().scene());
  m_back->setGeometry (QPoint (backgroundSize.width () / 2 - m_back->size().width () / 2,
                               backgroundSize.height() - buttonMargin() - m_back->size().height()));
  connect (m_back, SIGNAL (signalTriggered ()), this, SLOT (slotBack ()));
}
void TutorialStateAxisPoints::begin ()
{
  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateAxisPoints::begin ()";

  m_title = createTitle (tr ("Axis Points"));
  m_background = createPixmapItem (":/engauge/img/panel_axis_points.png",
                                   QPoint (0, 30));
  m_text0 = createTextItem (tr ("Axis points are first defined to\n"
                                "define the coordinates. Step 1 -\n"
                                "Click on the Axis Points button"),
                            QPoint (320, 60));
  m_text1 = createTextItem (tr ("Step 2 - Click on an axis or grid\n"
                                "line with known coordinates. An axis\n"
                                "point appears, with a dialog window\n"
                                "for entering the axis point's\n"
                                "coordinates"),
                            QPoint (300, 210));
  m_text2 = createTextItem (tr ("Step 3 - Enter the two coordinates\n"
                                "of the axis point and then click Ok.\n"
                                "Repeat steps 2 and 3 twice more\n"
                                "until three axis points are created"),
                            QPoint (280, 320));

  QSize backgroundSize = context().tutorialDlg().backgroundSize();

  m_previous = new TutorialButton (tr ("Previous"),
                                   context().tutorialDlg().scene());
  m_previous->setGeometry (QPoint (buttonMargin (),
                                   backgroundSize.height() - buttonMargin() - m_previous->size().height()));
  connect (m_previous, SIGNAL (signalTriggered ()), this, SLOT (slotPrevious ()));

  m_next = new TutorialButton (tr ("Next"),
                               context().tutorialDlg().scene());
  m_next->setGeometry (QPoint (backgroundSize.width () - buttonMargin () - m_next->size ().width (),
                               backgroundSize.height () - buttonMargin () - m_next->size ().height ()));
  connect (m_next, SIGNAL (signalTriggered ()), this, SLOT (slotNext ()));
}
Пример #9
0
void DiveMeanDepthItem::modelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
	double meandepthvalue = 0.0;
	// We don't have enougth data to calculate things, quit.
	if (!shouldCalculateStuff(topLeft, bottomRight))
		return;

	QPolygonF poly;
	plot_data *entry = dataModel->data().entry;
	for (int i = 0, modelDataCount = dataModel->rowCount(); i < modelDataCount; i++, entry++) {
		// Ignore empty values
		if (entry->running_sum == 0 || entry->sec == 0)
			continue;

		meandepthvalue = entry->running_sum / entry->sec;
		QPointF point(hAxis->posAtValue(entry->sec), vAxis->posAtValue(meandepthvalue));
		poly.append(point);
	}
	lastRunningSum = meandepthvalue;
	setPolygon(poly);
	createTextItem();
}
Пример #10
0
  void HttpResponseParser::parseNonMultipart(std::unique_ptr<std::istream>& aStream)
  {
    bool lStatusAndMesssageParsed = false;

    Item lItem;
    if (isTextualBody())
      lItem = createTextItem(aStream.release());
    else
      lItem = createBase64Item(*aStream.get());

    if (!lItem.isNull())
    {
      std::string empty;
      theHandler.any(lItem, empty);
    }

    if (!theInsideRead)
    {
      theHandler.beginResponse(theStatus, theMessage);
      lStatusAndMesssageParsed = true;
    }
    else
      theHandler.endBody();


  if (!theInsideRead)
  {
    if (!lStatusAndMesssageParsed)
      theHandler.beginResponse(theStatus, theMessage);

    for (std::vector<std::pair<std::string, std::string> >::iterator i = theHeaders.begin();
        i != theHeaders.end(); ++i) {
      theHandler.header(i->first, i->second);
    }
  }

  theHandler.endResponse();
  theHandler.end();
  }
	MenuTextItem* ContextMenu::createTextItem(int index)
	{
		return createTextItem("MenuTextItem",index);
	}
MonitorWidget::MonitorWidget(QWidget *parent) :
    QGraphicsView(parent), aspectRatioMode(Qt::KeepAspectRatio)
{
    setMinimumSize(180, 25);

    QGraphicsScene *scene = new QGraphicsScene();

    setScene(scene);

    setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);

    // no scroll bars
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    setBackgroundBrush(QBrush(Utils::StyleHelper::baseColor()));

    setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing);

    QSvgRenderer *renderer = new QSvgRenderer();

    if (renderer->load(QString(":/telemetry/images/tx-rx.svg"))) {
        // create graph
        graph = new QGraphicsSvgItem();
        graph->setSharedRenderer(renderer);
        graph->setElementId("background");

        graph->setFlags(QGraphicsItem::ItemClipsChildrenToShape | QGraphicsItem::ItemClipsToShape);

        scene->addItem(graph);

        int i;

        // create tx nodes
        i = 0;
        while (true) {
            QString id   = QString("tx%0").arg(i);
            QString bgId = QString("tx_bg%0").arg(i);
            if (!renderer->elementExists(id) || !renderer->elementExists(bgId)) {
                break;
            }
            QGraphicsSvgItem *item = createSvgItem(graph, bgId);
            item->setElementId(id);
            txNodes.append(item);
            i++;
        }

        // create rx nodes
        i = 0;
        while (true) {
            QString id   = QString("rx%0").arg(i);
            QString bgId = QString("rx_bg%0").arg(i);
            if (!renderer->elementExists(id) || !renderer->elementExists(bgId)) {
                break;
            }
            QGraphicsSvgItem *item = createSvgItem(graph, bgId);
            item->setElementId(id);
            rxNodes.append(item);
            i++;
        }

        if (renderer->elementExists("txSpeed")) {
            txSpeed = createTextItem(graph, "txSpeed", "Helvetica");
            txSpeed->setDefaultTextColor(Qt::white);
        } else {
            txSpeed = NULL;
        }

        if (renderer->elementExists("rxSpeed")) {
            rxSpeed = createTextItem(graph, "rxSpeed", "Helvetica");
            rxSpeed->setDefaultTextColor(Qt::white);
        } else {
            rxSpeed = NULL;
        }
        // scene->setSceneRect(graph->boundingRect());
    }

    connected = false;

    setMin(0.0);
    setMax(1200.0);

    telemetryUpdated(0.0, 0.0);
}
Пример #13
0
void DataSetView::viewportChanged()
{
	if(_viewportX != _viewportX || _viewportY != _viewportY || _viewportW != _viewportW || _viewportH != _viewportH ) //only possible if they are NaN
		return;

#ifdef DEBUG_VIEWPORT
	std::cout << "viewportChanged!\n" <<std::flush;
#endif
	QVector2D leftTop(_viewportX, _viewportY);
	QVector2D viewSize(_viewportW, _viewportH);
	QVector2D rightBottom(leftTop + viewSize);

	int currentViewportColMin = -1, currentViewportColMax = -1, currentViewportRowMin = -1, currentViewportRowMax = -1;

	float cumulative = 0;
	for(int col=0; col<_model->columnCount() && currentViewportColMax == -1; col++)
	{
		if(currentViewportColMax == -1 && cumulative > rightBottom.x())
			currentViewportColMax = col;

		cumulative += _dataColsMaxWidth[col];

		if(currentViewportColMin == -1 && cumulative > leftTop.x())
			currentViewportColMin = col;
	}

	if(currentViewportColMax == -1)
		currentViewportColMax = _model->columnCount();

	currentViewportColMin = std::max(0,						currentViewportColMin - _viewportMargin);
	currentViewportColMax = std::min(_model->columnCount(),	currentViewportColMax + _viewportMargin);

	currentViewportRowMin = std::max(qRound(leftTop.y()		/ _dataRowsMaxHeight) - 1,	0);
	currentViewportRowMax = std::min(qRound(rightBottom.y()	/ _dataRowsMaxHeight) + 1,	_model->rowCount());

	// remove superflouous textItems if they exist (aka store them in stack)
	if(_previousViewportRowMin != -1 && _previousViewportRowMax != -1 && _previousViewportColMin != -1 && _previousViewportColMax != -1)
	{
		for(int col=_previousViewportColMin; col<_previousViewportColMax; col++)
		{
			for(int row=_previousViewportRowMin; row < currentViewportRowMin; row++)
				storeTextItem(row, col);

			for(int row=currentViewportRowMax; row < _previousViewportRowMax; row++)
				storeTextItem(row, col);
		}

		for(int row=_previousViewportRowMin; row<_previousViewportRowMax; row++)
		{
			for(int col=_previousViewportColMin; col < currentViewportColMin; col++)
				storeTextItem(row, col);

			for(int col=currentViewportColMax; col < _previousViewportColMax; col++)
				storeTextItem(row, col);
		}

		for(int row=_previousViewportRowMin; row < currentViewportRowMin; row++)
			storeRowNumber(row);

		for(int row=currentViewportRowMax; row < _previousViewportRowMax; row++)
			storeRowNumber(row);
	}

	_lines.clear();

	//and now we should create some new ones!

	for(int col=currentViewportColMin; col<currentViewportColMax; col++)
		for(int row=currentViewportRowMin; row<currentViewportRowMax; row++)
		{
			QVector2D pos0(_colXPositions[col],					_dataRowsMaxHeight + row * _dataRowsMaxHeight);
			QVector2D pos1(pos0.x() + _dataColsMaxWidth[col],	pos0.y()+ _dataRowsMaxHeight);

			int lineFlags = _model->data(_model->index(row, col), _roleNameToRole["lines"]).toInt();

			bool	left	= (lineFlags & 1 > 0)	&& pos0.x()  > _rowNumberMaxWidth + _viewportX,
					right	= (lineFlags & 2 > 0)	&& pos1.x()  > _rowNumberMaxWidth + _viewportX,
					up		= lineFlags & 4 > 0		&& pos0.y()  > _dataRowsMaxHeight + _viewportY,
					down	= lineFlags & 8 > 0		&& pos1.y()  > _dataRowsMaxHeight + _viewportY;

			createTextItem(row, col);


			if(left)	_lines.push_back(std::make_pair(QVector2D(pos0.x(),	pos1.y()),	pos0));
			if(up)		_lines.push_back(std::make_pair(QVector2D(pos1.x(),	pos0.y()),	pos0));
			if(right)	_lines.push_back(std::make_pair(QVector2D(pos1.x(),	pos0.y()),	pos1));
			if(down)	_lines.push_back(std::make_pair(QVector2D(pos0.x(),	pos1.y()),	pos1));

		}

	_lines.push_back(std::make_pair(QVector2D(_viewportX,						_viewportY),						QVector2D(_viewportX,						_viewportY + _viewportH)));
	_lines.push_back(std::make_pair(QVector2D(_viewportX + _rowNumberMaxWidth,	_viewportY),						QVector2D(_viewportX + _rowNumberMaxWidth,	_viewportY + _viewportH)));

	_lines.push_back(std::make_pair(QVector2D(_viewportX,						_viewportY),						QVector2D(_viewportX + _viewportW,			_viewportY)));
	_lines.push_back(std::make_pair(QVector2D(_viewportX,						_viewportY + _dataRowsMaxHeight),	QVector2D(_viewportX + _viewportW,			_viewportY + _dataRowsMaxHeight)));


	for(int row=currentViewportRowMin; row<currentViewportRowMax; row++)
	{
		createRowNumber(row);

		QVector2D pos0(_viewportX,						(1 + row) * _dataRowsMaxHeight);
		QVector2D pos1(_viewportX + _rowNumberMaxWidth, (2 + row) * _dataRowsMaxHeight);

		if(pos0.y() > _dataRowsMaxHeight + _viewportY)
			_lines.push_back(std::make_pair(QVector2D(pos0.x(), pos0.y()), QVector2D(pos1.x(), pos0.y())));


		if(row == _model->rowCount() - 1 && pos1.y() > _dataRowsMaxHeight + _viewportY)
			_lines.push_back(std::make_pair(QVector2D(pos0.x(), pos1.y()), QVector2D(pos1.x(), pos1.y())));
	}

	for(int col=currentViewportColMin; col<currentViewportColMax; col++)
	{

		createColumnHeader(col);

		QVector2D pos0(_colXPositions[col],					_viewportY);
		QVector2D pos1(pos0.x() + _dataColsMaxWidth[col],	pos0.y() + _dataRowsMaxHeight);

		if(pos0.x()  > _rowNumberMaxWidth + _viewportX)
			_lines.push_back(std::make_pair(QVector2D(pos0.x(), pos0.y()), QVector2D(pos0.x(), pos1.y())));


		if(col == _model->columnCount() - 1 && pos1.x()  > _rowNumberMaxWidth + _viewportX)
			_lines.push_back(std::make_pair(QVector2D(pos1.x(), pos0.y()), QVector2D(pos1.x(), pos1.y())));
	}


	createleftTopCorner();


	update();

#ifdef DEBUG_VIEWPORT
	std::cout << "viewport X: " << _viewportX << " Y: " << _viewportY << " W: " << _viewportW << " H: " << _viewportH <<  std::endl << std::flush;
	std::cout << "_previousViewport ColMin: "<<_previousViewportColMin<<" ColMax: "<<_previousViewportColMax<<" RowMin: "<<_previousViewportRowMin<<" RowMax: "<<_previousViewportRowMax<<"\n";
	std::cout << "currentViewport ColMin: "<<currentViewportColMin<<" ColMax: "<<currentViewportColMax<<" RowMin: "<<currentViewportRowMin<<" RowMax: "<<currentViewportRowMax<<"\n"<<std::flush;
#endif

	_previousViewportColMin = currentViewportColMin;
	_previousViewportColMax = currentViewportColMax;
	_previousViewportRowMin = currentViewportRowMin;
	_previousViewportRowMax = currentViewportRowMax;
}