[deploy] Remove PathShapeActor

This commit is contained in:
Nomango 2020-02-03 11:11:43 +08:00
parent 9e80afb945
commit dff97d8249
8 changed files with 15 additions and 190 deletions

View File

@ -219,53 +219,4 @@ void PolygonActor::SetVertices(Vector<Point> const& points)
}
}
//-------------------------------------------------------
// PathShapeActor
//-------------------------------------------------------
PathShapeActor::PathShapeActor() {}
PathShapeActor::~PathShapeActor() {}
void PathShapeActor::BeginPath(Point const& begin_pos)
{
sink_.BeginPath(begin_pos);
}
void PathShapeActor::EndPath(bool closed)
{
sink_.EndPath(closed);
Geometry geo = sink_.GetGeometry();
if (geo.IsValid())
{
SetGeometry(geo);
}
}
void PathShapeActor::AddLine(Point const& point)
{
sink_.AddLine(point);
}
void PathShapeActor::AddLines(Vector<Point> const& points)
{
sink_.AddLines(points);
}
void PathShapeActor::AddBezier(Point const& point1, Point const& point2, Point const& point3)
{
sink_.AddBezier(point1, point2, point3);
}
void PathShapeActor::AddArc(Point const& point, Size const& radius, float rotation, bool clockwise, bool is_small)
{
sink_.AddArc(point, radius, rotation, clockwise, is_small);
}
void PathShapeActor::ClearPath()
{
SetGeometry(Geometry());
}
} // namespace kiwano

View File

@ -34,7 +34,6 @@ KGE_DECLARE_SMART_PTR(RoundRectActor);
KGE_DECLARE_SMART_PTR(CircleActor);
KGE_DECLARE_SMART_PTR(EllipseActor);
KGE_DECLARE_SMART_PTR(PolygonActor);
KGE_DECLARE_SMART_PTR(PathShapeActor);
/**
* \addtogroup Actors
@ -289,58 +288,6 @@ public:
void SetVertices(Vector<Point> const& points);
};
/// \~chinese
/// @brief 路径图形角色
class KGE_API PathShapeActor : public ShapeActor
{
public:
PathShapeActor();
virtual ~PathShapeActor();
/// \~chinese
/// @brief 开始添加路径
/// @param begin_pos 起始点
void BeginPath(Point const& begin_pos = Point());
/// \~chinese
/// @brief 结束添加路径
/// @param closed 路径是否闭合
void EndPath(bool closed = true);
/// \~chinese
/// @brief 添加一条线段
/// @param point 线段端点
void AddLine(Point const& point);
/// \~chinese
/// @brief 添加多条线段
/// @param points 线段端点集合
void AddLines(Vector<Point> const& points);
/// \~chinese
/// @brief 添加一条三次方贝塞尔曲线
/// @param point1 贝塞尔曲线的第一个控制点
/// @param point2 贝塞尔曲线的第二个控制点
/// @param point3 贝塞尔曲线的终点
void AddBezier(Point const& point1, Point const& point2, Point const& point3);
/// \~chinese
/// @brief 添加弧线
/// @param point 椭圆圆心
/// @param radius 椭圆半径
/// @param rotation 椭圆旋转角度
/// @param clockwise 顺时针 or 逆时针
/// @param is_small 是否取小于 180° 的弧
void AddArc(Point const& point, Size const& radius, float rotation, bool clockwise = true, bool is_small = true);
/// \~chinese
/// @brief 清除路径
void ClearPath();
private:
GeometrySink sink_;
};
/** @} */

View File

@ -88,40 +88,4 @@ void ActionWalk::UpdateTween(Actor* target, float percent)
}
}
void ActionWalk::BeginPath()
{
sink_.BeginPath();
}
void ActionWalk::EndPath(bool closed)
{
sink_.EndPath(closed);
path_ = sink_.GetGeometry();
}
void ActionWalk::AddLine(Point const& point)
{
sink_.AddLine(point);
}
void ActionWalk::AddLines(Vector<Point> const& points)
{
sink_.AddLines(points);
}
void ActionWalk::AddBezier(Point const& point1, Point const& point2, Point const& point3)
{
sink_.AddBezier(point1, point2, point3);
}
void ActionWalk::AddArc(Point const& point, Size const& radius, float rotation, bool clockwise, bool is_small)
{
sink_.AddArc(point, radius, rotation, clockwise, is_small);
}
void ActionWalk::ClearPath()
{
path_.Clear();
}
} // namespace kiwano

View File

@ -65,46 +65,6 @@ public:
/// @brief 获取该动画的倒转
ActionPtr Reverse() const override;
/// \~chinese
/// @brief 开始添加路线
void BeginPath();
/// \~chinese
/// @brief 结束路线
/// @param closed 路线是否闭合
void EndPath(bool closed = false);
/// \~chinese
/// @brief 添加一条线段
/// @param point 线段端点
void AddLine(Point const& point);
/// \~chinese
/// @brief 添加多条线段
/// @param points 端点集合
void AddLines(Vector<Point> const& points);
/// \~chinese
/// @brief 添加一条三次方贝塞尔曲线
/// @brief 添加一条三次方贝塞尔曲线
/// @param point1 贝塞尔曲线的第一个控制点
/// @param point2 贝塞尔曲线的第二个控制点
/// @param point3 贝塞尔曲线的终点
void AddBezier(Point const& point1, Point const& point2, Point const& point3);
/// \~chinese
/// @brief 添加弧线
/// @param point 椭圆圆心
/// @param radius 椭圆半径
/// @param rotation 椭圆旋转角度
/// @param clockwise 顺时针 or 逆时针
/// @param is_small 是否取小于 180° 的弧
void AddArc(Point const& point, Size const& radius, float rotation, bool clockwise = true, bool is_small = true);
/// \~chinese
/// @brief 清除路径
void ClearPath();
/// \~chinese
/// @brief 获取路线
Geometry const& GetPath() const;
@ -125,7 +85,6 @@ private:
float length_;
Point start_pos_;
Geometry path_;
GeometrySink sink_;
};
/** @} */

View File

@ -100,6 +100,10 @@
#define KGE_DEBUG
#endif
#define KGE_SUPPRESS_WARNING_PUSH __pragma(warning(push))
#define KGE_SUPPRESS_WARNING(CODE) __pragma(warning(disable : CODE))
#define KGE_SUPPRESS_WARNING_POP __pragma(warning(pop))
#ifndef KGE_ASSERT
#ifdef KGE_DEBUG
#define KGE_ASSERT(EXPR) \
@ -129,7 +133,7 @@
* C++ Standard Library, compiling a debug release (/MTd) and
* where the compiler error message refers to _Container_base.
*/
#pragma warning(disable : 4251)
KGE_SUPPRESS_WARNING(4251)
#endif
#define KGE_NOT_USED(VAR) ((void)VAR)

View File

@ -85,8 +85,8 @@ struct Matrix3x2T
{
}
#pragma warning(push)
#pragma warning(disable : 26495) // ignore warning "always initialize member variables"
KGE_SUPPRESS_WARNING_PUSH
KGE_SUPPRESS_WARNING(26495) // ignore warning "always initialize member variables"
template <typename _MTy>
Matrix3x2T(_MTy const& other)
@ -95,7 +95,7 @@ struct Matrix3x2T
m[i] = other[i];
}
#pragma warning(pop)
KGE_SUPPRESS_WARNING_POP
inline value_type operator[](uint32_t index) const
{

View File

@ -22,10 +22,10 @@
#include <kiwano/core/Logger.h>
#include <kiwano/macros.h>
#pragma warning(push)
#pragma warning(disable : 4091)
#include <dbghelp.h>
#pragma warning(pop)
KGE_SUPPRESS_WARNING_PUSH
KGE_SUPPRESS_WARNING(4091)
#include <dbghelp.h> // ignored on left of 'type' when no variable is declared
KGE_SUPPRESS_WARNING_POP
namespace kiwano
{

View File

@ -21,10 +21,10 @@
#include <kiwano/core/Logger.h>
#include <kiwano/render/DirectX/D3D11DeviceResources.h>
#pragma warning(push)
#pragma warning(disable : 4800)
KGE_SUPPRESS_WARNING_PUSH
KGE_SUPPRESS_WARNING(4800) // Implicit conversion from 'type' to bool
#include <versionhelpers.h> // IsWindows10OrGreater
#pragma warning(pop)
KGE_SUPPRESS_WARNING_POP
#pragma comment(lib, "d3d11.lib")