Tulip  5.2.0
Large graphs analysis and drawing
GlFeedBackRecorder.h
1 /*
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
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_GLFEEDBACKRECORDER_H
22 #define Tulip_GLFEEDBACKRECORDER_H
23 
24 #include <tulip/OpenGlIncludes.h>
25 
26 #include <tulip/tulipconf.h>
27 #include <tulip/Vector.h>
28 
29 namespace tlp {
30 
31 class GlFeedBackBuilder;
32 
33 /** \brief Class use to build an object with an OpenGL feedback buffer
34  *
35  * Class use to build an object with an OpenGL feedback buffer
36  * This class call functions of the GlFeedBackBuilder passed to the constructor
37  */
38 class TLP_GL_SCOPE GlFeedBackRecorder {
39 
40 public:
41  /**
42  * Constructor : the recorder use GlFeedBackBuilder : builder
43  */
44  GlFeedBackRecorder(GlFeedBackBuilder *builder, unsigned int pointSize = 7);
45  /**
46  * Record a new feedback buffer
47  * \param doSort : sort the feedback buffer
48  * \param size : size of the feedback buffer
49  * \param feedBackBuffer : the feedback buffer
50  * \param viewport : the viewport of the scene
51  */
52  void record(bool doSort, GLint size, GLfloat *feedBackBuffer, const Vector<int, 4> &viewport);
53 
54 private:
55  void sortAndRecord(GLint size, GLfloat *feedBackBuffer);
56  void record(GLint size, GLfloat *feedBackBuffer);
57  GLfloat *recordPrimitive(GLfloat *loc);
58 
59  GlFeedBackBuilder *feedBackBuilder;
60  unsigned int pointSize;
61 };
62 }
63 
64 #endif // Tulip_GLFEEDBACKRECORDER_H
65 ///@endcond