Tulip  5.7.4
Large graphs analysis and drawing
GlMetaNodeRenderer.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_GLMETANODERENDERER_H
22 #define Tulip_GLMETANODERENDERER_H
23 
24 #include <tulip/tulipconf.h>
25 #include <tulip/Observable.h>
26 #include <unordered_map>
27 
28 namespace tlp {
29 
30 class GlGraphInputData;
31 class Camera;
32 class Graph;
33 class GlScene;
34 
35 /**
36  * Class used to render a meta node
37  */
38 class TLP_GL_SCOPE GlMetaNodeRenderer : public Observable {
39 
40 public:
41  GlMetaNodeRenderer(GlGraphInputData *inputData);
42 
43  ~GlMetaNodeRenderer() override;
44 
45  virtual void render(node, float, Camera *);
46 
47  virtual void setInputData(GlGraphInputData *inputData);
48 
49  virtual GlGraphInputData *getInputData() const;
50 
51  GlScene *getSceneForMetaGraph(Graph *g) const;
52 
53 protected:
54  void clearScenes();
55 
56  void treatEvent(const Event &) override;
57 
58  virtual GlScene *createScene(Graph *) const;
59 
60 private:
61  GlGraphInputData *_inputData;
62  std::unordered_map<Graph *, GlScene *> _metaGraphToSceneMap;
63 };
64 } // namespace tlp
65 
66 #endif // Tulip_GLMETANODERENDERER_H
67 ///@endcond