/********************************************************************/
/* Copyright (c) 2019 System fugen G.K. and Yuzi Mizuno          */
/* All rights reserved.                                             */
/* ***************************************************** */
/********************************************************************/
/**
 * @file ArcSER.h
 * @brief MGArcSERTool クラスのインターフェイス
 */
#if !defined(AFX_ARCSER_H__5B5A072F_8392_40BD_8AEA_40169FD6BED2__INCLUDED_)
#define AFX_ARCSER_H__5B5A072F_8392_40BD_8AEA_40169FD6BED2__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Common/LocateState.h"
#include "mg/Ellipse.h"

class MGCommandStateOwner;

/// @class MGArcSERTool ArcSER.h "CurveCmd/ArcSER.h"
///
/// [円弧 - 始点、終点、半径指定]に対応するコマンドクラス
class MGArcSERTool : public MGLocateState
{
	enum LocateMode	{
		RADIUS, ///< 半径指定モード（通常）
		DIRECTION, ///< 接線方向と終点
		THROUGH ///< 通過点と終点
	};

	LocateMode m_mode;
	double m_radius; ///< 半径の値
	double m_minimumRadius;///Minimum radius which is the half of the distance of 
					//start and end.

public:
	explicit MGArcSERTool(fugenDoc* pDoc);
	virtual MGCommandBase* initial_clone(fugenDoc* pDoc)const;
	virtual bool initiate_tool();
	virtual bool terminate_tool(bool cancel = false);
	virtual bool OnKeyDown(fugenView* pView, UINT nChar, UINT nRepCnt, UINT nFlags);
	virtual bool OnLocated(const MGLocateInfo& info);
	virtual void do_make_temporary_display(mgSysGL& sgl,fugenView* pView);
private:
	MGEllipse* create_arc(const MGPosition& epos) const;
	void prompt_message() const;
};

#endif // !defined(AFX_ARCSER_H__5B5A072F_8392_40BD_8AEA_40169FD6BED2__INCLUDED_)
