code format
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
QAD - Qt ADvanced
|
||||
QAD - Qt ADvanced
|
||||
|
||||
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
||||
Ivan Pelipenko peri4ko@yandex.ru, Andrey Bychkov work.a.b@yandex.ru
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef BLOCKVIEWWAVETRACE_H
|
||||
@@ -27,28 +27,37 @@
|
||||
class QAD_BLOCKVIEW_EXPORT BlockViewWavetrace {
|
||||
public:
|
||||
BlockViewWavetrace(int width = 1, int height = 1);
|
||||
|
||||
enum CellState {Empty = -1, Blocked = -2, HorizontalBus = -3, VerticalBus = -4};
|
||||
enum Direction {NoTrace, Horizontal, Vertical};
|
||||
|
||||
int width() const {return wid;}
|
||||
int height() const {return hei;}
|
||||
|
||||
enum CellState {
|
||||
Empty = -1,
|
||||
Blocked = -2,
|
||||
HorizontalBus = -3,
|
||||
VerticalBus = -4
|
||||
};
|
||||
enum Direction {
|
||||
NoTrace,
|
||||
Horizontal,
|
||||
Vertical
|
||||
};
|
||||
|
||||
int width() const { return wid; }
|
||||
int height() const { return hei; }
|
||||
void resize(int width, int height);
|
||||
void resize(const QSize & sz) {resize(sz.width(), sz.height());}
|
||||
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) {fill(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);}
|
||||
void fill(const QPoint & point, BlockViewWavetrace::CellState val = Empty) {fill(point, (short)val);}
|
||||
void fill(int px, int py, BlockViewWavetrace::CellState val = Empty) {fill(px, py, (short)val);}
|
||||
void clear() {fill(-1);}
|
||||
void fill(BlockViewWavetrace::CellState val = Empty) { fill((short)val); }
|
||||
void fill(const QRect & rect, BlockViewWavetrace::CellState val = Empty) { fill(rect, (short)val); }
|
||||
void fill(const QPoint & point, BlockViewWavetrace::CellState val = Empty) { fill(point, (short)val); }
|
||||
void fill(int px, int py, BlockViewWavetrace::CellState val = Empty) { fill(px, py, (short)val); }
|
||||
void clear() { fill(-1); }
|
||||
bool trace(const QPoint & start, const QPoint & finish);
|
||||
Direction preferredDirection() const {return dir_;}
|
||||
Direction preferredDirection() const { return dir_; }
|
||||
void setPreferredDirection(Direction dir);
|
||||
void setMaximumSteps(int steps) {max_steps = steps;}
|
||||
int maximumSteps() const {return max_steps;}
|
||||
void setMaximumSteps(int steps) { max_steps = steps; }
|
||||
int maximumSteps() const { return max_steps; }
|
||||
void gatherPath();
|
||||
const QVector<QPoint> & path() const;
|
||||
|
||||
@@ -61,11 +70,10 @@ private:
|
||||
|
||||
int wid, hei, max_steps;
|
||||
Direction dir_;
|
||||
QVector<QVector<Cell> > field;
|
||||
QVector<QVector<Cell>> field;
|
||||
QVector<QPoint> path_;
|
||||
QVector<QPoint> jumps;
|
||||
QPoint dps[4], st, fn;
|
||||
|
||||
};
|
||||
|
||||
#endif // BLOCKVIEWWAVETRACE_H
|
||||
|
||||
Reference in New Issue
Block a user