Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
edge_distinct_coloring.c File Reference
#include <sparse/general.h>
#include <math.h>
#include <stdbool.h>
#include <string.h>
#include <time.h>
#include <sparse/SparseMatrix.h>
#include <edgepaint/edge_distinct_coloring.h>
#include <edgepaint/node_distinct_coloring.h>
#include <sparse/DotIO.h>
#include <edgepaint/intersection.h>
#include <sparse/QuadTree.h>
#include <util/alloc.h>
Include dependency graph for edge_distinct_coloring.c:

Go to the source code of this file.

Functions

static int splines_intersect (size_t dim, double cos_critical, int check_edges_with_same_endpoint, char *xsplines1, char *xsplines2)
 
Agraph_tedge_distinct_coloring (const char *color_scheme, int *lightness, Agraph_t *g, double angle, double accuracy, int check_edges_with_same_endpoint, int seed)
 

Function Documentation

◆ edge_distinct_coloring()

Agraph_t * edge_distinct_coloring ( const char *  color_scheme,
int *  lightness,
Agraph_t g,
double  angle,
double  accuracy,
int  check_edges_with_same_endpoint,
int  seed 
)

color the edges of a graph so that conflicting edges are as distinct in color as possible

Parameters
color_schemergb, lab, gray, or a list of comma separated RGB colors in hex, like #ff0000,#00ff00
lightnessof the form 0,70, specifying the range of lightness of LAB color. Ignored if scheme is not COLOR_LAB.
gthe graph
angleif two edges cross at an angle < "angle", consider they as conflict
accuracyhow accurate when finding color of an edge to be as different from others
check_edges_with_same_endpointif TRUE, we will check edges with same end point and only consider them as conflict if their angle is very small. Edges that share an end point and is close to 180 degree are not consider conflict.
seedrandom_seed. If negative, consider -seed as the number of random start iterations

Definition at line 142 of file edge_distinct_coloring.c.

References A, attach_edge_colors(), B, C, dim, FORMAT_COORD, free(), Import_dot_splines(), intersection_angle(), MATRIX_TYPE_REAL, node_distinct_coloring(), NULL, RETURN, seed, SparseMatrix_coordinate_form_add_entry(), SparseMatrix_delete(), SparseMatrix_from_coordinate_format(), SparseMatrix_import_dot(), SparseMatrix_new(), splines_intersect(), and Verbose.

Referenced by clarify().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ splines_intersect()

static int splines_intersect ( size_t  dim,
double  cos_critical,
int  check_edges_with_same_endpoint,
char *  xsplines1,
char *  xsplines2 
)
static

Definition at line 24 of file edge_distinct_coloring.c.

References dim, free(), gv_calloc(), gv_recalloc(), intersection_angle(), and MAX.

Referenced by edge_distinct_coloring().

Here is the call graph for this function:
Here is the caller graph for this function: