MyGUI  3.2.1
MyGUI_RotatingSkin.h
Go to the documentation of this file.
1 /*
2  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3  * Distributed under the MIT License
4  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5  */
6 
7 #ifndef __MYGUI_ROTATING_SKIN_H__
8 #define __MYGUI_ROTATING_SKIN_H__
9 
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_Types.h"
12 #include "MyGUI_ISubWidgetRect.h"
13 #include "MyGUI_RenderFormat.h"
14 
15 namespace MyGUI
16 {
17 
19  public ISubWidgetRect
20  {
22 
23  public:
24  RotatingSkin();
25  virtual ~RotatingSkin();
26 
28  void setAngle(float _angle);
30  float getAngle() const;
31 
35  void setCenter(const IntPoint& _center);
37  IntPoint getCenter(bool _local = true) const;
38 
39  virtual void setAlpha(float _alpha);
40 
41  virtual void setVisible(bool _visible);
42 
43  virtual void setStateData(IStateInfo* _data);
44 
45  virtual void createDrawItem(ITexture* _texture, ILayerNode* _node);
46  virtual void destroyDrawItem();
47 
48  // метод для отрисовки себя
49  virtual void doRender();
50 
51  /*internal:*/
52  virtual void _updateView();
53  virtual void _correctView();
54 
55  virtual void _setAlign(const IntSize& _oldsize);
56 
57  virtual void _setUVSet(const FloatRect& _rect);
58  virtual void _setColour(const Colour& _value);
59 
60  protected:
61  void _rebuildGeometry();
62 
63  private:
64  bool mGeometryOutdated;
65 
66  float mAngle;
67  IntPoint mCenterPos;
68 
69  enum {RECT_VERTICIES_COUNT = 4, GEOMETRY_VERTICIES_TOTAL_COUNT = 8};
70  FloatPoint mResultVerticiesPos[GEOMETRY_VERTICIES_TOTAL_COUNT];
71  FloatPoint mResultVerticiesUV[GEOMETRY_VERTICIES_TOTAL_COUNT];
72 
73  bool mEmptyView;
74 
75  VertexColourType mVertexFormat;
76  uint32 mCurrentColour;
77 
78  FloatRect mCurrentTexture;
79  IntCoord mCurrentCoord;
80 
81  ILayerNode* mNode;
82  RenderItem* mRenderItem;
83  };
84 
85 } // namespace MyGUI
86 
87 #endif // __MYGUI_ROTATING_SKIN_H__