当前位置: 首页>>代码示例>>C++>>正文


C++ Segment::appendColumn方法代码示例

本文整理汇总了C++中Segment::appendColumn方法的典型用法代码示例。如果您正苦于以下问题:C++ Segment::appendColumn方法的具体用法?C++ Segment::appendColumn怎么用?C++ Segment::appendColumn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Segment的用法示例。


在下文中一共展示了Segment::appendColumn方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: finishRun

void SegmentFactory::finishRun(bool *lastBool,
                               bool *nextBool,
                               SegmentVector &lastSegment,
                               SegmentVector &currSegment,
                               int x,
                               int yStart,
                               int yStop,
                               int height,
                               const DocumentModelSegments &modelSegments,
                               int* madeLines)
{
  LOG4CPP_DEBUG_S ((*mainCat)) << "SegmentFactory::finishRun"
                               << " column=" << x
                               << " rows=" << yStart << "-" << yStop
                               << " runsOnLeft=" << adjacentRuns (nextBool, yStart, yStop, height)
                               << " runsOnRight=" << adjacentSegments (lastSegment, yStart, yStop, height);

  // When looking at adjacent columns, include pixels that touch diagonally since
  // those may also diagonally touch nearby runs in the same column (which would indicate
  // a branch)

  // Count runs that touch on the left
  if (adjacentRuns(lastBool, yStart, yStop, height) > 1) {
    return;
  }

  // Count runs that touch on the right
  if (adjacentRuns(nextBool, yStart, yStop, height) > 1) {
    return;
  }

  Segment *seg;
  if (adjacentSegments(lastSegment, yStart, yStop, height) == 0) {

    // This is the start of a new segment
    seg = new Segment(m_scene,
                      (int) (0.5 + (yStart + yStop) / 2.0),
                      m_isGnuplot);
    ENGAUGE_CHECK_PTR (seg);

  } else {

    // This is the continuation of an existing segment
    seg = adjacentSegment(lastSegment, yStart, yStop, height);

    ++(*madeLines);
    ENGAUGE_CHECK_PTR(seg);
    seg->appendColumn(x, (int) (0.5 + (yStart + yStop) / 2.0), modelSegments);
  }

  for (int y = yStart; y <= yStop; y++) {

    ENGAUGE_ASSERT (y < height);
    currSegment [y] = seg;
  }
}
开发者ID:keszybz,项目名称:engauge6,代码行数:56,代码来源:SegmentFactory.cpp

示例2: finishRun

void Segments::finishRun(bool* lastBool, bool* nextBool,
                         Segment** lastSegment, Segment** currSegment,
                         int x, int yStart, int yStop, int height, SegmentSettings set, int* madeLines)
{
    // when looking at adjacent columns, include pixels that touch diagonally since
    // those may also diagonally touch nearby runs in the same column (which would indicate
    // a branch)
    DigitDebug::scanning(QString("column ") + QString::number(x) +
                         QString(", rows ") + QString::number(yStart) + QString(" to ") + QString::number(yStop) +
                         QString(", runs on left ") + QString::number(adjacentRuns(nextBool, yStart, yStop, height)) +
                         QString(", runs on right ") + QString::number(adjacentSegments(lastSegment, yStart, yStop, height)));

    // count runs that touch on the left
    if (adjacentRuns(lastBool, yStart, yStop, height) > 1)
        return;
    // count runs that touch on the right
    if (adjacentRuns(nextBool, yStart, yStop, height) > 1)
        return;

    Segment* seg;
    if (adjacentSegments(lastSegment, yStart, yStop, height) == 0)
    {
        // this is the start of a new segment
        seg = new Segment(canvas, (int) (0.5 + (yStart + yStop) / 2.0));
        CHECK_PTR_ENGAUGE(seg);

        segments.append(seg);
    }
    else
    {
        // this is the continuation of an existing segment
        seg = adjacentSegment(lastSegment, yStart, yStop, height);

        ++(*madeLines);
        ASSERT_ENGAUGE(seg != 0);
        seg->appendColumn(x, (int) (0.5 + (yStart + yStop) / 2.0), set);
    }

    for (int y = yStart; y <= yStop; y++)
        currSegment [y] = seg;
}
开发者ID:crayxt,项目名称:digitizer,代码行数:41,代码来源:segments.cpp


注:本文中的Segment::appendColumn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。