Tulip  4.4.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
GlyphRenderer.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 1 and Inria Bordeaux - Sud Ouest
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 
22 #ifndef GLYPHPREVIEWGENERATOR_H
23 #define GLYPHPREVIEWGENERATOR_H
24 
25 #include <map>
26 
27 #include <QPixmap>
28 
29 #include <tulip/tulipconf.h>
30 #include <tulip/Node.h>
31 #include <tulip/Edge.h>
32 
33 namespace tlp {
34 class Graph;
35 
36 
37 /**
38  * @brief Generate Qt previews for Glyphs plug-ins.
39  **/
40 class TLP_QT_SCOPE GlyphRenderer {
41 public:
42  static GlyphRenderer & getInst();
43  ~GlyphRenderer();
44  /**
45  * @brief Get the preview for the glyph with the given Id.
46  */
47  QPixmap render(unsigned int pluginId);
48 
49 private:
50  GlyphRenderer();
51  static GlyphRenderer* _instance;
52  std::map<unsigned int,QPixmap> _previews;
53  tlp::Graph* _graph;
54  tlp::node _node;
55 };
56 
57 /**
58  * @brief Generate Qt previews for edge extremities glyphs plug-ins.
59  **/
60 class TLP_QT_SCOPE EdgeExtremityGlyphRenderer {
61 public:
62 
63  ~EdgeExtremityGlyphRenderer();
64  static EdgeExtremityGlyphRenderer & getInst();
65  /**
66  * @brief Get the preview for the edge extremity glyph with the given Id.
67  */
68  QPixmap render(unsigned int pluginId);
69 
70 private:
71  EdgeExtremityGlyphRenderer();
72  static EdgeExtremityGlyphRenderer* _instance;
73  std::map<unsigned int,QPixmap> _previews;
74  tlp::Graph* _graph;
75  tlp::edge _edge;
76 
77 };
78 }
79 #endif // GLYPHPREVIEWGENERATOR_H
80 ///@endcond