20 #ifndef GLGLYPHRENDERER_H
21 #define GLGLYPHRENDERER_H
23 #include <tulip/Coord.h>
24 #include <tulip/Size.h>
25 #include <tulip/Color.h>
26 #include <tulip/Node.h>
27 #include <tulip/Edge.h>
33 class GlGraphInputData;
34 class GlShaderProgram;
36 class EdgeExtremityGlyph;
39 struct TLP_GL_SCOPE NodeGlyphData {
43 NodeGlyphData(Glyph *glyph, node n,
float lod,
const Coord &nodePos,
const Size &nodeSize,
float nodeRot,
bool selected) :
44 glyph(glyph), n(n), lod(lod), nodePos(nodePos), nodeSize(nodeSize), nodeRot(nodeRot), selected(selected) {}
56 struct TLP_GL_SCOPE EdgeExtremityGlyphData {
58 EdgeExtremityGlyphData() {}
60 EdgeExtremityGlyphData(EdgeExtremityGlyph *glyph, edge e, node source,
61 Color glyphColor, Color glyphBorderColor,
float lod,
62 Coord beginAnchor, Coord srcAnchor, Size size,
bool selected) :
63 glyph(glyph), e(e), source(source), glyphColor(glyphColor), glyphBorderColor(glyphBorderColor),
64 lod(lod), beginAnchor(beginAnchor), srcAnchor(srcAnchor), size(size), selected(selected) {}
66 EdgeExtremityGlyph *glyph;
70 Color glyphBorderColor;
79 class TLP_GL_SCOPE GlGlyphRenderer {
83 GlGlyphRenderer(GlGraphInputData *inputData) :
84 _inputData(inputData), _renderingStarted(false) {}
86 void startRendering();
88 bool renderingHasStarted();
90 void addNodeGlyphRendering(Glyph *glyph, node n,
float lod,
const Coord &nodePos,
91 const Size &nodeSize,
float nodeRot,
bool selected);
93 void addEdgeExtremityGlyphRendering(EdgeExtremityGlyph *glyph, edge e, node source,
94 Color glyphColor, Color glyphBorderColor,
float lod,
95 Coord beginAnchor, Coord srcAnchor, Size size,
bool selected);
101 GlGraphInputData *_inputData;
102 bool _renderingStarted;
103 std::vector<NodeGlyphData> _nodeGlyphsToRender;
104 std::vector<EdgeExtremityGlyphData> _edgeExtremityGlyphsToRender;
105 static GlShaderProgram *_glyphShader;
106 static GlBox* _selectionBox;
112 #endif // GLYPHRENDERER_H