Tulip  4.2.0
Better Visualization Through Research
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Groups Pages
GlyphManager.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 #ifndef Tulip_GLYPHMANAGER_H
22 #define Tulip_GLYPHMANAGER_H
23 
24 #ifndef DOXYGEN_NOTFOR_DEVEL
25 
26 #include <string>
27 #include <cassert>
28 
29 #include <tulip/tulipconf.h>
30 #include <tulip/Glyph.h>
31 
32 namespace tlp {
33 
34 /** \ brief Singleton class use to store Glyphs plugins
35  * This class is a singleton use to sore Glyphs plugins
36  */
37 class TLP_GL_SCOPE GlyphManager {
38 
39 public:
40 
41  /**
42  * Return the singleton (if the singleton doesn't exist this function create it)
43  */
44  static GlyphManager &getInst() {
45  if(!inst)
46  inst=new GlyphManager();
47 
48  return *inst;
49  }
50 
51  /**
52  * Return the name of glyph with given id
53  */
54  std::string glyphName(int id);
55  /**
56  * Return the id if glyph with given name
57  */
58  int glyphId(std::string name);
59  /**
60  * Load glyphs plugins
61  */
62  void loadGlyphPlugins();
63 
64  /**
65  * Create the glyph list and store it in glyphs parameter
66  */
67  void initGlyphList(Graph **graph,GlGraphInputData* glGraphInputData,MutableContainer<Glyph *>& glyphs);
68  /**
69  * Clear the glyph list
70  */
71  void clearGlyphList(Graph **graph,GlGraphInputData* glGraphInputData,MutableContainer<Glyph *>& glyphs);
72 
73 private:
74 
75  GlyphManager();
76 
77  static GlyphManager* inst;
78 
79 };
80 
81 }
82 
83 #endif // DOXYGEN_NOTFOR_DEVEL
84 
85 #endif // Tulip_GLYPHMANAGER_H
86 ///@endcond