Classes | Macros | Functions | Variables
make_graph.cpp File Reference

Generation of a graph file from two input files: More...

#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_parser.hpp>
#include "plati_graph.hpp"
#include "helper_functions.hpp"
#include "common_header.hpp"
Include dependency graph for make_graph.cpp:

Classes

struct  GraphParams
 

Macros

#define GET_FILE_NAME(filename, rank, name)
 Local macro. More...
 

Functions

int main (int argc, const char **argv)
 See make_graph.cpp. More...
 

Variables

const int param_index_width = 4
 width of the index in filenames (ex: 4 means XXXX, 5: XXXXX) More...
 
static const std::string param_base_filename = "sph_"
 

Detailed Description

Generation of a graph file from two input files:

Arguments:

  1. configuration file (.ini)
  2. sphere coordinates file name (optional, needed if not provided in configuration file)
  3. edges file name, as pair of indexes of spheres (optional, needed if not provided in configuration file);
  4. root name of output files, without extension (optional). Default value:"graph".

The configuration file is used to get the path to the spheres and the subfolders names (see PlatinumData_graph::saveNodesCsv() ).

This app will produce 4 output files:

Note
If the input file holds parallel edges, these will be removed in the output files.

The .dot files can be graphically rendered with Graphviz:

See Image Based Navigation request for how the csv file will be used.

Example configuration file:

; S. Kramm - 20180628
; Platinum

; holds the configuration for the production of the graph files from the files holding sphere coordinates and edges
; see "make_graph"
; the only files we need to access when running this are fn_spheres and fn_edges.
; The others are just there so their content will be copied to the output files.

[general]

; location of the spheres (used to produce the output csv file)
spheres_location=/DATA/out/ibensalah/graphs/Graph520500/

; spheres coordinates file
fn_spheres=/DATA/out/ibensalah/graphs/spheres_20180628.txt

; edges file
fn_edges=/DATA/out/ibensalah/graphs/edges_20180628.txt

;output filename. NO EXTENSION!
; several files will be generated from this:
; *.bgl
; *.dot
; *_nodes.csv

fn_output=data/graph_20180628


; subfolders in which the spheres are stored (if they are all in
; the same folder, just put '/')
folder_RGB=rgb/
folder_label=semantic/
folder_depth=depth/

Macro Definition Documentation

◆ GET_FILE_NAME

#define GET_FILE_NAME (   filename,
  rank,
  name 
)
Value:
if( argc>rank ) \
filename = argv[rank]; \
if( filename.empty() ) \
{ \
std::cerr << "Error: no " << name << " file given, neither in config file or on command-line !\n"; \
return 1; \
} \
else \
std::cout << "-using " << filename << " as " << name << " file\n";

Local macro.

Function Documentation

◆ main()

int main ( int  argc,
const char **  argv 
)

See make_graph.cpp.

Here is the call graph for this function:

Variable Documentation

◆ param_base_filename

const std::string param_base_filename = "sph_"
static

◆ param_index_width

const int param_index_width = 4

width of the index in filenames (ex: 4 means XXXX, 5: XXXXX)