MyGUI
3.2.1
|
00001 /* 00002 * This source file is part of MyGUI. For the latest info, see http://mygui.info/ 00003 * Distributed under the MIT License 00004 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT) 00005 */ 00006 00007 #ifndef __MYGUI_RESOURCE_IMAGE_SET_H__ 00008 #define __MYGUI_RESOURCE_IMAGE_SET_H__ 00009 00010 #include "MyGUI_Prerequest.h" 00011 #include "MyGUI_Macros.h" 00012 #include "MyGUI_XmlDocument.h" 00013 #include "MyGUI_IResource.h" 00014 #include "MyGUI_ImageInfo.h" 00015 #include "MyGUI_Enumerator.h" 00016 #include "MyGUI_ResourceManager.h" 00017 #include "MyGUI_GenericFactory.h" 00018 #include "MyGUI_ResourceImageSetData.h" 00019 00020 namespace MyGUI 00021 { 00022 00023 class ResourceImageSet; 00024 typedef ResourceImageSet* ResourceImageSetPtr; 00025 00026 class MYGUI_EXPORT ResourceImageSet : 00027 public IResource 00028 { 00029 friend class GenericFactory<ResourceImageSet>; 00030 00031 MYGUI_RTTI_DERIVED( ResourceImageSet ) 00032 00033 public: 00034 ImageIndexInfo getIndexInfo(const std::string& _group, const std::string& _index); 00035 ImageIndexInfo getIndexInfo(size_t _group, const std::string& _index); 00036 ImageIndexInfo getIndexInfo(const std::string& _group, size_t _index); 00037 ImageIndexInfo getIndexInfo(size_t _group, size_t _index); 00038 ImageIndexInfo getIndexInfo(const IntSize& _group, size_t _index); 00039 ImageIndexInfo getIndexInfo(const IntSize& _group, const std::string& _index); 00040 00042 EnumeratorGroupImage getEnumerator() const; 00043 00044 void AddGroupImage(const GroupImage& _group); 00045 00046 private: 00047 ResourceImageSet(); 00048 virtual ~ResourceImageSet(); 00049 00050 virtual void deserialization(xml::ElementPtr _node, Version _version); 00051 00052 size_t getGroupIndex(const std::string& _name); 00053 size_t getGroupIndex(const IntSize& _size); 00054 size_t getImageIndex(GroupImage& _group, const std::string& _name); 00055 const IntSize& getGroupSize(size_t _index); 00056 const IntSize& getGroupSize(const std::string& _group); 00057 00058 private: 00059 VectorGroupImage mGroups; 00060 00061 static std::vector<IntPoint> mFramesEmpty; 00062 }; 00063 00064 } // namespace MyGUI 00065 00066 #endif // __MYGUI_RESOURCE_IMAGE_SET_H__