Tulip  5.1.0
Large graphs analysis and drawing
GlTLPFeedBackBuilder.h
1 /*
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
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_GLTLPFEEDBACKBUILDER_H
22 #define Tulip_GLTLPFEEDBACKBUILDER_H
23 
24 #include <tulip/OpenGlIncludes.h>
25 
26 #include <vector>
27 
28 #include <tulip/GlFeedBackBuilder.h>
29 
30 namespace tlp {
31 
32 enum TLP_FB_TROUGHTOKENTYPE {
33  TLP_FB_COLOR_INFO,
34  TLP_FB_BEGIN_ENTITY,
35  TLP_FB_END_ENTITY,
36  TLP_FB_BEGIN_GRAPH,
37  TLP_FB_END_GRAPH,
38  TLP_FB_BEGIN_NODE,
39  TLP_FB_END_NODE,
40  TLP_FB_BEGIN_EDGE,
41  TLP_FB_END_EDGE
42 };
43 
44 class TLP_GL_SCOPE GlTLPFeedBackBuilder : public GlFeedBackBuilder {
45 
46 public:
47 
48  GlTLPFeedBackBuilder()
49  :inGlEntity(false),
50  inGlGraph(false),
51  inNode(false),
52  inEdge(false),
53  inColorInfo(false),
54  needData(false) {}
55 
56  virtual ~GlTLPFeedBackBuilder() {}
57 
58  virtual void colorInfo(GLfloat *) {}
59  virtual void beginGlEntity(GLfloat) {}
60  virtual void endGlEntity() {}
61  virtual void beginGlGraph(GLfloat) {}
62  virtual void endGlGraph() {}
63  virtual void beginNode(GLfloat) {}
64  virtual void endNode() {}
65  virtual void beginEdge(GLfloat) {}
66  virtual void endEdge() {}
67  virtual void passThroughToken(GLfloat *);
68  virtual void pointToken(GLfloat *) {}
69  virtual void lineToken(GLfloat *) {}
70  virtual void lineResetToken(GLfloat *) {}
71  virtual void polygonToken(GLfloat *) {}
72  virtual void bitmapToken(GLfloat *) {}
73  virtual void drawPixelToken(GLfloat *) {}
74  virtual void copyPixelToken(GLfloat *) {}
75  virtual void end() {}
76 
77 private:
78 
79  bool inGlEntity;
80  bool inGlGraph;
81  bool inNode;
82  bool inEdge;
83  bool inColorInfo;
84  bool needData;
85 
86  std::vector<GLfloat> dataBuffer;
87 
88 };
89 
90 }
91 
92 #endif // Tulip_GLFEEDBACKBUILDER_H
93 ///@endcond