MyGUI  3.2.1
MyGUI_GeometryUtility.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_GEOMETRY_UTILITY_H__
00008 #define __MYGUI_GEOMETRY_UTILITY_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 
00012 namespace MyGUI
00013 {
00014 
00015     typedef std::vector<FloatPoint> VectorFloatPoint;
00016 
00017     namespace geometry_utility
00018     {
00019         VectorFloatPoint cropPolygon(FloatPoint* _baseVerticiesPos, size_t _size, const IntCoord& _cropRectangle);
00020 
00021         enum Side {Left, Right, Top, Bottom};
00022         void cropPolygonSide(VectorFloatPoint& _verticies, int _sideCoord, Side _side);
00023 
00024         // get point position relative to rectangle
00025         FloatPoint getPositionInsideRect(const FloatPoint& _point, const FloatPoint& _corner0, const FloatPoint& _corner1, const FloatPoint& _corner2);
00026 
00027         FloatPoint getUVFromPositionInsideRect(const FloatPoint& _point, const FloatPoint& _v0, const FloatPoint& _v1, const FloatPoint& _baseUV);
00028 
00029     } // namespace geometry_utility
00030 
00031 } // namespace MyGUI
00032 
00033 #endif // __MYGUI_GEOMETRY_UTILITY_H__