File: RepresentExport.h

package info (click to toggle)
tulip 4.8.0dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 179,264 kB
  • ctags: 64,517
  • sloc: cpp: 600,444; ansic: 36,311; makefile: 22,136; python: 1,304; sh: 946; yacc: 522; xml: 337; pascal: 157; php: 66; lex: 55
file content (104 lines) | stat: -rw-r--r-- 4,279 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/**
 *
 * This file is part of Tulip (www.tulip-software.org)
 *
 * Authors: David Auber and the Tulip development Team
 * from LaBRI, University of Bordeaux
 *
 * Tulip is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation, either version 3
 * of the License, or (at your option) any later version.
 *
 * Tulip is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 */
#ifndef REPRESENTEXPORT_H
#define REPRESENTEXPORT_H

#include <vector>

#include <tulip/Coord.h>
#include <tulip/Size.h>
#include <tulip/TulipViewSettings.h>
#include <tulip/ParametricCurves.h>

class QString;

namespace tlp {
class Color;
struct BoundingBox;
}

// Builder
class RepresentExport {

public:

  virtual ~RepresentExport() {}

  // This method write the header of the exported file
  virtual void writeHeader(tlp::BoundingBox &bb)=0;

  // This method begin a graph
  virtual void writeGraph(tlp::BoundingBox &bb)=0;

  // This method begin a meta-graph
  virtual void writeMetaGraph(const int transform_X, const int transform_Y, float scale)=0;



  // This method end a graph or a meta-graph
  virtual void writeEndGraph() = 0;


  // This method end the file
  virtual void writeEnd()=0;

  // This method regroup nodes if we want to modify them later
  virtual void groupNode()=0;

  // This method regroup edges if we want to modify them later
  virtual void groupEdge()=0;

  // This method end the group of node
  virtual void endGroupNode()=0;

  // This method end the group of edge
  virtual void endGroupEdge()=0;

  // This method represent nodes according to incoming parameters
  virtual void startNode(const unsigned id)=0;
  virtual void endNode()=0;

  // This method define the shape of a node
  virtual void addShape(const tlp::NodeShape::NodeShapes &, const tlp::Coord &coord, const tlp::Size &size)=0;

  // This method represent edges according to incoming parameters
  // No edge color interpolation
  virtual void exportEdge(const tlp::EdgeShape::EdgeShapes &, const std::vector<tlp::Coord> &bends, const tlp::Color &edgeColor,const double width, const tlp::EdgeExtremityShape::EdgeExtremityShapes src_anchor_shape_type, const unsigned id_src_shape, const tlp::EdgeExtremityShape::EdgeExtremityShapes tgt_anchor_shape_type, const unsigned id_tgt_shape, const std::vector<tlp::Coord>& edgeVertice)=0;
  // eEge color interpolation between edgeColor1 and edgeColor2
  virtual void exportEdge(const unsigned id, const tlp::EdgeShape::EdgeShapes &, const std::vector<tlp::Coord> &bends, const tlp::Color &edgeColor1, const tlp::Color &edgeColor2, const double width, const tlp::EdgeExtremityShape::EdgeExtremityShapes src_anchor_shape_type, const unsigned id_src_shape, const tlp::EdgeExtremityShape::EdgeExtremityShapes tgt_anchor_shape_type, const unsigned id_tgt_shape, const std::vector<tlp::Coord>& edgeVertice)=0;

  // This method define extremities of edges
  virtual void exportEdgeExtremity(const unsigned id_src_shape, const unsigned id_tgt_shape, const tlp::EdgeExtremityShape::EdgeExtremityShapes src_anchor_shape_type, const tlp::EdgeExtremityShape::EdgeExtremityShapes tgt_anchor_shape_type, const tlp::Color &color, unsigned int& id_src_gradient, unsigned int& id_tgt_gradient, const tlp::Coord &coord_edge_extremity_source, const tlp::Coord &coord_edge_extremity_target, const tlp::Size &size_node_src, const tlp::Size &size_node_tgt)=0;

  // This method represent edges according to incoming parameters
  virtual void startEdge(const unsigned id)=0;
  virtual void endEdge()=0;


  // Elements properties
  virtual void addLabel(const std::string &type, const std::string &label, const tlp::Color &labelcolor, const tlp::Coord &coord, const tlp::Size &size)=0;
  virtual void addColor(const tlp::Color &nodeColor)=0;
  virtual void addRotation(const double rotation, const tlp::Coord &center)=0;
  virtual void addBorder(const tlp::Color &borderColor, const double borderwidth)=0;

  virtual void getData(std::ostream& os) const=0;

};

#endif // REPRESENTEXPORT_H