Tulip  4.3.0
Better Visualization Through Research
 All Classes Namespaces 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 #include <tulip/Color.h>
30 
31 namespace tlp {
32 
33 class TLP_GL_SCOPE GlSVGFeedBackBuilder : public GlTLPFeedBackBuilder {
34 
35 public:
36 
37  GlSVGFeedBackBuilder()
38  :stream_out(std::stringstream::in | std::stringstream::out),inGlEntity(false),inGlGraph(false),inNode(false),inEdge(false) {}
39 
40  virtual void begin(const Vector<int, 4> &viewport,GLfloat *clearColor,GLfloat pointSize,GLfloat lineWidth);
41  virtual void colorInfo(GLfloat *data);
42  virtual void beginGlEntity(GLfloat data);
43  virtual void endGlEntity();
44  virtual void beginGlGraph(GLfloat data);
45  virtual void endGlGraph();
46  virtual void beginNode(GLfloat data);
47  virtual void endNode();
48  virtual void beginEdge(GLfloat data);
49  virtual void endEdge();
50  virtual void pointToken(GLfloat *data);
51  virtual void lineToken(GLfloat *data);
52  virtual void lineResetToken(GLfloat *data);
53  virtual void polygonToken(GLfloat *data);
54  virtual void bitmapToken(GLfloat *data);
55  virtual void drawPixelToken(GLfloat *data);
56  virtual void copyPixelToken(GLfloat *data);
57  virtual void end();
58 
59  virtual void getResult(std::string* str);
60 
61 private:
62 
63  std::stringstream stream_out;
64 
65  GLfloat clearColor[4];
66  GLfloat pointSize;
67  GLfloat lineWidth;
68 
69  Color fillColor;
70  Color strokeColor;
71  Color textColor;
72 
73  bool inGlEntity;
74  bool inGlGraph;
75  bool inNode;
76  bool inEdge;
77 
78  int width;
79  int height;
80 
81 };
82 
83 }
84 
85 #endif // DOXYGEN_NOTFOR_DEVEL
86 
87 #endif // Tulip_GLFEEDBACKBUILDER_H
88 ///@endcond