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