Tulip  4.8.0
Better Visualization Through Research
 All Classes Files Functions Variables Enumerations Enumerator Properties Groups Pages
GlTLPFeedBackBuilder.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
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 #if defined(_MSC_VER)
25 #include <Windows.h>
26 #endif
27 
28 #if defined(__APPLE__)
29 #include <OpenGL/gl.h>
30 #else
31 #include <GL/gl.h>
32 #endif
33 
34 #include <vector>
35 
36 #include <tulip/GlFeedBackBuilder.h>
37 
38 namespace tlp {
39 
40 enum TLP_FB_TROUGHTOKENTYPE {
41  TLP_FB_COLOR_INFO,
42  TLP_FB_BEGIN_ENTITY,
43  TLP_FB_END_ENTITY,
44  TLP_FB_BEGIN_GRAPH,
45  TLP_FB_END_GRAPH,
46  TLP_FB_BEGIN_NODE,
47  TLP_FB_END_NODE,
48  TLP_FB_BEGIN_EDGE,
49  TLP_FB_END_EDGE
50 };
51 
52 class TLP_GL_SCOPE GlTLPFeedBackBuilder : public GlFeedBackBuilder {
53 
54 public:
55 
56  GlTLPFeedBackBuilder()
57  :inGlEntity(false),
58  inGlGraph(false),
59  inNode(false),
60  inEdge(false),
61  inColorInfo(false),
62  needData(false) {}
63 
64  virtual ~GlTLPFeedBackBuilder() {}
65 
66  virtual void colorInfo(GLfloat *) {}
67  virtual void beginGlEntity(GLfloat) {}
68  virtual void endGlEntity() {}
69  virtual void beginGlGraph(GLfloat) {}
70  virtual void endGlGraph() {}
71  virtual void beginNode(GLfloat) {}
72  virtual void endNode() {}
73  virtual void beginEdge(GLfloat) {}
74  virtual void endEdge() {}
75  virtual void passThroughToken(GLfloat *);
76  virtual void pointToken(GLfloat *) {}
77  virtual void lineToken(GLfloat *) {}
78  virtual void lineResetToken(GLfloat *) {}
79  virtual void polygonToken(GLfloat *) {}
80  virtual void bitmapToken(GLfloat *) {}
81  virtual void drawPixelToken(GLfloat *) {}
82  virtual void copyPixelToken(GLfloat *) {}
83  virtual void end() {}
84 
85 private:
86 
87  bool inGlEntity;
88  bool inGlGraph;
89  bool inNode;
90  bool inEdge;
91  bool inColorInfo;
92  bool needData;
93 
94  std::vector<GLfloat> dataBuffer;
95 
96 };
97 
98 }
99 
100 #endif // Tulip_GLFEEDBACKBUILDER_H
101 ///@endcond