MyGUI
3.2.0
|
00001 00006 /* 00007 This file is part of MyGUI. 00008 00009 MyGUI is free software: you can redistribute it and/or modify 00010 it under the terms of the GNU Lesser General Public License as published by 00011 the Free Software Foundation, either version 3 of the License, or 00012 (at your option) any later version. 00013 00014 MyGUI is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License 00020 along with MyGUI. If not, see <http://www.gnu.org/licenses/>. 00021 */ 00022 #ifndef __MYGUI_RESOURCE_IMAGE_SET_H__ 00023 #define __MYGUI_RESOURCE_IMAGE_SET_H__ 00024 00025 #include "MyGUI_Prerequest.h" 00026 #include "MyGUI_Macros.h" 00027 #include "MyGUI_XmlDocument.h" 00028 #include "MyGUI_IResource.h" 00029 #include "MyGUI_ImageInfo.h" 00030 #include "MyGUI_Enumerator.h" 00031 #include "MyGUI_ResourceManager.h" 00032 #include "MyGUI_GenericFactory.h" 00033 #include "MyGUI_ResourceImageSetData.h" 00034 00035 namespace MyGUI 00036 { 00037 00038 class ResourceImageSet; 00039 typedef ResourceImageSet* ResourceImageSetPtr; 00040 00041 class MYGUI_EXPORT ResourceImageSet : 00042 public IResource 00043 { 00044 friend class GenericFactory<ResourceImageSet>; 00045 00046 MYGUI_RTTI_DERIVED( ResourceImageSet ) 00047 00048 public: 00049 ImageIndexInfo getIndexInfo(const std::string& _group, const std::string& _index); 00050 ImageIndexInfo getIndexInfo(size_t _group, const std::string& _index); 00051 ImageIndexInfo getIndexInfo(const std::string& _group, size_t _index); 00052 ImageIndexInfo getIndexInfo(size_t _group, size_t _index); 00053 ImageIndexInfo getIndexInfo(const IntSize& _group, size_t _index); 00054 ImageIndexInfo getIndexInfo(const IntSize& _group, const std::string& _index); 00055 00057 EnumeratorGroupImage getEnumerator() const; 00058 00059 private: 00060 ResourceImageSet(); 00061 virtual ~ResourceImageSet(); 00062 00063 virtual void deserialization(xml::ElementPtr _node, Version _version); 00064 00065 size_t getGroupIndex(const std::string& _name); 00066 size_t getGroupIndex(const IntSize& _size); 00067 size_t getImageIndex(GroupImage& _group, const std::string& _name); 00068 const IntSize& getGroupSize(size_t _index); 00069 const IntSize& getGroupSize(const std::string& _group); 00070 00071 private: 00072 VectorGroupImage mGroups; 00073 00074 static std::vector<IntPoint> mFramesEmpty; 00075 }; 00076 00077 } // namespace MyGUI 00078 00079 #endif // __MYGUI_RESOURCE_IMAGE_SET_H__