Tulip  4.6.0
Better Visualization Through Research
library/tulip-gui/include/tulip/GlyphRenderer.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 
00022 #ifndef GLYPHPREVIEWGENERATOR_H
00023 #define GLYPHPREVIEWGENERATOR_H
00024 
00025 #include <map>
00026 
00027 #include <QPixmap>
00028 
00029 #include <tulip/tulipconf.h>
00030 #include <tulip/Node.h>
00031 #include <tulip/Edge.h>
00032 
00033 namespace tlp {
00034 class Graph;
00035 
00036 
00037 /**
00038   * @brief Generate Qt previews for Glyphs plug-ins.
00039   **/
00040 class TLP_QT_SCOPE GlyphRenderer {
00041 public:
00042   static GlyphRenderer & getInst();
00043   ~GlyphRenderer();
00044   /**
00045     * @brief Get the preview for the glyph with the given Id.
00046     */
00047   QPixmap render(unsigned int pluginId);
00048 
00049 private:
00050   GlyphRenderer();
00051   static GlyphRenderer* _instance;
00052   std::map<unsigned int,QPixmap> _previews;
00053   tlp::Graph* _graph;
00054   tlp::node _node;
00055 };
00056 
00057 /**
00058   * @brief Generate Qt previews for edge extremities glyphs plug-ins.
00059   **/
00060 class TLP_QT_SCOPE EdgeExtremityGlyphRenderer {
00061 public:
00062 
00063   ~EdgeExtremityGlyphRenderer();
00064   static EdgeExtremityGlyphRenderer & getInst();
00065   /**
00066     * @brief Get the preview for the edge extremity glyph with the given Id.
00067     */
00068   QPixmap render(unsigned int pluginId);
00069 
00070 private:
00071   EdgeExtremityGlyphRenderer();
00072   static EdgeExtremityGlyphRenderer* _instance;
00073   std::map<unsigned int,QPixmap> _previews;
00074   tlp::Graph* _graph;
00075   tlp::edge _edge;
00076 
00077 };
00078 }
00079 #endif // GLYPHPREVIEWGENERATOR_H
00080 ///@endcond
 All Classes Files Functions Variables Enumerations Enumerator Properties