MyGUI 3.4.3
MyGUI_PolygonalSkin.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_POLYGONAL_SKIN_H_
8#define MYGUI_POLYGONAL_SKIN_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_Types.h"
13#include "MyGUI_RenderFormat.h"
14#include "MyGUI_VertexData.h"
15
16namespace MyGUI
17{
18
20 {
22
23 public:
25
27 void setPoints(const std::vector<FloatPoint>& _points);
28
30 void setWidth(float _width);
31
33 void setStroke(size_t _value);
34
35 void setAlpha(float _alpha) override;
36
37 void setVisible(bool _visible) override;
38
39 void setStateData(IStateInfo* _data) override;
40
41 void createDrawItem(ITexture* _texture, ILayerNode* _node) override;
42 void destroyDrawItem() override;
43
44 // метод для отрисовки себя
45 void doRender() override;
46
47 /*internal:*/
48 void _updateView() override;
49 void _correctView() override;
50
51 void _setAlign(const IntSize& _oldsize) override;
52
53 void _setUVSet(const FloatRect& _rect) override;
54 void _setColour(const Colour& _value) override;
55
56 protected:
57 void _rebuildGeometry();
58 FloatPoint _getPerpendicular(const FloatPoint& _point1, const FloatPoint& _point2) const;
59 // line from center of p1-p2 line to p3
60 FloatPoint _getMiddleLine(const FloatPoint& _point1, const FloatPoint& _point2, const FloatPoint& _point3)
61 const;
62
63 private:
64 bool mGeometryOutdated{false};
65
66 float mLineWidth{1.0f};
67 size_t mLineStroke{0};
68 std::vector<FloatPoint> mLinePoints;
69 float mLineLength{0.0f};
70
71 std::vector<FloatPoint> mResultVerticiesPos;
72 std::vector<FloatPoint> mResultVerticiesUV;
73
74 size_t mVertexCount{VertexQuad::VertexCount};
75
76 bool mEmptyView{false};
77
78 VertexColourType mVertexFormat;
79 uint32 mCurrentColour{0xFFFFFFFF};
80
81 FloatRect mCurrentTexture;
82 IntCoord mCurrentCoord;
83
84 ILayerNode* mNode{nullptr};
85 RenderItem* mRenderItem{nullptr};
86 };
87
88} // namespace MyGUI
89
90#endif // MYGUI_POLYGONAL_SKIN_H_
#define MYGUI_EXPORT
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:69
uint32_t uint32
Definition MyGUI_Types.h:48
types::TRect< float > FloatRect
Definition MyGUI_Types.h:34
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:36