Tulip  4.7.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
GlGraphHighDetailsRenderer.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
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 
47  GlGraphHighDetailsRenderer(const GlGraphInputData *inputData);
48  GlGraphHighDetailsRenderer(const GlGraphInputData *inputData,GlScene *scene);
49 
50  ~GlGraphHighDetailsRenderer();
51 
52  virtual void draw(float lod,Camera* camera);
53 
54  virtual void selectEntities(Camera *camera,RenderingEntitiesFlag type, int x, int y, int w, int h, std::vector<SelectedEntity>& selectedEntities);
55 
56 protected:
57 
58  void initSelectionRendering(RenderingEntitiesFlag type, int x, int y, int w, int h, std::map<unsigned int, SelectedEntity> &idMap,unsigned int &currentId);
59 
60  void buildSortedList();
61 
62  void drawLabelsForComplexEntities(bool drawSelected,OcclusionTest *occlusionTest,LayerLODUnit &layerLODUnit);
63 
64  GlLODCalculator *lodCalculator;
65 
66 
67  GlScene *baseScene;
68  GlScene *fakeScene;
69  Vec4i selectionViewport;
70 };
71 }
72 
73 #endif
74 ///@endcond