Tulip  4.2.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 #include <vector>
25 
26 #include <tulip/Color.h>
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 begin(Vector<float,4>&) {}
59  virtual void colorInfo(GLfloat *) {}
60  virtual void beginGlEntity(GLfloat) {}
61  virtual void endGlEntity() {}
62  virtual void beginGlGraph(GLfloat) {}
63  virtual void endGlGraph() {}
64  virtual void beginNode(GLfloat) {}
65  virtual void endNode() {}
66  virtual void beginEdge(GLfloat) {}
67  virtual void endEdge() {}
68  virtual void passThroughToken(GLfloat *);
69  virtual void pointToken(GLfloat *) {}
70  virtual void lineToken(GLfloat *) {}
71  virtual void lineResetToken(GLfloat *) {}
72  virtual void polygonToken(GLfloat *) {}
73  virtual void bitmapToken(GLfloat *) {}
74  virtual void drawPixelToken(GLfloat *) {}
75  virtual void copyPixelToken(GLfloat *) {}
76  virtual void end() {}
77 
78 private:
79 
80  bool inGlEntity;
81  bool inGlGraph;
82  bool inNode;
83  bool inEdge;
84  bool inColorInfo;
85  bool needData;
86 
87  std::vector<GLfloat> dataBuffer;
88 
89 };
90 
91 }
92 
93 #endif // Tulip_GLFEEDBACKBUILDER_H
94 ///@endcond