MyGUI_PolygonalSkin.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_POLYGONAL_SKIN_H_
#define MYGUI_POLYGONAL_SKIN_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_Types.h"
#include "MyGUI_ISubWidgetRect.h"
#include "MyGUI_RenderFormat.h"
#include "MyGUI_VertexData.h"
namespace MyGUI
{
class MYGUI_EXPORT PolygonalSkin : public ISubWidgetRect
{
MYGUI_RTTI_DERIVED(PolygonalSkin)
public:
PolygonalSkin();
void setPoints(const std::vector<FloatPoint>& _points);
void setWidth(float _width);
void setStroke(size_t _value);
void setAlpha(float _alpha) override;
void setVisible(bool _visible) override;
void setStateData(IStateInfo* _data) override;
void createDrawItem(ITexture* _texture, ILayerNode* _node) override;
void destroyDrawItem() override;
// метод для отрисовки себя
void doRender() override;
/*internal:*/
void _updateView() override;
void _correctView() override;
void _setAlign(const IntSize& _oldsize) override;
void _setUVSet(const FloatRect& _rect) override;
void _setColour(const Colour& _value) override;
protected:
void _rebuildGeometry();
FloatPoint _getPerpendicular(const FloatPoint& _point1, const FloatPoint& _point2) const;
// line from center of p1-p2 line to p3
FloatPoint _getMiddleLine(const FloatPoint& _point1, const FloatPoint& _point2, const FloatPoint& _point3)
const;
private:
bool mGeometryOutdated{false};
float mLineWidth{1.0f};
size_t mLineStroke{0};
std::vector<FloatPoint> mLinePoints;
float mLineLength{0.0f};
std::vector<FloatPoint> mResultVerticiesPos;
std::vector<FloatPoint> mResultVerticiesUV;
size_t mVertexCount{VertexQuad::VertexCount};
bool mEmptyView{false};
VertexColourType mVertexFormat;
uint32 mCurrentColour{0xFFFFFFFF};
FloatRect mCurrentTexture;
IntCoord mCurrentCoord;
ILayerNode* mNode{nullptr};
RenderItem* mRenderItem{nullptr};
};
} // namespace MyGUI
#endif // MYGUI_POLYGONAL_SKIN_H_
MyGUI_ISubWidgetRect.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:69
MyGUI_RenderFormat.h
MyGUI_Types.h
MyGUI_VertexData.h
MyGUI::ILayerNode
Definition MyGUI_ILayerNode.h:29
MyGUI::IStateInfo
Definition MyGUI_IStateInfo.h:17
MyGUI::ISubWidgetRect
Definition MyGUI_ISubWidgetRect.h:18
MyGUI::ITexture
Definition MyGUI_ITexture.h:28
MyGUI::PolygonalSkin::PolygonalSkin
PolygonalSkin()
Definition MyGUI_PolygonalSkin.cpp:17
MyGUI::PolygonalSkin::_getMiddleLine
FloatPoint _getMiddleLine(const FloatPoint &_point1, const FloatPoint &_point2, const FloatPoint &_point3) const
Definition MyGUI_PolygonalSkin.cpp:517
MyGUI::PolygonalSkin::_correctView
void _correctView() override
Definition MyGUI_PolygonalSkin.cpp:108
MyGUI::PolygonalSkin::destroyDrawItem
void destroyDrawItem() override
Definition MyGUI_PolygonalSkin.cpp:207
MyGUI::PolygonalSkin::_rebuildGeometry
void _rebuildGeometry()
Definition MyGUI_PolygonalSkin.cpp:274
MyGUI::PolygonalSkin::createDrawItem
void createDrawItem(ITexture *_texture, ILayerNode *_node) override
Definition MyGUI_PolygonalSkin.cpp:198
MyGUI::PolygonalSkin::_setAlign
void _setAlign(const IntSize &_oldsize) override
Definition MyGUI_PolygonalSkin.cpp:116
MyGUI::PolygonalSkin::_getPerpendicular
FloatPoint _getPerpendicular(const FloatPoint &_point1, const FloatPoint &_point2) const
Definition MyGUI_PolygonalSkin.cpp:504
MyGUI::PolygonalSkin::setPoints
void setPoints(const std::vector< FloatPoint > &_points)
Definition MyGUI_PolygonalSkin.cpp:27
MyGUI::PolygonalSkin::setStateData
void setStateData(IStateInfo *_data) override
Definition MyGUI_PolygonalSkin.cpp:259
MyGUI::PolygonalSkin::setVisible
void setVisible(bool _visible) override
Definition MyGUI_PolygonalSkin.cpp:87
MyGUI::PolygonalSkin::setAlpha
void setAlpha(float _alpha) override
Definition MyGUI_PolygonalSkin.cpp:99
MyGUI::PolygonalSkin::_setUVSet
void _setUVSet(const FloatRect &_rect) override
Definition MyGUI_PolygonalSkin.cpp:264
MyGUI::PolygonalSkin::setWidth
void setWidth(float _width)
Definition MyGUI_PolygonalSkin.cpp:75
MyGUI::PolygonalSkin::_updateView
void _updateView() override
Definition MyGUI_PolygonalSkin.cpp:157
MyGUI::PolygonalSkin::doRender
void doRender() override
Definition MyGUI_PolygonalSkin.cpp:216
MyGUI::PolygonalSkin::_setColour
void _setColour(const Colour &_value) override
Definition MyGUI_PolygonalSkin.cpp:250
MyGUI::PolygonalSkin::setStroke
void setStroke(size_t _value)
Definition MyGUI_PolygonalSkin.cpp:81
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::uint32
uint32_t uint32
Definition MyGUI_Types.h:48
MyGUI::FloatRect
types::TRect< float > FloatRect
Definition MyGUI_Types.h:34
MyGUI::FloatPoint
types::TPoint< float > FloatPoint
Definition MyGUI_Types.h:28
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:36
MyGUI::IntSize
types::TSize< int > IntSize
Definition MyGUI_Types.h:30
MyGUI::Colour
Definition MyGUI_Colour.h:17