21 #ifndef Tulip_GLVERTEXARRAYMANAGER_H
22 #define Tulip_GLVERTEXARRAYMANAGER_H
26 #include <tulip/OpenGlConfigManager.h>
28 #include <tulip/tulipconf.h>
29 #include <tulip/Coord.h>
30 #include <tulip/Color.h>
31 #include <tulip/Size.h>
32 #include <tulip/tuliphash.h>
33 #include <tulip/Observable.h>
34 #include <tulip/PropertyInterface.h>
43 class GlGraphInputData;
49 class TLP_GL_SCOPE GlVertexArrayManager :
private Observable {
57 GlVertexArrayManager(GlGraphInputData *inputData);
59 ~GlVertexArrayManager();
64 void setInputData(GlGraphInputData *inputData);
69 inline bool renderingIsBegin() {
81 void setHaveToComputeAll(
bool compute);
85 void setHaveToComputeLayout(
bool compute);
89 void setHaveToComputeColor(
bool compute);
95 void beginRendering();
105 void addEdge(GlEdge *edge);
109 void addNode(GlNode *node);
115 void pauseRendering(
bool pause);
120 void activate(
bool act);
129 void activateLineEdgeDisplay(GlEdge *edge,
bool selected);
133 void activateQuadEdgeDisplay(GlEdge *edge,
bool selected);
137 void activatePointEdgeDisplay(GlEdge *edge,
bool selected);
141 void activatePointNodeDisplay(GlNode *node,
bool onePixel,
bool selected);
146 void treatEvent(
const Event&);
148 void clearLayoutData();
149 void clearColorData();
151 void initObservers();
152 void clearObservers(PropertyInterface *deletedProperty=NULL);
154 GlGraphInputData *inputData;
156 bool graphObserverActivated;
157 bool layoutObserverActivated;
158 bool colorObserverActivated;
163 bool toComputeLayout;
166 bool vectorLayoutSizeInit;
167 bool vectorColorSizeInit;
168 bool vectorIndexSizeInit;
170 bool colorInterpolate;
171 bool sizeInterpolate;
174 std::vector<Coord> linesCoordsArray;
175 std::vector<Color> linesColorsArray;
176 std::vector<GLint> linesIndexArray;
177 std::vector<GLsizei> linesIndexCountArray;
179 std::vector<GLint> linesRenderingStartIndexArray;
180 std::vector<GLsizei> linesRenderingCountArray;
181 std::vector<GLint> linesSelectedRenderingStartIndexArray;
182 std::vector<GLsizei> linesSelectedRenderingCountArray;
184 std::vector<Coord> quadsCoordsArray;
185 std::vector<Color> quadsColorsArray;
186 std::vector<Color> quadsOutlineColorsArray;
187 std::vector<GLint> quadsIndexArray;
188 std::vector<GLsizei> quadsIndexCountArray;
189 std::vector<std::vector<GLuint> > quadsBottomOutlineIndexArray;
190 std::vector<std::vector<GLuint> > quadsTopOutlineIndexArray;
192 std::vector<GLint> quadsRenderingStartIndexArray;
193 std::vector<GLsizei> quadsRenderingCountArray;
194 std::vector<GLint> quadsSelectedRenderingStartIndexArray;
195 std::vector<GLsizei> quadsSelectedRenderingCountArray;
196 std::map<float, std::vector<const GLuint* > > quadsOutlineRenderingIndexArray;
197 std::map<float, std::vector<GLsizei> > quadsOutlineRenderingCountArray;
198 std::map<float, std::vector<const GLuint* > > quadsOutlineSelectedRenderingIndexArray;
199 std::map<float, std::vector<GLsizei> > quadsOutlineSelectedRenderingCountArray;
201 std::vector<Coord> pointsCoordsArray;
202 std::vector<Color> pointsColorsArray;
204 std::vector<GLuint> points1PNodesRenderingIndexArray;
205 std::vector<GLuint> points1PNodesSelectedRenderingIndexArray;
206 std::vector<GLuint> points2PNodesRenderingIndexArray;
207 std::vector<GLuint> points2PNodesSelectedRenderingIndexArray;
208 std::vector<GLuint> points1PEdgesRenderingIndexArray;
209 std::vector<GLuint> points1PEdgesSelectedRenderingIndexArray;
211 std::vector<std::pair<unsigned int,unsigned int> > edgeToLineIndexVector;
212 std::vector<std::pair<unsigned int,unsigned int> > edgeToQuadIndexVector;
213 std::vector<unsigned int> edgeToBottomOulineIndexVector;
214 std::vector<unsigned int> edgeToTopOutlineIndexVector;
215 std::vector<unsigned int> edgeToPointIndexVector;
216 std::vector<unsigned int> nodeToPointIndexVector;