another version of tracing across buses
This commit is contained in:
@@ -27,7 +27,7 @@ class QAD_EXPORT BlockViewWavetrace {
|
||||
public:
|
||||
BlockViewWavetrace(int width = 1, int height = 1);
|
||||
|
||||
enum CellState {Empty = -1, Blocked = -2, Jump = -3};
|
||||
enum CellState {Empty = -1, Blocked = -2, HorizontalBus = -3, VerticalBus = -4};
|
||||
enum Direction {NoTrace, Horizontal, Vertical};
|
||||
|
||||
int width() const {return wid;}
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
void resize(const QSize & sz) {resize(sz.width(), sz.height());}
|
||||
void fill(short val = -1);
|
||||
void fill(const QRect & rect, short val = -1);
|
||||
void fill(const QPoint & point, short val = -1) {field[point.x()][point.y()] = val;}
|
||||
void fill(const QPoint & point, short val = -1) {fill(point.x(), point.y(), val);}
|
||||
void fill(int px, int py, short val);
|
||||
void fill(BlockViewWavetrace::CellState val = Empty) {fill((short)val);}
|
||||
void fill(const QRect & rect, BlockViewWavetrace::CellState val = Empty) {fill(rect, (short)val);}
|
||||
@@ -52,9 +52,15 @@ public:
|
||||
const QVector<QPoint> & path() const;
|
||||
|
||||
private:
|
||||
struct Cell {
|
||||
Cell(short v = Empty): value(v), direction(0) {}
|
||||
short value;
|
||||
short direction;
|
||||
};
|
||||
|
||||
int wid, hei, max_steps;
|
||||
Direction dir_;
|
||||
QVector<QVector<short> > field;
|
||||
QVector<QVector<Cell> > field;
|
||||
QVector<QPoint> path_;
|
||||
QVector<QPoint> jumps;
|
||||
QPoint dps[4], st, fn;
|
||||
|
||||
Reference in New Issue
Block a user