| 
									
										
										
										
											2019-04-11 14:40:54 +08:00
										 |  |  |  | // Copyright (c) 2016-2018 Kiwano - Nomango
 | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | // 
 | 
					
						
							|  |  |  |  | // Permission is hereby granted, free of charge, to any person obtaining a copy
 | 
					
						
							|  |  |  |  | // of this software and associated documentation files (the "Software"), to deal
 | 
					
						
							|  |  |  |  | // in the Software without restriction, including without limitation the rights
 | 
					
						
							|  |  |  |  | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 | 
					
						
							|  |  |  |  | // copies of the Software, and to permit persons to whom the Software is
 | 
					
						
							|  |  |  |  | // furnished to do so, subject to the following conditions:
 | 
					
						
							|  |  |  |  | // 
 | 
					
						
							|  |  |  |  | // The above copyright notice and this permission notice shall be included in
 | 
					
						
							|  |  |  |  | // all copies or substantial portions of the Software.
 | 
					
						
							|  |  |  |  | // 
 | 
					
						
							|  |  |  |  | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 | 
					
						
							|  |  |  |  | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 | 
					
						
							|  |  |  |  | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 | 
					
						
							|  |  |  |  | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
					
						
							|  |  |  |  | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
					
						
							|  |  |  |  | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
					
						
							|  |  |  |  | // THE SOFTWARE.
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | #pragma once
 | 
					
						
							| 
									
										
										
										
											2019-08-12 18:30:42 +08:00
										 |  |  |  | #include "Actor.h"
 | 
					
						
							| 
									
										
										
										
											2019-08-14 21:38:37 +08:00
										 |  |  |  | #include "../renderer/Geometry.h"
 | 
					
						
							| 
									
										
										
										
											2019-08-21 16:33:41 +08:00
										 |  |  |  | #include "../renderer/StrokeStyle.h"
 | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-11 14:40:54 +08:00
										 |  |  |  | namespace kiwano | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | { | 
					
						
							| 
									
										
										
										
											2019-08-12 18:30:42 +08:00
										 |  |  |  | 	// <20><>άͼ<CEAC>ν<EFBFBD>ɫ
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 	class KGE_API ShapeActor | 
					
						
							| 
									
										
										
										
											2019-08-14 00:28:25 +08:00
										 |  |  |  | 		: public Actor | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 	{ | 
					
						
							|  |  |  |  | 	public: | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		ShapeActor(); | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		ShapeActor( | 
					
						
							| 
									
										
										
										
											2019-08-26 10:22:58 +08:00
										 |  |  |  | 			Geometry const& geometry | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		virtual ~ShapeActor(); | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 		// <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
 | 
					
						
							| 
									
										
										
										
											2019-08-20 21:15:15 +08:00
										 |  |  |  | 		inline Color GetFillColor() const			{ return fill_color_; } | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 		// <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
 | 
					
						
							| 
									
										
										
										
											2019-08-20 21:15:15 +08:00
										 |  |  |  | 		inline Color GetStrokeColor() const			{ return stroke_color_; } | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 		// <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
 | 
					
						
							| 
									
										
										
										
											2019-09-29 22:23:13 +08:00
										 |  |  |  | 		inline float GetStrokeWidth() const		{ return stroke_width_; } | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-16 00:50:54 +08:00
										 |  |  |  | 		// <20><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
 | 
					
						
							| 
									
										
										
										
											2019-08-20 21:15:15 +08:00
										 |  |  |  | 		inline StrokeStyle SetStrokeStyle() const	{ return stroke_style_; } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		// <20><>ȡ<EFBFBD><C8A1>״
 | 
					
						
							|  |  |  |  | 		inline Geometry GetGeometry() const			{ return geo_; } | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-14 00:28:25 +08:00
										 |  |  |  | 		// <20><>ȡ<EFBFBD>߽<EFBFBD>
 | 
					
						
							|  |  |  |  | 		Rect GetBounds() const override; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 		// <20><>ȡ<EFBFBD><C8A1><EFBFBD>а<EFBFBD>Χ<EFBFBD><CEA7>
 | 
					
						
							| 
									
										
										
										
											2019-08-14 00:28:25 +08:00
										 |  |  |  | 		Rect GetBoundingBox() const override; | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-20 21:15:15 +08:00
										 |  |  |  | 		// <20>жϵ<D0B6><CFB5>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>״<EFBFBD><D7B4>
 | 
					
						
							|  |  |  |  | 		bool ContainsPoint(const Point& point) const override; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 		// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
 | 
					
						
							| 
									
										
										
										
											2019-08-20 21:15:15 +08:00
										 |  |  |  | 		void SetFillColor(const Color& color); | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 		// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɫ
 | 
					
						
							| 
									
										
										
										
											2019-08-20 21:15:15 +08:00
										 |  |  |  | 		void SetStrokeColor(const Color& color); | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 		// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
 | 
					
						
							| 
									
										
										
										
											2019-09-29 22:23:13 +08:00
										 |  |  |  | 		void SetStrokeWidth(float width); | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-16 00:50:54 +08:00
										 |  |  |  | 		// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
 | 
					
						
							| 
									
										
										
										
											2019-08-20 21:15:15 +08:00
										 |  |  |  | 		void SetStrokeStyle(StrokeStyle stroke_style); | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 		// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״
 | 
					
						
							| 
									
										
										
										
											2019-08-26 10:22:58 +08:00
										 |  |  |  | 		void SetGeometry(Geometry const& geometry); | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-20 19:32:36 +08:00
										 |  |  |  | 		void OnRender(RenderTarget* rt) override; | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 	protected: | 
					
						
							| 
									
										
										
										
											2019-08-14 21:38:37 +08:00
										 |  |  |  | 		Color		fill_color_; | 
					
						
							|  |  |  |  | 		Color		stroke_color_; | 
					
						
							| 
									
										
										
										
											2019-09-29 22:23:13 +08:00
										 |  |  |  | 		float		stroke_width_; | 
					
						
							| 
									
										
										
										
											2019-08-16 00:50:54 +08:00
										 |  |  |  | 		StrokeStyle	stroke_style_; | 
					
						
							| 
									
										
										
										
											2019-08-20 21:15:15 +08:00
										 |  |  |  | 		Rect		bounds_; | 
					
						
							| 
									
										
										
										
											2019-08-14 21:38:37 +08:00
										 |  |  |  | 		Geometry	geo_; | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 	}; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-20 19:32:36 +08:00
										 |  |  |  | 	// ֱ<>߽<EFBFBD>ɫ
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 	class KGE_API LineActor | 
					
						
							|  |  |  |  | 		: public ShapeActor | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 	{ | 
					
						
							|  |  |  |  | 	public: | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		LineActor(); | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		LineActor( | 
					
						
							| 
									
										
										
										
											2019-08-27 08:28:14 +08:00
										 |  |  |  | 			Point const& begin, | 
					
						
							|  |  |  |  | 			Point const& end | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		virtual ~LineActor(); | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-27 08:28:14 +08:00
										 |  |  |  | 		inline Point const& GetBeginPoint() const	{ return begin_; } | 
					
						
							|  |  |  |  | 		 | 
					
						
							|  |  |  |  | 		inline Point const& GetEndPoint() const		{ return end_; } | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-27 08:28:14 +08:00
										 |  |  |  | 		inline void SetBeginPoint(Point const& begin) | 
					
						
							|  |  |  |  | 		{ | 
					
						
							|  |  |  |  | 			SetLine(begin, end_); | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		inline void SetEndPoint(Point const& end) | 
					
						
							|  |  |  |  | 		{ | 
					
						
							|  |  |  |  | 			SetLine(begin_, end); | 
					
						
							|  |  |  |  | 		} | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		void SetLine( | 
					
						
							|  |  |  |  | 			Point const& begin, | 
					
						
							|  |  |  |  | 			Point const& end | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	protected: | 
					
						
							| 
									
										
										
										
											2019-08-27 08:28:14 +08:00
										 |  |  |  | 		Point begin_; | 
					
						
							|  |  |  |  | 		Point end_; | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 	}; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-12 18:30:42 +08:00
										 |  |  |  | 	// <20><><EFBFBD>ν<EFBFBD>ɫ
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 	class KGE_API RectActor | 
					
						
							|  |  |  |  | 		: public ShapeActor | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 	{ | 
					
						
							|  |  |  |  | 	public: | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		RectActor(); | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		RectActor( | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 			Size const& size | 
					
						
							|  |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		virtual ~RectActor(); | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-20 19:32:36 +08:00
										 |  |  |  | 		inline Size const& GetRectSize() const { return rect_size_; } | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-27 08:28:14 +08:00
										 |  |  |  | 		void SetRectSize(Size const& size); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 	protected: | 
					
						
							| 
									
										
										
										
											2019-08-20 19:32:36 +08:00
										 |  |  |  | 		Size rect_size_; | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 	}; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-12 18:30:42 +08:00
										 |  |  |  | 	// Բ<>Ǿ<EFBFBD><C7BE>ν<EFBFBD>ɫ
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 	class KGE_API RoundRectActor | 
					
						
							|  |  |  |  | 		: public ShapeActor | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 	{ | 
					
						
							|  |  |  |  | 	public: | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		RoundRectActor(); | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		RoundRectActor( | 
					
						
							| 
									
										
										
										
											2019-08-14 21:38:37 +08:00
										 |  |  |  | 			Size const& size, | 
					
						
							|  |  |  |  | 			Vec2 const& radius | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		virtual ~RoundRectActor(); | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-27 08:28:14 +08:00
										 |  |  |  | 		inline Vec2 GetRadius() const	{ return radius_; } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		inline Size GetRectSize() const	{ return size_; } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 		void SetRadius( | 
					
						
							| 
									
										
										
										
											2019-08-14 21:38:37 +08:00
										 |  |  |  | 			Vec2 const& radius | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-14 21:38:37 +08:00
										 |  |  |  | 		void SetRectSize( | 
					
						
							|  |  |  |  | 			Size const& size | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 		); | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 		void SetRoundedRect( | 
					
						
							| 
									
										
										
										
											2019-08-14 21:38:37 +08:00
										 |  |  |  | 			Size const& size, | 
					
						
							|  |  |  |  | 			Vec2 const& radius | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	protected: | 
					
						
							| 
									
										
										
										
											2019-08-20 19:32:36 +08:00
										 |  |  |  | 		Size rect_size_; | 
					
						
							| 
									
										
										
										
											2019-08-14 21:38:37 +08:00
										 |  |  |  | 		Vec2 radius_; | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 	}; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-12 18:30:42 +08:00
										 |  |  |  | 	// Բ<>ν<EFBFBD>ɫ
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 	class KGE_API CircleActor | 
					
						
							|  |  |  |  | 		: public ShapeActor | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 	{ | 
					
						
							|  |  |  |  | 	public: | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		CircleActor(); | 
					
						
							| 
									
										
										
										
											2019-08-08 14:15:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		CircleActor( | 
					
						
							| 
									
										
										
										
											2019-09-29 22:23:13 +08:00
										 |  |  |  | 			float radius | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		virtual ~CircleActor(); | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-29 22:23:13 +08:00
										 |  |  |  | 		inline float GetRadius() const { return radius_; } | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-29 22:23:13 +08:00
										 |  |  |  | 		void SetRadius(float radius); | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 	protected: | 
					
						
							| 
									
										
										
										
											2019-09-29 22:23:13 +08:00
										 |  |  |  | 		float radius_; | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 	}; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-12 18:30:42 +08:00
										 |  |  |  | 	// <20><>Բ<EFBFBD><D4B2>ɫ
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 	class KGE_API EllipseActor | 
					
						
							|  |  |  |  | 		: public ShapeActor | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 	{ | 
					
						
							|  |  |  |  | 	public: | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		EllipseActor(); | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		EllipseActor( | 
					
						
							| 
									
										
										
										
											2019-08-14 21:38:37 +08:00
										 |  |  |  | 			Vec2 const& radius | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		virtual ~EllipseActor(); | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-14 21:38:37 +08:00
										 |  |  |  | 		Vec2 GetRadius() const { return radius_; } | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 		void SetRadius( | 
					
						
							| 
									
										
										
										
											2019-08-14 21:38:37 +08:00
										 |  |  |  | 			Vec2 const& radius | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	protected: | 
					
						
							| 
									
										
										
										
											2019-08-14 21:38:37 +08:00
										 |  |  |  | 		Vec2 radius_; | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 	}; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-26 10:22:58 +08:00
										 |  |  |  | 	// <20><><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD>ɫ
 | 
					
						
							|  |  |  |  | 	class KGE_API PolygonActor | 
					
						
							|  |  |  |  | 		: public ShapeActor | 
					
						
							|  |  |  |  | 	{ | 
					
						
							|  |  |  |  | 	public: | 
					
						
							|  |  |  |  | 		PolygonActor(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		PolygonActor( | 
					
						
							|  |  |  |  | 			Vector<Point> const& points | 
					
						
							|  |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		virtual ~PolygonActor(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		void SetVertices( | 
					
						
							|  |  |  |  | 			Vector<Point> const& points | 
					
						
							|  |  |  |  | 		); | 
					
						
							|  |  |  |  | 	}; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-12 18:30:42 +08:00
										 |  |  |  | 	// ·<><C2B7><EFBFBD><EFBFBD>ɫ
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 	class KGE_API PathActor | 
					
						
							|  |  |  |  | 		: public ShapeActor | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 	{ | 
					
						
							|  |  |  |  | 	public: | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		PathActor(); | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-08-13 23:21:20 +08:00
										 |  |  |  | 		virtual ~PathActor(); | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  | 		// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
 | 
					
						
							|  |  |  |  | 		void BeginPath( | 
					
						
							|  |  |  |  | 			Point const& begin_pos = Point{}	/* <20><>ʼ<EFBFBD><CABC> */ | 
					
						
							|  |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		// <20><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
 | 
					
						
							|  |  |  |  | 		void EndPath( | 
					
						
							|  |  |  |  | 			bool closed = true		/* ·<><C2B7><EFBFBD>Ƿ<EFBFBD><C7B7>պ<EFBFBD> */ | 
					
						
							|  |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>߶<EFBFBD>
 | 
					
						
							|  |  |  |  | 		void AddLine( | 
					
						
							|  |  |  |  | 			Point const& point		/* <20>˵<EFBFBD> */ | 
					
						
							|  |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		// <20><><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD><EFBFBD>߶<EFBFBD>
 | 
					
						
							|  |  |  |  | 		void AddLines( | 
					
						
							| 
									
										
										
										
											2019-08-13 21:16:38 +08:00
										 |  |  |  | 			Vector<Point> const& points | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>η<EFBFBD><CEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
 | 
					
						
							|  |  |  |  | 		void AddBezier( | 
					
						
							|  |  |  |  | 			Point const& point1,	/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵĵ<DFB5>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD> */ | 
					
						
							|  |  |  |  | 			Point const& point2,	/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵĵڶ<C4B5><DAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD> */ | 
					
						
							|  |  |  |  | 			Point const& point3		/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD><DFB5>յ<EFBFBD> */ | 
					
						
							|  |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		// <20><><EFBFBD>ӻ<EFBFBD><D3BB><EFBFBD>
 | 
					
						
							|  |  |  |  | 		void AddArc( | 
					
						
							|  |  |  |  | 			Point const& point,		/* <20>յ<EFBFBD> */ | 
					
						
							|  |  |  |  | 			Size const& radius,		/* <20><>Բ<EFBFBD>뾶 */ | 
					
						
							| 
									
										
										
										
											2019-09-29 22:23:13 +08:00
										 |  |  |  | 			float rotation,		/* <20><>Բ<EFBFBD><D4B2>ת<EFBFBD>Ƕ<EFBFBD> */ | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 			bool clockwise = true,	/* ˳ʱ<CBB3><CAB1> or <20><>ʱ<EFBFBD><CAB1> */ | 
					
						
							|  |  |  |  | 			bool is_small = true	/* <20>Ƿ<EFBFBD>ȡС<C8A1><D0A1> 180<38><30> <20>Ļ<EFBFBD> */ | 
					
						
							|  |  |  |  | 		); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 		// <20><><EFBFBD><EFBFBD>·<EFBFBD><C2B7>
 | 
					
						
							|  |  |  |  | 		void ClearPath(); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 	protected: | 
					
						
							| 
									
										
										
										
											2019-08-14 21:38:37 +08:00
										 |  |  |  | 		GeometrySink sink_; | 
					
						
							| 
									
										
										
										
											2019-03-31 01:37:06 +08:00
										 |  |  |  | 	}; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | } |