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,
44 float nodeRot,
bool selected)
45 : glyph(glyph), n(n), lod(lod), nodePos(nodePos), nodeSize(nodeSize), nodeRot(nodeRot),
57 struct TLP_GL_SCOPE EdgeExtremityGlyphData {
59 EdgeExtremityGlyphData() {}
61 EdgeExtremityGlyphData(EdgeExtremityGlyph *glyph, edge e, node source, Color glyphColor,
62 Color glyphBorderColor,
float lod, Coord beginAnchor, Coord srcAnchor,
63 Size size,
bool selected)
64 : glyph(glyph), e(e), source(source), glyphColor(glyphColor),
65 glyphBorderColor(glyphBorderColor), lod(lod), beginAnchor(beginAnchor),
66 srcAnchor(srcAnchor), size(size), selected(selected) {}
68 EdgeExtremityGlyph *glyph;
72 Color glyphBorderColor;
80 class TLP_GL_SCOPE GlGlyphRenderer {
83 GlGlyphRenderer(GlGraphInputData *inputData) : _inputData(inputData), _renderingStarted(false) {}
85 void startRendering();
87 bool renderingHasStarted();
89 void addNodeGlyphRendering(Glyph *glyph, node n,
float lod,
const Coord &nodePos,
90 const Size &nodeSize,
float nodeRot,
bool selected);
92 void addEdgeExtremityGlyphRendering(EdgeExtremityGlyph *glyph, edge e, node source,
93 Color glyphColor, Color glyphBorderColor,
float lod,
94 Coord beginAnchor, Coord srcAnchor, Size size,
bool selected);
99 GlGraphInputData *_inputData;
100 bool _renderingStarted;
101 std::vector<NodeGlyphData> _nodeGlyphsToRender;
102 std::vector<EdgeExtremityGlyphData> _edgeExtremityGlyphsToRender;
103 static GlShaderProgram *_glyphShader;
104 static GlBox *_selectionBox;
108 #endif // GLYPHRENDERER_H