All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PostscriptWriter.h
Go to the documentation of this file.
1 /*
2  * PostscriptWriter.h
3  *
4  * Created on: Apr 10, 2013
5  * Author: Henning
6  */
7 
8 #ifndef POSTSCRIPTWRITER_H_
9 #define POSTSCRIPTWRITER_H_
10 
11 #include <string>
12 #include <iostream>
13 #include <fstream>
14 #include <cmath>
15 #include <cassert>
16 #include <cstdio>
17 #include <climits>
18 
19 #include "../graph/Graph.h"
20 #include "../structures/Partition.h"
21 #include "../community/ClusteringGenerator.h"
22 
23 namespace NetworKit {
24 
30 
31  struct float_triple {
32  float r;
33  float g;
34  float b;
35  };
36 
37 protected:
38  bool wrapAround;
39 
41  std::vector<float_triple> psColor;
42 
47 
48  void init(std::string filename, std::ofstream& file);
49  void writeHeader(std::ofstream& file);
50  void writeMacros(std::ofstream& file);
51  void writeClustering(Graph& g, Partition& clustering, std::ofstream& file);
52 
53 public:
59  PostscriptWriter(bool isTorus = false);
60 
68  void write(Graph& g, Partition& clustering, std::string filename);
69 
75  void write(Graph& g, std::string filename);
76 };
77 
78 } /* namespace NetworKit */
79 #endif /* POSTSCRIPTWRITER_H_ */
Point< float > ps_size
Definition: PostscriptWriter.h:43
Point< float > ps_border
Definition: PostscriptWriter.h:44
void writeClustering(Graph &g, Partition &clustering, std::ofstream &file)
Definition: PostscriptWriter.cpp:66
EPS output of graphs with 2D coordinates.
Definition: PostscriptWriter.h:29
void write(Graph &g, Partition &clustering, std::string filename)
Outputs an EPS file with name filename of the graph g with 2D coordinates.
Definition: PostscriptWriter.cpp:175
PostscriptWriter(bool isTorus=false)
Definition: PostscriptWriter.cpp:13
void writeHeader(std::ofstream &file)
Definition: PostscriptWriter.cpp:33
std::vector< float_triple > psColor
Definition: PostscriptWriter.h:41
Implements a partition of a set, i.e.
Definition: Partition.h:31
void writeMacros(std::ofstream &file)
Definition: PostscriptWriter.cpp:49
void init(std::string filename, std::ofstream &file)
Definition: PostscriptWriter.cpp:163
uint64_t count
Definition: Globals.h:21
Point< float > ps_min
Definition: PostscriptWriter.h:45
bool wrapAround
Definition: PostscriptWriter.h:38
Point< float > ps_max
Definition: PostscriptWriter.h:46
A graph (with optional weights) and parallel iterator methods.
Definition: Graph.h:79
count numColors
Definition: PostscriptWriter.h:40