MyGUI 3.2.2

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_GeometryUtility.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_GEOMETRY_UTILITY_H_
8 #define MYGUI_GEOMETRY_UTILITY_H_
9
10 #include "MyGUI_Prerequest.h"
11
12 namespace MyGUI
13 {
14
15 typedef std::vector<FloatPoint> VectorFloatPoint;
16
17 namespace geometry_utility
18 {
19 VectorFloatPoint cropPolygon(FloatPoint* _baseVerticiesPos, size_t _size, const IntCoord& _cropRectangle);
20
21 enum Side {Left, Right, Top, Bottom};
22 void cropPolygonSide(VectorFloatPoint& _verticies, int _sideCoord, Side _side);
23
24 // get point position relative to rectangle
25 FloatPoint getPositionInsideRect(const FloatPoint& _point, const FloatPoint& _corner0, const FloatPoint& _corner1, const FloatPoint& _corner2);
26
27 FloatPoint getUVFromPositionInsideRect(const FloatPoint& _point, const FloatPoint& _v0, const FloatPoint& _v1, const FloatPoint& _baseUV);
28
29 } // namespace geometry_utility
30
31 } // namespace MyGUI
32
33 #endif // MYGUI_GEOMETRY_UTILITY_H_
MyGUI::types::TCoord< int >
MyGUI::geometry_utility::Left
Definition: MyGUI_GeometryUtility.h:21
MyGUI::geometry_utility::getPositionInsideRect
FloatPoint getPositionInsideRect(const FloatPoint &_point, const FloatPoint &_corner0, const FloatPoint &_corner1, const FloatPoint &_corner2)
Definition: MyGUI_GeometryUtility.cpp:89
MyGUI::types::TPoint< float >
MyGUI_Prerequest.h
MyGUI::geometry_utility::cropPolygon
VectorFloatPoint cropPolygon(FloatPoint *_baseVerticiesPos, size_t _size, const IntCoord &_cropRectangle)
Definition: MyGUI_GeometryUtility.cpp:16
MyGUI::geometry_utility::Bottom
Definition: MyGUI_GeometryUtility.h:21
MyGUI::geometry_utility::Side
Side
Definition: MyGUI_GeometryUtility.h:21
MyGUI::geometry_utility::Right
Definition: MyGUI_GeometryUtility.h:21
MyGUI::VectorFloatPoint
std::vector< FloatPoint > VectorFloatPoint
Definition: MyGUI_GeometryUtility.h:15
MyGUI::geometry_utility::getUVFromPositionInsideRect
FloatPoint getUVFromPositionInsideRect(const FloatPoint &_point, const FloatPoint &_v0, const FloatPoint &_v1, const FloatPoint &_baseUV)
Definition: MyGUI_GeometryUtility.cpp:105
MyGUI
Definition: MyGUI_ActionController.h:14
MyGUI::geometry_utility::cropPolygonSide
void cropPolygonSide(VectorFloatPoint &_verticies, int _sideCoord, Side _side)
Definition: MyGUI_GeometryUtility.cpp:33
MyGUI::geometry_utility::Top
Definition: MyGUI_GeometryUtility.h:21