20 #ifndef ESSENTIA_UTILS_ASCIIDAG_H
21 #define ESSENTIA_UTILS_ASCIIDAG_H
43 return x == other.
x &&
y == other.
y;
48 return out <<
'<' << pos.
x <<
',' << pos.
y <<
'>';
68 std::vector<std::string>
makeRectangle(
const char*
const* network,
int size);
79 template <
typename NetworkType>
86 int height()
const {
return (
int)size(); }
100 const std::string&
at(
int i)
const {
return std::vector<std::string>::at(i); }
101 std::string&
at(
int i) {
return std::vector<std::string>::at(i); }
109 for (
int i=0; i<canvas.
height(); i++) out << canvas.
at(i) <<
'\n';
131 AsciiBox(
const std::vector<std::string>& network,
int x,
int y);
141 static bool isBox(
const std::vector<std::string>& network,
int x,
int y);
148 static std::vector<AsciiBox>
findBoxes(
const std::vector<std::string>& network);
Definition: asciidag.h:121
int width
Definition: asciidag.h:124
static bool isBox(const std::vector< std::string > &network, int x, int y)
int posY
Definition: asciidag.h:123
bool borderContains(int x, int y) const
int posX
Definition: asciidag.h:123
std::string title
Definition: asciidag.h:125
int height
Definition: asciidag.h:124
static std::vector< AsciiBox > findBoxes(const std::vector< std::string > &network)
AsciiBox(const std::vector< std::string > &network, int x, int y)
Definition: asciidag.h:76
std::string & at(int i)
Definition: asciidag.h:101
AsciiCanvas & operator=(const std::vector< std::string > &other)
AsciiCanvas(const NetworkType &network)
Definition: asciidag.h:80
char & at(const Position &pos)
Definition: asciidag.h:104
int height() const
Definition: asciidag.h:86
int width() const
Definition: asciidag.h:87
const std::string & at(int i) const
Definition: asciidag.h:100
char at(const Position &pos) const
Definition: asciidag.h:103
Definition: asciidag.h:32
int y
Definition: asciidag.h:34
Position(int x_, int y_)
Definition: asciidag.h:36
int x
Definition: asciidag.h:34
bool operator==(const Position &other) const
Definition: asciidag.h:42
Position operator+(const Position &other) const
Definition: asciidag.h:38
#define ARRAY_SIZE(arr)
Definition: essentiautil.h:36
Definition: algorithm.h:28
std::vector< std::string > makeRectangle(const std::string &network)
std::ostream & operator<<(std::ostream &out, const Parameter &p)
Position Direction
Definition: asciidag.h:52