42#define COLOR_SCHEME_NODE_CLASS 1
49#ifdef COLOR_SCHEME_NODE_TYPE
50static const char *deg_debug_colors[] = {
82#ifdef COLOR_SCHEME_NODE_TYPE
83static const int deg_debug_node_type_color_map[][2] = {
104#ifdef COLOR_SCHEME_NODE_CLASS
106 switch (node->type) {
124 switch (node->get_class()) {
134#ifdef COLOR_SCHEME_NODE_TYPE
136 for (pair = deg_debug_node_type_color_map; (*pair)[0] >= 0; pair++) {
137 if ((*pair)[0] == node->type) {
154 std::stringstream &ss)
158 ss <<
"<TD>" << name <<
"</TD>";
159 ss <<
"<TD BGCOLOR=\"" << color <<
"\"></TD>";
170 std::stringstream ss;
172 ss << R
"(<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">)";
173 ss << "<TR><TD COLSPAN=\"2\"><B>Legend</B></TD></TR>";
175#ifdef COLOR_SCHEME_NODE_CLASS
184#ifdef COLOR_SCHEME_NODE_TYPE
186 for (pair = deg_debug_node_type_color_map; (*pair)[0] >= 0; pair++) {
203 const char *color_default =
"black";
204 const char *color_modified =
"orangered4";
205 const char *color_update =
"dodgerblue3";
206 const char *color = color_default;
211 color = color_modified;
214 color = color_update;
218 dot_attributes.
set(
"color", color);
225 float penwidth_default = 1.0f;
226 float penwidth_modified = 4.0f;
227 float penwidth_update = 4.0f;
228 float penwidth = penwidth_default;
233 penwidth = penwidth_modified;
236 penwidth = penwidth_update;
240 dot_attributes.
set(
"penwidth", penwidth);
245 const char *defaultcolor =
"gainsboro";
247 const char *fillcolor = color_index < 0 ?
250 dot_attributes.
set(
"fillcolor", fillcolor);
255 const char *color_default =
"black";
256 const char *color_cyclic =
"red4";
257 const char *color_godmode =
"blue4";
258 const char *color = color_default;
260 color = color_cyclic;
263 color = color_godmode;
265 edge.attributes.set(
"color", color);
270 const char *style_default =
"solid";
271 const char *style_no_flush =
"dashed";
272 const char *style_flush_user_only =
"dotted";
273 const char *style = style_default;
275 style = style_no_flush;
278 style = style_flush_user_only;
280 edge.attributes.set(
"style", style);
285 const char *shape_default =
"normal";
286 const char *shape_no_cow =
"box";
287 const char *shape = shape_default;
298 shape = shape_no_cow;
301 edge.attributes.set(
"arrowhead", shape);
313 base_style =
"striped";
317 switch (node->get_class()) {
319 dot_attributes.
set(
"style", base_style);
322 dot_attributes.
set(
"style", base_style);
325 dot_attributes.
set(
"style", base_style +
",rounded");
334 string name = node->identifier();
353 string name = node->identifier();
380 switch (node->type) {
445 for (
Relation *rel : node->inlinks) {
446 float penwidth = 2.0f;
448 const Node *head = rel->to;
449 const Node *tail = rel->from;
460 edge.attributes.set(
"penwidth", penwidth);
466 if (tail_cluster !=
nullptr && tail_cluster->
contains(dot_head)) {
467 edge.attributes.set(
"ltail", tail_cluster->
name());
470 if (head_cluster !=
nullptr && head_cluster->
contains(dot_tail)) {
471 edge.attributes.set(
"lhead", head_cluster->
name());
478 for (
Node *node : graph->id_nodes) {
482 if (time_source !=
nullptr) {
498 if (time_source !=
nullptr) {
512 digraph.
set_rankdir(dot::Attr_rankdir::LeftToRight);
These structs are the foundation for all linked lists in the library system.
void set(StringRef key, StringRef value)
void set_parent_cluster(Cluster *new_parent)
bool contains(Node &node) const
DirectedEdge & new_edge(NodePort from, NodePort to)
std::string to_dot_string() const
Cluster & new_cluster(StringRef label="")
Node & new_node(StringRef label)
void set_rankdir(Attr_rankdir rankdir)
void set_parent_cluster(Cluster *cluster)
std::string DEG_debug_graph_to_dot(const Depsgraph &graph, const blender::StringRef label)
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
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 float deg_debug_graphviz_node_label_size
static const char * deg_debug_colors_light[]
static void deg_debug_graphviz_node(DotExportContext &ctx, const Node *node, dot::Cluster *parent_cluster)
static const int deg_debug_max_colors
static float deg_debug_graphviz_graph_label_size
static void deg_debug_graphviz_graph_nodes(DotExportContext &ctx, const Depsgraph *graph)
DepsNodeFactory * type_get_factory(const NodeType type)
static void deg_debug_graphviz_node_single(DotExportContext &ctx, const Node *node, dot::Cluster *parent_cluster)
static void deg_debug_graphviz_node_fillcolor(const Node *node, dot::Attributes &dot_attributes)
static dot::Cluster & deg_debug_graphviz_node_cluster_create(DotExportContext &ctx, const Node *node, dot::Cluster *parent_cluster)
static void deg_debug_graphviz_relation_style(const Relation *rel, dot::DirectedEdge &edge)
static void deg_debug_graphviz_relation_arrowhead(const Relation *rel, dot::DirectedEdge &edge)
static void deg_debug_graphviz_legend_color(const char *name, const char *color, std::stringstream &ss)
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_relation_color(const Relation *rel, dot::DirectedEdge &edge)
static void deg_debug_graphviz_node_style(DotExportContext &ctx, const Node *node, dot::Attributes &dot_attributes)
static void deg_debug_graphviz_node_penwidth(DotExportContext &ctx, const Node *node, dot::Attributes &dot_attributes)
static void deg_debug_graphviz_node_color(DotExportContext &ctx, const Node *node, dot::Attributes &dot_attributes)
virtual bool need_tag_cow_before_update(const IDRecalcFlag)
Vector< OperationNode * > operations
dot::DirectedGraph & digraph
Map< const Node *, dot::Cluster * > clusters_map
Map< const Node *, dot::Node * > nodes_map
Map< ComponentIDKey, ComponentNode * > components
virtual NodeClass get_class() const