Tulip  4.1.0
Better Visualization Through Research
 All Classes Files Functions Variables Enumerations Enumerator Properties Groups Pages
GlSVGFeedBackBuilder.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux 1 and Inria Bordeaux - Sud Ouest
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 #ifndef Tulip_GLSVGFEEDBACKBUILDER_H
22 #define Tulip_GLSVGFEEDBACKBUILDER_H
23 
24 #ifndef DOXYGEN_NOTFOR_DEVEL
25 
26 #include <sstream>
27 
28 #include <tulip/GlTLPFeedBackBuilder.h>
29 
30 namespace tlp {
31 
32 class TLP_GL_SCOPE GlSVGFeedBackBuilder : public GlTLPFeedBackBuilder {
33 
34 public:
35 
36  GlSVGFeedBackBuilder()
37  :stream_out(std::stringstream::in | std::stringstream::out),inGlEntity(false),inGlGraph(false),inNode(false),inEdge(false) {}
38 
39  virtual void begin(const Vector<int, 4> &viewport,GLfloat *clearColor,GLfloat pointSize,GLfloat lineWidth);
40  virtual void colorInfo(GLfloat *data);
41  virtual void beginGlEntity(GLfloat data);
42  virtual void endGlEntity();
43  virtual void beginGlGraph(GLfloat data);
44  virtual void endGlGraph();
45  virtual void beginNode(GLfloat data);
46  virtual void endNode();
47  virtual void beginEdge(GLfloat data);
48  virtual void endEdge();
49  virtual void pointToken(GLfloat *data);
50  virtual void lineToken(GLfloat *data);
51  virtual void lineResetToken(GLfloat *data);
52  virtual void polygonToken(GLfloat *data);
53  virtual void bitmapToken(GLfloat *data);
54  virtual void drawPixelToken(GLfloat *data);
55  virtual void copyPixelToken(GLfloat *data);
56  virtual void end();
57 
58  virtual void getResult(std::string* str);
59 
60 private:
61 
62  std::stringstream stream_out;
63 
64  GLfloat clearColor[4];
65  GLfloat pointSize;
66  GLfloat lineWidth;
67 
68  Color fillColor;
69  Color strokeColor;
70  Color textColor;
71 
72  bool inGlEntity;
73  bool inGlGraph;
74  bool inNode;
75  bool inEdge;
76 
77  int width;
78  int height;
79 
80 };
81 
82 }
83 
84 #endif // DOXYGEN_NOTFOR_DEVEL
85 
86 #endif // Tulip_GLFEEDBACKBUILDER_H
87 ///@endcond