tess 1.0.0
Performance-first tile and path simulation substrate
Loading...
Searching...
No Matches
io.h
1#pragma once
2
3#include <tess/core/shape.h>
4#include <tess/path/path.h>
5
6#include <ostream>
7
8namespace tess {
9
11inline auto operator<<(std::ostream& output, Coord2 value) -> std::ostream& {
12 return output << "Coord2{" << value.x << ", " << value.y << '}';
13}
14
16inline auto operator<<(std::ostream& output, Coord3 value) -> std::ostream& {
17 return output << "Coord3{" << value.x << ", " << value.y << ", " << value.z
18 << '}';
19}
20
22inline auto operator<<(std::ostream& output, Extent3 value) -> std::ostream& {
23 return output << "Extent3{" << value.x << ", " << value.y << ", " << value.z
24 << '}';
25}
26
28inline auto operator<<(std::ostream& output, PathStatus status)
29 -> std::ostream& {
30 switch (status) {
31 case PathStatus::NotComputed:
32 return output << "NotComputed";
33 case PathStatus::Found:
34 return output << "Found";
35 case PathStatus::InvalidStart:
36 return output << "InvalidStart";
37 case PathStatus::InvalidGoal:
38 return output << "InvalidGoal";
39 case PathStatus::NoPath:
40 return output << "NoPath";
41 case PathStatus::Indeterminate:
42 return output << "Indeterminate";
43 case PathStatus::CostOverflow:
44 return output << "CostOverflow";
45 case PathStatus::NoCandidate:
46 return output << "NoCandidate";
47 }
48 return output << "PathStatus(" << static_cast<unsigned>(status) << ')';
49}
50
58inline auto operator<<(std::ostream& output, PathView path) -> std::ostream& {
59 output << '[';
60 auto first = true;
61 for (const auto coordinate : path) {
62 if (!first) {
63 output << ", ";
64 }
65 output << coordinate;
66 first = false;
67 }
68 return output << ']';
69}
70
71} // namespace tess
Definition path_view.h:21
Definition shape.h:26
Definition shape.h:46
Definition shape.h:14