11#include <QApplication>
12#include <QGraphicsScene>
14#include <QProgressDialog>
24 m_isGnuplot (isGnuplot)
29int SegmentFactory::adjacentRuns(
bool *
columnBool,
37 if ((0 <= y) && (y <
height)) {
56 if ((0 <= y) && (y <
height)) {
73 int adjacentSegments = 0;
77 if ((0 <= y) && (y <
height)) {
90 return adjacentSegments;
99 QList<Segment*>::iterator
itr;
110void SegmentFactory::finishRun(
bool *
lastBool,
167void SegmentFactory::loadBool (
const ColorFilter &filter,
172 for (
int y = 0; y < image.height(); y++) {
184 for (
int y = 0; y <
height; y++) {
213 int width = imageFiltered.width();
214 int height = imageFiltered.height();
235 loadBool(filter,
lastBool, imageFiltered, -1);
236 loadBool(filter,
currBool, imageFiltered, 0);
237 loadBool(filter,
nextBool, imageFiltered, 1);
240 for (
int x = 0; x < width; x++) {
246 qApp->processEvents();
248 if (
dlg->wasCanceled()) {
255 matchRunsToSegments(x,
272 loadBool(filter,
nextBool, imageFiltered, x + 1);
279 dlg->setValue(width);
295void SegmentFactory::matchRunsToSegments(
int x,
313 for (
int y = 0; y <
height; y++) {
422void SegmentFactory::scrollBool(
bool *
left,
426 for (
int y = 0; y <
height; y++) {
435 for (
int y = 0; y <
height; y++) {
436 left [
static_cast<unsigned long> (y)] =
right [
static_cast<unsigned long> (y)];
444 QList<Segment*>::iterator
itr;
const int INNER_RADIUS_MIN
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) define ENGAUGE...
#define ENGAUGE_CHECK_PTR(ptr)
#endif
log4cpp::Category * mainCat
std::vector< Segment * > SegmentVector
Class for filtering image to remove unimportant information.
bool pixelFilteredIsOn(const QImage &image, int x, int y) const
Return true if specified filtered pixel is on.
Model for DlgSettingsSegments and CmdSettingsSegments.
double minLength() const
Get method for min length.
double pointSeparation() const
Get method for point separation.
QList< QPoint > fillPoints(const DocumentModelSegments &modelSegments, QList< Segment * > segments)
Return segment fill points for all segments, for previewing.
void clearSegments(QList< Segment * > &segments)
Remove the segments created by makeSegments.
SegmentFactory(QGraphicsScene &scene, bool isGnuplot)
Single constructor.
void makeSegments(const QImage &imageFiltered, const DocumentModelSegments &modelSegments, QList< Segment * > &segments, bool useDlg=true)
Main entry point for creating all Segments for the filtered image.
Selectable piecewise-defined line that follows a filtered line in the image.
int lineCount() const
Get method for number of lines.
QList< QPoint > fillPoints(const DocumentModelSegments &modelSegments)
Create evenly spaced points along the segment.
#define LOG4CPP_INFO_S(logger)
#define LOG4CPP_DEBUG_S(logger)