Tulip  5.0.0
Large graphs analysis and drawing
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
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 #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 <tulip/tulipconf.h>
35 #include <tulip/Vector.h>
36 
37 namespace tlp {
38 
39 //====================================================
40 typedef struct _FeedBack3Dcolor {
41  GLfloat x;
42  GLfloat y;
43  GLfloat z;
44  GLfloat red;
45  GLfloat green;
46  GLfloat blue;
47  GLfloat alpha;
48 } Feedback3Dcolor;
49 
50 //====================================================
51 typedef struct _DepthIndex {
52  GLfloat *ptr;
53  GLfloat depth;
54 } DepthIndex;
55 
56 //====================================================
57 /**
58  * Abstract class used to build a object with a OpenGl feedback buffer
59  */
60 class TLP_GL_SCOPE GlFeedBackBuilder {
61 
62 public:
63 
64  virtual ~GlFeedBackBuilder() {}
65 
66  virtual void begin(const Vector<int, 4> &, GLfloat *, GLfloat , GLfloat) {}
67  virtual void passThroughToken(GLfloat*) {}
68  virtual void pointToken(GLfloat*) {}
69  virtual void lineToken(GLfloat*) {}
70  virtual void lineResetToken(GLfloat*) {}
71  virtual void polygonToken(GLfloat*) {}
72  virtual void bitmapToken(GLfloat*) {}
73  virtual void drawPixelToken(GLfloat*) {}
74  virtual void copyPixelToken(GLfloat*) {}
75  virtual void end() {}
76 
77  virtual void getResult(std::string* str) = 0;
78 
79 };
80 
81 }
82 
83 #endif // Tulip_GLFEEDBACKBUILDER_H
84 ///@endcond