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