Tulip  5.2.0
Large graphs analysis and drawing
GlGraphHighDetailsRenderer.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_GLGRAPHHIGHDETAILSRENDERER_H
22 #define Tulip_GLGRAPHHIGHDETAILSRENDERER_H
23 
24 #include <tulip/GlGraphRenderer.h>
25 
26 #include <map>
27 
28 namespace tlp {
29 
30 class Graph;
31 class GlScene;
32 struct 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  */
43 class TLP_GL_SCOPE GlGraphHighDetailsRenderer : public GlGraphRenderer {
44 
45 public:
46  GlGraphHighDetailsRenderer(const GlGraphInputData *inputData);
47  GlGraphHighDetailsRenderer(const GlGraphInputData *inputData, GlScene *scene);
48 
49  ~GlGraphHighDetailsRenderer() override;
50 
51  void draw(float lod, Camera *camera) override;
52 
53  void selectEntities(Camera *camera, RenderingEntitiesFlag type, int x, int y, int w, int h,
54  std::vector<SelectedEntity> &selectedEntities) override;
55 
56 protected:
57  void initSelectionRendering(RenderingEntitiesFlag type, int x, int y, int w, int h,
58  std::map<unsigned int, SelectedEntity> &idMap,
59  unsigned int &currentId);
60 
61  void buildSortedList();
62 
63  void drawLabelsForComplexEntities(bool drawSelected, OcclusionTest *occlusionTest,
64  LayerLODUnit &layerLODUnit);
65 
66  GlLODCalculator *lodCalculator;
67 
68  GlScene *baseScene;
69  GlScene *fakeScene;
70  Vec4i selectionViewport;
71 };
72 }
73 
74 #endif
75 ///@endcond