Tulip 5.7.1
Large graphs analysis and drawing
Loading...
Searching...
No Matches
GlGraphHighDetailsRenderer.h
1/*
2 *
3 * This file is part of Tulip (https://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_GLGRAPHHIGHDETAILSRENDERER_H
22#define Tulip_GLGRAPHHIGHDETAILSRENDERER_H
23
24#include <tulip/GlGraphRenderer.h>
25
26#include <unordered_map>
27
28namespace tlp {
29
30class Graph;
31class GlScene;
32struct OcclusionTest;
33
34/** \brief Class to display graph with old rendering engine
35 *
36 * This class display graph with :
37 * - Nodes and edges shapes
38 * - LOD system
39 * With this renderer you can perform selection
40 *
41 * See GlGraphRenderer documentation for functions documentations
42 */
43class TLP_GL_SCOPE GlGraphHighDetailsRenderer : public GlGraphRenderer {
44
45public:
46 GlGraphHighDetailsRenderer(const GlGraphInputData *inputData, GlScene *scene = nullptr);
47
48 ~GlGraphHighDetailsRenderer() override;
49
50 void draw(float lod, Camera *camera) override;
51
52 void selectEntities(Camera *camera, RenderingEntitiesFlag type, int x, int y, int w, int h,
53 std::vector<SelectedEntity> &selectedEntities) override;
54
55protected:
56 void initSelectionRendering(RenderingEntitiesFlag type, int x, int y, int w, int h,
57 std::unordered_map<unsigned int, SelectedEntity> &idMap,
58 unsigned int &currentId);
59
60 void buildSortedList();
61
62 void drawLabelsForComplexEntities(bool drawSelected, OcclusionTest *occlusionTest,
63 LayerLODUnit &layerLODUnit);
64
65 GlLODCalculator *lodCalculator;
66
67 GlScene *baseScene;
68 GlScene *fakeScene;
69 Vec4i selectionViewport;
70};
71} // namespace tlp
72
73#endif
74///@endcond