New lua versions
[ryzomcore.git] / studio / src / plugins / landscape_editor / pixmap_database.h
blobc4c67aacff9d0eadbf6324361af913164b144b57
1 // Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2011 Dzmitry KAMIAHIN (dnk-88) <dnk-88@tut.by>
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef PIXMAP_DATABASE_H
18 #define PIXMAP_DATABASE_H
20 // Project includes
21 #include "landscape_editor_global.h"
23 // NeL includes
24 #include <nel/ligo/zone_bank.h>
26 // Qt includes
27 #include <QtCore/QString>
28 #include <QtCore/QMap>
29 #include <QtGui/QPixmap>
31 namespace LandscapeEditor
34 /**
35 @class PixmapDatabase
36 @brief PixmapDatabase contains the image database
37 @details
39 class LANDSCAPE_EDITOR_EXPORT PixmapDatabase
41 public:
42 explicit PixmapDatabase(int textureSize = 256);
43 ~PixmapDatabase();
45 /// Load all images(png) from zonePath, list images gets from zoneBank
46 bool loadPixmaps(const QString &zonePath, NLLIGO::CZoneBank &zoneBank, bool displayProgress = false);
48 /// Unload all images
49 void reset();
51 /// Get list names all loaded pixmaps
52 QStringList listPixmaps() const;
54 /// Get original pixmap
55 /// @return QPixmap* if the image is in the database ;
56 /// otherwise returns pixmap which contains error message.
57 QPixmap *pixmap(const QString &zoneName) const;
59 int textureSize() const;
61 private:
63 int m_textureSize;
64 QPixmap *m_errorPixmap;
65 QMap<QString, QPixmap *> m_pixmapMap;
68 } /* namespace LandscapeEditor */
70 #endif // PIXMAP_DATABASE_H