1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
#pragma once
#include <filesystem>
#include <string.h>
#include <string>
#include <string_view>
#include <unordered_set>
/// node shapes
extern const std::unordered_set<std::string_view> all_node_shapes;
extern const std::unordered_set<std::string_view>
node_shapes_consisting_of_ellipse;
extern const std::unordered_set<std::string_view>
node_shapes_consisting_of_ellipse_and_polyline;
extern const std::unordered_set<std::string_view>
node_shapes_consisting_of_path;
extern const std::unordered_set<std::string_view>
node_shapes_consisting_of_polygon;
extern const std::unordered_set<std::string_view>
node_shapes_consisting_of_polygon_and_polyline;
extern const std::unordered_set<std::string_view> node_shapes_without_svg_shape;
bool contains_ellipse_shape(std::string_view shape);
bool contains_multiple_shapes_with_different_fill(std::string_view shape);
bool contains_polygon_shape(std::string_view shape);
bool contains_polyline_shape(std::string_view shape);
bool is_polygon_shape(std::string_view shape);
/// arrow shapes
extern const std::unordered_set<std::string_view>
primitive_polygon_arrow_shapes;
extern const std::unordered_set<std::string_view>
primitive_polygon_and_polyline_arrow_shapes;
extern const std::unordered_set<std::string_view> all_primitive_arrow_shapes;
extern const std::unordered_set<std::string_view>
primitive_arrow_shapes_without_closed_svg_shape;
/// arrow shape modifiers
extern const std::unordered_set<std::string_view> all_arrow_shape_modifiers;
/// rank directions
extern const std::unordered_set<std::string_view> all_rank_directions;
/// edge directions
extern const std::unordered_set<std::string_view> all_edge_directions;
/// misc utilities
/// get the base name of the test case file without file extension
#define AUTO_NAME() std::filesystem::path(__FILE__).stem().string()
void write_to_file(const std::filesystem::path &directory,
const std::filesystem::path &filename,
std::string_view text);
|