Tulip  5.2.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  GlTLPFeedBackBuilder()
48  : inGlEntity(false), inGlGraph(false), inNode(false), inEdge(false), inColorInfo(false),
49  needData(false) {}
50 
51  ~GlTLPFeedBackBuilder() override {}
52 
53  virtual void colorInfo(GLfloat *) {}
54  virtual void beginGlEntity(GLfloat) {}
55  virtual void endGlEntity() {}
56  virtual void beginGlGraph(GLfloat) {}
57  virtual void endGlGraph() {}
58  virtual void beginNode(GLfloat) {}
59  virtual void endNode() {}
60  virtual void beginEdge(GLfloat) {}
61  virtual void endEdge() {}
62  void passThroughToken(GLfloat *) override;
63  void pointToken(GLfloat *) override {}
64  void lineToken(GLfloat *) override {}
65  void lineResetToken(GLfloat *) override {}
66  void polygonToken(GLfloat *) override {}
67  void bitmapToken(GLfloat *) override {}
68  void drawPixelToken(GLfloat *) override {}
69  void copyPixelToken(GLfloat *) override {}
70  void end() override {}
71 
72 private:
73  bool inGlEntity;
74  bool inGlGraph;
75  bool inNode;
76  bool inEdge;
77  bool inColorInfo;
78  bool needData;
79 
80  std::vector<GLfloat> dataBuffer;
81 };
82 }
83 
84 #endif // Tulip_GLFEEDBACKBUILDER_H
85 ///@endcond