Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
minglemain.cpp File Reference
#include "config.h"
#include "../tools/openFile.h"
#include <algorithm>
#include <cgraph/cgraph.h>
#include <cgraph/exit.h>
#include <cgraph/ingraphs.h>
#include <common/pointset.h>
#include <getopt.h>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <vector>
#include <sparse/DotIO.h>
#include <mingle/edge_bundling.h>
#include <mingle/nearest_neighbor_graph.h>
Include dependency graph for minglemain.cpp:

Go to the source code of this file.

Data Structures

struct  etoi_t
 
struct  opts_t
 

Macros

#define ED_idx(e)   (((etoi_t*)AGDATA(e))->idx)
 

Enumerations

enum  fmt_t { FMT_GV , FMT_SIMPLE }
 

Functions

static void usage (int eval)
 
static int checkG (Agraph_t *g)
 
static void init (int argc, char *argv[], opts_t &opts)
 
static void genBundleSpline (const pedge &edge, std::ostream &os)
 
static void genBundleInfo (const pedge &edge, std::ostream &os)
 
static void genBundleColors (const pedge &edge, std::ostream &os, double maxwgt)
 
static void export_dot (FILE *fp, int ne, const std::vector< pedge > &edges, Agraph_t *g)
 
static int bundle (Agraph_t *g, const opts_t &opts)
 
int main (int argc, char *argv[])
 

Variables

static char * fname
 
static FILE * outfile
 
static const char use_msg []
 

Macro Definition Documentation

◆ ED_idx

#define ED_idx (   e)    (((etoi_t*)AGDATA(e))->idx)

Definition at line 38 of file minglemain.cpp.

Enumeration Type Documentation

◆ fmt_t

enum fmt_t
Enumerator
FMT_GV 
FMT_SIMPLE 

Definition at line 28 of file minglemain.cpp.

Function Documentation

◆ bundle()

static int bundle ( Agraph_t g,
const opts_t opts 
)
static

Definition at line 354 of file minglemain.cpp.

References A, agbindrec(), agerr(), agerrorf(), agfstnode(), agfstout(), aghead, agnameof(), agnxtnode(), agnxtout(), AGPREV, agtail, opts_t::angle, opts_t::angle_param, B, checkG(), opts_t::compatibility_method, ED_idx, edge_bundling(), export_dot(), opts_t::fmt, FMT_GV, fname, FORMAT_CSR, free(), freePM(), getDotNodeID(), initDotIO(), insertPM(), opts_t::K, opts_t::max_recursion, opts_t::method, nearest_neighbor_graph(), newPM(), opts_t::nneighbors, opts, opts_t::outer_iter, outfile, pedge_export_gv(), setDotNodeID(), SparseMatrix_delete(), SparseMatrix_import_dot(), SparseMatrix_symmetrize(), and Verbose.

Referenced by main().

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

◆ checkG()

static int checkG ( Agraph_t g)
static

Definition at line 82 of file minglemain.cpp.

References agfstnode(), agfstout(), aghead, agnxtnode(), and agnxtout().

Referenced by bundle().

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

◆ export_dot()

static void export_dot ( FILE *  fp,
int  ne,
const std::vector< pedge > &  edges,
Agraph_t g 
)
static

Definition at line 310 of file minglemain.cpp.

References agattr(), AGEDGE, agfstnode(), agfstout(), agnxtnode(), agnxtout(), agwrite(), agxset(), ED_idx, edge, genBundleColors(), genBundleInfo(), and genBundleSpline().

Referenced by bundle().

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

◆ genBundleColors()

static void genBundleColors ( const pedge edge,
std::ostream &  os,
double  maxwgt 
)
static

Definition at line 280 of file minglemain.cpp.

References edge, and len().

Referenced by export_dot().

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

◆ genBundleInfo()

static void genBundleInfo ( const pedge edge,
std::ostream &  os 
)
static

Definition at line 262 of file minglemain.cpp.

References edge.

Referenced by export_dot().

Here is the caller graph for this function:

◆ genBundleSpline()

static void genBundleSpline ( const pedge edge,
std::ostream &  os 
)
static

Definition at line 234 of file minglemain.cpp.

References edge.

Referenced by export_dot().

Here is the caller graph for this function:

◆ init()

static void init ( int  argc,
char *  argv[],
opts_t opts 
)
static

Definition at line 100 of file minglemain.cpp.

References opts_t::angle, opts_t::angle_param, cmd, COMPATIBILITY_FULL, opts_t::compatibility_method, Files, opts_t::fmt, FMT_GV, FMT_SIMPLE, opts_t::K, M_PI, opts_t::max_recursion, opts_t::method, METHOD_INK, METHOD_INK_AGGLOMERATE, opts_t::nneighbors, openFile(), opts, opts_t::outer_iter, outfile, usage, and Verbose.

Referenced by main().

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

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 450 of file minglemain.cpp.

References agclose(), agnameof(), bundle(), fileName(), Files, fname, graphviz_exit(), init(), newIngraph(), nextGraph(), opts, prev, and Verbose.

Here is the call graph for this function:

◆ usage()

static void usage ( int  eval)
static

Definition at line 71 of file minglemain.cpp.

References eval(), graphviz_exit(), and use_msg.

Here is the call graph for this function:

Variable Documentation

◆ fname

char* fname
static

Definition at line 52 of file minglemain.cpp.

Referenced by bundle(), and main().

◆ outfile

FILE* outfile
static

Definition at line 53 of file minglemain.cpp.

Referenced by bundle(), and init().

◆ use_msg

const char use_msg[]
static
Initial value:
=
"Usage: mingle <options> <file>\n\
-a t - max. turning angle [0-180] (40)\n\
-c i - compatability measure; 0 : distance, 1: full (default)\n\
-i iter: number of outer iterations/subdivisions (4)\n\
-k k - number of neighbors in the nearest neighbor graph of edges (10)\n\
-K k - the force constant\n\
-m method - method used. 0 (force directed), 1 (agglomerative ink saving, default), 2 (cluster+ink saving)\n\
-o fname - write output to file fname (stdout)\n\
-p t - balance for avoiding sharp angles\n\
The larger the t, the more sharp angles are allowed\n\
-r R - max. recursion level with agglomerative ink saving method (100)\n\
-T fmt - output format: gv (default) or simple\n\
-v - verbose\n"

Definition at line 55 of file minglemain.cpp.

Referenced by usage().