QString WindowModelBase::selectionAsHtml () const
{
  ENGAUGE_CHECK_PTR (m_view);

  int rowLow, colLow, rowHigh, colHigh;
  QVector<QString> table;

  // Get raw data as a rectangular table. Size may be zero
  selectionAsTable (rowLow,
                    colLow,
                    rowHigh,
                    colHigh,
                    table);

  // Concatenate table into output string
  QString html;
  QTextStream str (&html);

  str << "<table>";
  for (int row = rowLow; row <= rowHigh; row++) {
    str << "<tr>";
    for (int col = colLow; col <= colHigh; col++) {
      str << "<td>" << table [fold2dIndexes (row, col, rowLow, colLow, colHigh)] << "</td>";
    }
    str << "<tr>\n";
  }
  str << "</table>";

  return html;
}
QString WindowModelBase::selectionAsText (ExportDelimiter delimiter) const
{
  const bool NOT_GNUPLOT = false;

  ENGAUGE_CHECK_PTR (m_view);

  int rowLow, colLow, rowHigh, colHigh;
  QVector<QString> table;

  // Get raw data as a rectangular table. Size may be zero
  selectionAsTable (rowLow,
                    colLow,
                    rowHigh,
                    colHigh,
                    table);

  // Concatenate table into output string
  QString text;
  QTextStream str (&text);
  for (int row = rowLow; row <= rowHigh; row++) {
    QString delimiterStr;
    for (int col = colLow; col <= colHigh; col++) {
      str << delimiterStr << table [fold2dIndexes (row, col, rowLow, colLow, colHigh)];
      delimiterStr = exportDelimiterToText (delimiter,
                                            NOT_GNUPLOT);
    }
    str << "\n";
  }

  return text;
}
QImage DlgImportCroppingNonPdf::image () const
{
  // If the entire page was to be returned, then this method would simply return m_image. However, only the framed
  // portion is to be returned
  ENGAUGE_CHECK_PTR (m_nonPdfCropping);
  QRectF rectFramePixels = m_nonPdfCropping->frameRect ();

  return m_image.copy (rectFramePixels.toRect ());
}
void ChecklistGuide::update (const CmdMediator &cmdMediator,
                             bool documentIsExported)
{
  LOG4CPP_INFO_S ((*mainCat)) << "ChecklistGuide::update";

  ENGAUGE_CHECK_PTR (m_browser);

  m_browser->update (cmdMediator,
                     documentIsExported);
}
void DigitizeStatePointMatch::end ()
{
  LOG4CPP_INFO_S ((*mainCat)) << "DigitizeStatePointMatch::end";

  // Remove candidate point which may or may not exist at this point
  context().mainWindow().scene().removeTemporaryPointIfExists();

  // Remove outline before leaving state
  ENGAUGE_CHECK_PTR (m_outline);
  context().mainWindow().scene().removeItem (m_outline);
  m_outline = nullptr;
}
void BackgroundStateAbstractBase::setProcessedPixmap (const QPixmap &pixmap)
{
  LOG4CPP_INFO_S ((*mainCat)) << "BackgroundStateAbstractBase::setProcessedPixmap"
                              << " map=(" << pixmap.width() << "x" << pixmap.height() << ")";

  ENGAUGE_CHECK_PTR(m_imageItem);

  m_imageItem->setPixmap (pixmap);

  // Reset scene rectangle or else small image after large image will be off-center
  m_scene.setSceneRect (m_imageItem->boundingRect ());

  m_image = pixmap.toImage();
}
Esempio n. 7
0
QGraphicsView &TutorialDlg::view ()
{
  ENGAUGE_CHECK_PTR (m_view);

  return *m_view;
}
Esempio n. 8
0
QGraphicsScene &TutorialDlg::scene ()
{
  ENGAUGE_CHECK_PTR (m_scene);

  return *m_scene;
}
Esempio n. 9
0
void CoordSystem::iterateThroughCurvesPointsGraphs (const Functor2wRet<const QString &, const Point &, CallbackSearchReturn> &ftorWithCallback) const
{
  ENGAUGE_CHECK_PTR (m_curveAxes);

  m_curvesGraphs.iterateThroughCurvesPoints (ftorWithCallback);
}
Esempio n. 10
0
const Curve &CoordSystem::curveAxes () const
{
  ENGAUGE_CHECK_PTR (m_curveAxes);

  return *m_curveAxes;
}