Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
generate_spanning_tree_picture.H
Go to the documentation of this file.
1
2/*
3 Aleph_w
4
5 Data structures & Algorithms
6 version 2.0.0b
7 https://github.com/lrleon/Aleph-w
8
9 This file is part of Aleph-w library
10
11 Copyright (c) 2002-2026 Leandro Rabindranath Leon
12
13 Permission is hereby granted, free of charge, to any person obtaining a copy
14 of this software and associated documentation files (the "Software"), to deal
15 in the Software without restriction, including without limitation the rights
16 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 copies of the Software, and to permit persons to whom the Software is
18 furnished to do so, subject to the following conditions:
19
20 The above copyright notice and this permission notice shall be included in all
21 copies or substantial portions of the Software.
22
23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29 SOFTWARE.
30*/
31
32
62#ifndef GENERATE_SPANNING_TREE_PICTURE_H
63#define GENERATE_SPANNING_TREE_PICTURE_H
64
65#include <generate_graph.H>
66
74template <typename GT>
76{
77 std::string operator () (typename GT::Node * p) const
78 {
79 return NODE_COOKIE(p) == nullptr ? "" : "SHADOW-NODE";
80 }
81};
82
92template <typename GT>
94{
95 std::string operator () (typename GT::Arc * a) const
96 {
97 return ARC_COOKIE(a) == nullptr ? "ARC" : "SHADOW-ARC";
98 }
99};
100
121template <typename GT, class Write_Node, class Write_Arc, class SA>
123 const size_t & nodes_by_level,
124 const double & xdist,
125 const double & ydist,
126 std::ofstream & output)
127{
131}
132
135template <typename GT, class Write_Node, class Write_Arc>
137 const size_t & nodes_by_level,
138 const double & xdist,
139 const double & ydist,
140 std::ofstream & output)
141{
142 using DSA = Dft_Show_Arc<GT>;
145}
146
167template <typename GT, class Write_Node, class Write_Arc, class SA>
169 const size_t & nodes_by_level,
170 const double & xdist,
171 const double & ydist,
172 std::ofstream & output)
173{
177}
178
181template <typename GT, class Write_Node, class Write_Arc>
183 const size_t & nodes_by_level,
184 const double & xdist,
185 const double & ydist,
186 std::ofstream & output)
187{
188 using DSA = Dft_Show_Arc<GT>;
191}
192
193#endif // GENERATE_SPANNING_TREE_PICTURE_H
List_Graph< Graph_Node< int >, Graph_Arc< int > > GT
Graph visualization and output generation utilities.
void generate_net_spanning_tree(GT &g, const size_t &nodes_by_level, const double &xdist, const double &ydist, std::ofstream &output)
Generate a net-layout visualization of a spanning tree.
#define ARC_COOKIE(p)
Return the arc cookie
void generate_cross_spanning_tree(GT &g, const size_t &nodes_by_level, const double &xdist, const double &ydist, std::ofstream &output)
Generate a cross-layout visualization of a spanning tree.
#define NODE_COOKIE(p)
Return the node cookie
void generate_cross_graph(GT &g, const size_t &nodes_by_level, const double &xdist, const double &ydist, std::ostream &out)
Generate a cross-graph layout specification for graphpic.
void generate_net_graph(GT &g, const size_t &nodes_by_level, const double &xdist, const double &ydist, std::ostream &out)
Generate a net-graph layout specification for graphpic.
DynList< T > maps(const C &c, Op op)
Classic map operation.
Default filter for filtered iterators on arcs.
Definition tpl_graph.H:1000
Arc of graph implemented with double-linked adjacency lists.
Definition tpl_graph.H:222
Shading functor for spanning tree arcs.
std::string operator()(typename GT::Arc *a) const
Shading functor for spanning tree nodes.
std::string operator()(typename GT::Node *p) const
Writer that outputs only the node key.
ofstream output
Definition writeHeap.C:213