38 #ifndef TLPBIMPORTEXPORT_H
39 #define TLPBIMPORTEXPORT_H
42 #include <tulip/TulipPluginHeaders.h>
43 #include <tulip/ExportModule.h>
44 #include <tulip/ImportModule.h>
91 PLUGININFORMATION(
"TLPB Export",
"David Auber, Patrick Mary",
"13/07/2012",
"Saves a graph in Tulip binary format",
"1.0",
"File")
93 std::string fileExtension()
const {
100 bool exportGraph(std::ostream &);
102 std::string icon()
const {
103 return ":/tulip/gui/icons/tlpb32x32.png";
106 tlp::MutableContainer<tlp::node> nodeIndex;
107 tlp::MutableContainer<tlp::edge> edgeIndex;
110 return nodeIndex.get(n.
id);
114 return edgeIndex.get(e.
id);
117 void getSubGraphs(
tlp::Graph*, std::vector<tlp::Graph*>&);
119 void writeAttributes(std::ostream&,
tlp::Graph*);
131 "Reads a graph in Tulip binary format",
"1.0",
"File")
136 std::string icon()
const {
137 return ":/tulip/gui/icons/tlpb32x32.png";
140 std::list<std::string> fileExtensions()
const {
141 return std::list<std::string>(1,
"tlpb");
150 #define TLPB_MAGIC_NUMBER 578374683
156 unsigned int magicNumber;
159 unsigned int numNodes;
160 unsigned int numEdges;
162 TLPBHeader(
unsigned int nbN = 0,
unsigned int nbE = 0)
163 : magicNumber(TLPB_MAGIC_NUMBER), major(TLPB_MAJOR), minor(TLPB_MINOR), numNodes(nbN), numEdges(nbE) {}
165 bool checkCompatibility() {
166 return ((magicNumber == TLPB_MAGIC_NUMBER) &&
167 (major == TLPB_MAJOR) &&
168 (minor <= TLPB_MINOR));
172 #define MAX_EDGES_TO_WRITE 64000
173 #define MAX_EDGES_TO_READ MAX_EDGES_TO_WRITE
174 #define MAX_RANGES_TO_WRITE MAX_EDGES_TO_WRITE
175 #define MAX_RANGES_TO_READ MAX_RANGES_TO_WRITE
176 #define MAX_VALUES_TO_WRITE MAX_EDGES_TO_WRITE
177 #define MAX_VALUES_TO_READ MAX_VALUES_TO_WRITE
179 #endif // TLPBIMPORTEXPORT_H
The edge struct represents an edge in a Graph object.
The node struct represents a node in a Graph object.
#define PLUGININFORMATION(NAME, AUTHOR, DATE, INFO, RELEASE, GROUP)
Declare meta-information for a plugin This is an helper macro that defines every function related to ...
Contains runtime parameters for a plugin.
Import plugin for TLPB format.
unsigned int id
id The identifier of the node.
Export plugin for TLPB format.
unsigned int id
id The identifier of the edge.