Tulip  4.1.0
Better Visualization Through Research
 All Classes Files Functions Variables Enumerations Enumerator Properties Groups Pages
GlFeedBackBuilder.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_GLFEEDBACKBUILDER_H
22 #define Tulip_GLFEEDBACKBUILDER_H
23 
24 #include <tulip/tulipconf.h>
25 
26 #include <string>
27 #include <tulip/OpenGlConfigManager.h>
28 
29 #include <tulip/Vector.h>
30 
31 namespace tlp {
32 
33 //====================================================
34 typedef struct _FeedBack3Dcolor {
35  GLfloat x;
36  GLfloat y;
37  GLfloat z;
38  GLfloat red;
39  GLfloat green;
40  GLfloat blue;
41  GLfloat alpha;
42 } Feedback3Dcolor;
43 
44 //====================================================
45 typedef struct _DepthIndex {
46  GLfloat *ptr;
47  GLfloat depth;
48 } DepthIndex;
49 
50 //====================================================
51 /**
52  * Abstract class used to build a object with a OpenGl feedback buffer
53  */
54 class TLP_GL_SCOPE GlFeedBackBuilder {
55 
56 public:
57 
58  virtual ~GlFeedBackBuilder() {}
59 
60  virtual void begin(const Vector<int, 4> &) {}
61  virtual void passThroughToken(GLfloat*) {}
62  virtual void pointToken(GLfloat*) {}
63  virtual void lineToken(GLfloat*) {}
64  virtual void lineResetToken(GLfloat*) {}
65  virtual void polygonToken(GLfloat*) {}
66  virtual void bitmapToken(GLfloat*) {}
67  virtual void drawPixelToken(GLfloat*) {}
68  virtual void copyPixelToken(GLfloat*) {}
69  virtual void end() {}
70 
71  virtual void getResult(std::string* str) = 0;
72 
73 };
74 
75 }
76 
77 #endif // Tulip_GLFEEDBACKBUILDER_H
78 ///@endcond