39#define COLOR_SCHEME_NODE_CLASS 1
46#ifdef COLOR_SCHEME_NODE_TYPE
47static const char *deg_debug_colors[] = {
79#ifdef COLOR_SCHEME_NODE_TYPE
80static const int deg_debug_node_type_color_map[][2] = {
101#ifdef COLOR_SCHEME_NODE_CLASS
103 switch (node->
type) {
131#ifdef COLOR_SCHEME_NODE_TYPE
132 const int (*pair)[2];
133 for (pair = deg_debug_node_type_color_map; (*pair)[0] >= 0; pair++) {
134 if ((*pair)[0] == node->
type) {
151 std::stringstream &ss)
155 ss <<
"<TD>" <<
name <<
"</TD>";
156 ss <<
"<TD BGCOLOR=\"" <<
color <<
"\"></TD>";
167 std::stringstream ss;
169 ss << R
"(<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">)";
170 ss << "<TR><TD COLSPAN=\"2\"><B>Legend</B></TD></TR>";
172#ifdef COLOR_SCHEME_NODE_CLASS
181#ifdef COLOR_SCHEME_NODE_TYPE
182 const int (*pair)[2];
183 for (pair = deg_debug_node_type_color_map; (*pair)[0] >= 0; pair++) {
200 const char *color_default =
"black";
201 const char *color_modified =
"orangered4";
202 const char *color_update =
"dodgerblue3";
203 const char *
color = color_default;
208 color = color_modified;
211 color = color_update;
222 float penwidth_default = 1.0f;
223 float penwidth_modified = 4.0f;
224 float penwidth_update = 4.0f;
225 float penwidth = penwidth_default;
230 penwidth = penwidth_modified;
233 penwidth = penwidth_update;
237 dot_attributes.
set(
"penwidth", penwidth);
243 const char *defaultcolor =
"gainsboro";
245 const char *fillcolor = color_index < 0 ?
248 dot_attributes.
set(
"fillcolor", fillcolor);
253 const char *color_default =
"black";
254 const char *color_cyclic =
"red4";
255 const char *color_godmode =
"blue4";
256 const char *
color = color_default;
258 color = color_cyclic;
261 color = color_godmode;
268 const char *style_default =
"solid";
269 const char *style_no_flush =
"dashed";
270 const char *style_flush_user_only =
"dotted";
271 const char *style = style_default;
273 style = style_no_flush;
276 style = style_flush_user_only;
284 const char *shape_default =
"normal";
285 const char *shape_no_cow =
"box";
286 const char *shape = shape_default;
297 shape = shape_no_cow;
312 base_style =
"striped";
318 dot_attributes.
set(
"style", base_style);
321 dot_attributes.
set(
"style", base_style);
324 dot_attributes.
set(
"style", base_style +
",rounded");
378 switch (node->
type) {
386 ctx, node, parent_cluster);
426 ctx, node, parent_cluster);
446 float penwidth = 2.0f;
448 const Node *head = rel->
to;
466 if (tail_cluster !=
nullptr && tail_cluster->
contains(dot_head)) {
470 if (head_cluster !=
nullptr && head_cluster->
contains(dot_tail)) {
482 if (time_source !=
nullptr) {
498 if (time_source !=
nullptr) {
void set(StringRef key, StringRef value)
bool contains(Node &node) const
void set_parent_cluster(Cluster *new_parent)
std::string to_dot_string() const
DirectedEdge & new_edge(NodePort from, NodePort to)
Cluster & new_cluster(StringRef label="")
void set_rankdir(Attr_rankdir rankdir)
Node & new_node(StringRef label)
void set_parent_cluster(Cluster *cluster)
std::string DEG_debug_graph_to_dot(const Depsgraph &graph, const blender::StringRef label)
static void deg_debug_graphviz_node_color(DotExportContext &ctx, const Node *node, dot_export::Attributes &dot_attributes)
static int deg_debug_node_color_index(const Node *node)
@ RELATION_FLAG_FLUSH_USER_EDIT_ONLY
static void deg_debug_graphviz_graph_relations(DotExportContext &ctx, const Depsgraph *graph)
@ NTREE_GEOMETRY_PREPROCESS
static void deg_debug_graphviz_legend(DotExportContext &ctx)
static void deg_debug_graphviz_relation_color(const Relation *rel, dot_export::DirectedEdge &edge)
static void deg_debug_graphviz_relation_style(const Relation *rel, dot_export::DirectedEdge &edge)
static void deg_debug_graphviz_node_fillcolor(const Node *node, dot_export::Attributes &dot_attributes)
static void deg_debug_graphviz_node_penwidth(DotExportContext &ctx, const Node *node, dot_export::Attributes &dot_attributes)
static float deg_debug_graphviz_node_label_size
static const char * deg_debug_colors_light[]
static dot_export::Cluster & deg_debug_graphviz_node_cluster_create(DotExportContext &ctx, const Node *node, dot_export::Cluster *parent_cluster)
static const int deg_debug_max_colors
static float deg_debug_graphviz_graph_label_size
static void deg_debug_graphviz_relation_arrowhead(const Relation *rel, dot_export::DirectedEdge &edge)
static void deg_debug_graphviz_graph_nodes(DotExportContext &ctx, const Depsgraph *graph)
static void deg_debug_graphviz_node_single(DotExportContext &ctx, const Node *node, dot_export::Cluster *parent_cluster)
DepsNodeFactory * type_get_factory(const NodeType type)
static void deg_debug_graphviz_legend_color(const char *name, const char *color, std::stringstream &ss)
static void deg_debug_graphviz_node(DotExportContext &ctx, const Node *node, dot_export::Cluster *parent_cluster)
static void deg_debug_graphviz_node_relations(DotExportContext &ctx, const Node *node)
@ DEPSOP_FLAG_NEEDS_UPDATE
@ DEPSOP_FLAG_DIRECTLY_MODIFIED
static const char * deg_debug_graphviz_fontname
static void deg_debug_graphviz_node_style(DotExportContext &ctx, const Node *node, dot_export::Attributes &dot_attributes)
virtual bool need_tag_cow_before_update(const IDRecalcFlag)
Vector< OperationNode * > operations
TimeSourceNode * find_time_source() const
Map< const Node *, dot_export::Cluster * > clusters_map
dot_export::DirectedGraph & digraph
Map< const Node *, dot_export::Node * > nodes_map
Map< ComponentIDKey, ComponentNode * > components
virtual std::string identifier() const
virtual NodeClass get_class() const