19 #ifndef TLPBIMPORTEXPORT_H
20 #define TLPBIMPORTEXPORT_H
23 #include <tulip/TulipPluginHeaders.h>
24 #include <tulip/ExportModule.h>
25 #include <tulip/ImportModule.h>
73 "Exports a graph in a file using the Tulip binary format",
76 std::string fileExtension()
const {
83 bool exportGraph(std::ostream &);
85 std::string icon()
const {
86 return ":/tulip/gui/icons/tlpb32x32.png";
89 tlp::MutableContainer<tlp::node> nodeIndex;
90 tlp::MutableContainer<tlp::edge> edgeIndex;
93 return nodeIndex.get(n.
id);
97 return edgeIndex.get(e.
id);
100 void getSubGraphs(
tlp::Graph*, std::vector<tlp::Graph*>&);
102 void writeAttributes(std::ostream&,
tlp::Graph*);
114 "Imports a graph recorded in a file using the Tulip binary format",
"1.0",
"File")
119 std::string icon()
const {
120 return ":/tulip/gui/icons/tlpb32x32.png";
123 std::list<std::string> fileExtensions()
const {
124 std::list<std::string> l;
126 l.push_back(
"tlpb.gz");
136 #define TLPB_MAGIC_NUMBER 578374683
142 unsigned int magicNumber;
145 unsigned int numNodes;
146 unsigned int numEdges;
148 TLPBHeader(
unsigned int nbN = 0,
unsigned int nbE = 0)
149 : magicNumber(TLPB_MAGIC_NUMBER), major(TLPB_MAJOR), minor(TLPB_MINOR), numNodes(nbN), numEdges(nbE) {}
151 bool checkCompatibility() {
152 return ((magicNumber == TLPB_MAGIC_NUMBER) &&
153 (major == TLPB_MAJOR) &&
154 (minor <= TLPB_MINOR));
158 #define MAX_EDGES_TO_WRITE 64000
159 #define MAX_EDGES_TO_READ MAX_EDGES_TO_WRITE
160 #define MAX_RANGES_TO_WRITE MAX_EDGES_TO_WRITE
161 #define MAX_RANGES_TO_READ MAX_RANGES_TO_WRITE
162 #define MAX_VALUES_TO_WRITE MAX_EDGES_TO_WRITE
163 #define MAX_VALUES_TO_READ MAX_VALUES_TO_WRITE
165 #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.