Tulip  4.6.0
Better Visualization Through Research
library/tulip-ogl/include/tulip/GlyphManager.h
00001 /*
00002  *
00003  * This file is part of Tulip (www.tulip-software.org)
00004  *
00005  * Authors: David Auber and the Tulip development Team
00006  * from LaBRI, University of Bordeaux
00007  *
00008  * Tulip is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation, either version 3
00011  * of the License, or (at your option) any later version.
00012  *
00013  * Tulip is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  *
00018  */
00019 ///@cond DOXYGEN_HIDDEN
00020 
00021 #ifndef Tulip_GLYPHMANAGER_H
00022 #define Tulip_GLYPHMANAGER_H
00023 
00024 #ifndef DOXYGEN_NOTFOR_DEVEL
00025 
00026 //#include <string>
00027 
00028 #include <tulip/tulipconf.h>
00029 #include <tulip/Glyph.h>
00030 #include <tulip/MutableContainer.h>
00031 
00032 namespace tlp {
00033 
00034 class GlGraphInputData;
00035 class Graph;
00036 
00037 /** \ brief Singleton class use to store Glyphs plugins
00038  * This class is a singleton use to sore Glyphs plugins
00039  */
00040 class TLP_GL_SCOPE GlyphManager {
00041 
00042 public:
00043 
00044   /**
00045    * Return the singleton (if the singleton doesn't exist this function create it)
00046    */
00047   static GlyphManager &getInst() {
00048     if(!inst)
00049       inst=new GlyphManager();
00050 
00051     return *inst;
00052   }
00053 
00054   /**
00055    * Return the name of glyph with given id
00056    */
00057   std::string glyphName(int id);
00058   /**
00059    * Return the id if glyph with given name
00060    */
00061   int glyphId(const std::string& name);
00062   /**
00063    * Load glyphs plugins
00064    */
00065   void loadGlyphPlugins();
00066 
00067   /**
00068    * Create the glyph list and store it in glyphs parameter
00069    */
00070   void initGlyphList(Graph **graph,GlGraphInputData* glGraphInputData,MutableContainer<Glyph *>& glyphs);
00071   /**
00072    * Clear the glyph list
00073    */
00074   void clearGlyphList(Graph **graph,GlGraphInputData* glGraphInputData,MutableContainer<Glyph *>& glyphs);
00075 
00076 private:
00077 
00078   GlyphManager();
00079 
00080   static GlyphManager* inst;
00081 
00082 };
00083 
00084 }
00085 
00086 #endif // DOXYGEN_NOTFOR_DEVEL
00087 
00088 #endif // Tulip_GLYPHMANAGER_H
00089 ///@endcond
 All Classes Files Functions Variables Enumerations Enumerator Properties