MyGUI  3.2.1
MyGUI_RotatingSkin.h
Go to the documentation of this file.
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_ROTATING_SKIN_H__
00008 #define __MYGUI_ROTATING_SKIN_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_Types.h"
00012 #include "MyGUI_ISubWidgetRect.h"
00013 #include "MyGUI_RenderFormat.h"
00014 
00015 namespace MyGUI
00016 {
00017 
00018     class MYGUI_EXPORT RotatingSkin :
00019         public ISubWidgetRect
00020     {
00021         MYGUI_RTTI_DERIVED( RotatingSkin )
00022 
00023     public:
00024         RotatingSkin();
00025         virtual ~RotatingSkin();
00026 
00028         void setAngle(float _angle);
00030         float getAngle() const;
00031 
00035         void setCenter(const IntPoint& _center);
00037         IntPoint getCenter(bool _local = true) const;
00038 
00039         virtual void setAlpha(float _alpha);
00040 
00041         virtual void setVisible(bool _visible);
00042 
00043         virtual void setStateData(IStateInfo* _data);
00044 
00045         virtual void createDrawItem(ITexture* _texture, ILayerNode* _node);
00046         virtual void destroyDrawItem();
00047 
00048         // метод для отрисовки себя
00049         virtual void doRender();
00050 
00051         /*internal:*/
00052         virtual void _updateView();
00053         virtual void _correctView();
00054 
00055         virtual void _setAlign(const IntSize& _oldsize);
00056 
00057         virtual void _setUVSet(const FloatRect& _rect);
00058         virtual void _setColour(const Colour& _value);
00059 
00060     protected:
00061         void _rebuildGeometry();
00062 
00063     private:
00064         bool mGeometryOutdated;
00065 
00066         float mAngle;
00067         IntPoint mCenterPos;
00068 
00069         enum {RECT_VERTICIES_COUNT = 4, GEOMETRY_VERTICIES_TOTAL_COUNT = 8};
00070         FloatPoint mResultVerticiesPos[GEOMETRY_VERTICIES_TOTAL_COUNT];
00071         FloatPoint mResultVerticiesUV[GEOMETRY_VERTICIES_TOTAL_COUNT];
00072 
00073         bool mEmptyView;
00074 
00075         VertexColourType mVertexFormat;
00076         uint32 mCurrentColour;
00077 
00078         FloatRect mCurrentTexture;
00079         IntCoord mCurrentCoord;
00080 
00081         ILayerNode* mNode;
00082         RenderItem* mRenderItem;
00083     };
00084 
00085 } // namespace MyGUI
00086 
00087 #endif // __MYGUI_ROTATING_SKIN_H__