#ifndef __ToolLineEdit_h
#define __ToolLineEdit_h

#include "ToolBasePolyEdit.h"	// Super class.

#ifdef SUPER_CLASS
#undef SUPER_CLASS
#endif
#define SUPER_CLASS FCToolBasePolyEdit


class FCObjLine;

//----- _xZkqqHx_jBiAiNoMjBmOiPnLiDeJiDhFiDfHiDeGiDeOiDgHiCmMiLeMjIfOiCmGiBeBjBeJjBpAiDhMiDeDiDjDiDgHiCmMiLeMjIfOjHhA_xHqqkZx_ -----
class FCLnPRec
{
public:
	FCLnPRec ();
	FCLnPRec (FCObjLine* ojlp, BOOL bIsFrom, BOOL bIsTo);
	FCObjLine*	GetObject () const;
	BOOL		UpdateEnds ();
// 05.09.07 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	void		DrawSelectMark (CDC* pDC) const;

	FCObjLine*	m_pObj;
	BOOL		m_bIsSelected[2];
	DBLPoint	m_mmptEnds[2];
}; // class FCLnPRec.

// FFAddToLZSorted_xZkqqHx_jHhAiKnGjAjEiBeC_xHqqkZx_
inline FCObjDynabase* GetObject (FCLnPRec& rec) { return rec.m_pObj; }

typedef vector<FCLnPRec> FCLnPRecVector;

class FCToolLineEdit : public SUPER_CLASS
{
protected:
typedef SUPER_CLASS BASE_CLASS;

public:
	//----- _xZkqqHx_iDfEiDhFiDeOiDiJiDfIiCmFjEeDiInD_xHqqkZx_ -----
// 05.09.06 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	virtual void	OnDraw (CDC* pDC);
	virtual void	OnSelectObjModified ();
// 05.09.06 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	virtual void	Select (CDC* pDC);

// 05.09.06 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	virtual void	DrawSelectMark (CDC* pDC, FCObjDynabase* pObj);
	virtual void	OnAppendSelectObj (CDC* pDC, FCObjDynabase* pObj);
	virtual void	OnRemoveSelectObj (CDC* pDC, FCObjDynabase* pObj);

	virtual BOOL	CanHandle (const FCObjDynabase* pObj) const;

protected:
//----- 05.09.06 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	//----- _xZkqqHx_iDfEiDhFiDeOiDiJiDfIiCmFjFeLjAhL_xHqqkZx_ -----
	virtual long	GetLineCount () const;
	virtual BOOL	IsOpenLine (long lLineIndex) const;
	virtual long	GetJointCount (long lLineIndex) const;
	virtual void	GetBezierControls (	FCBezierControls& bc,
										long lLineIndex,
										long lJointIndex,
										BOOL bIsForward) const;
	virtual FCObjFigure*	GetLineObject (long lLineIndex) const;
	virtual void	SetJointPoint (longPair index, DBLPoint mmpt);
	virtual void	DrawJointSelectMark (CDC* pDC, longPair index) const;
	virtual long	JointIDtoMolipID (long lJointId) const;
//----- 05.09.06 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
// 06.12.09 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
	virtual void	DrawSelectedBezier (CDC* pDC) const;

//----- 05.09.05 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	//----- _xZkqqHx_iClBiCmMiDeOiDiJiDfIiMmFjHeM_xHqqkZx_ -----
//	virtual FCLnPRec&	GetHitLine ();
//	virtual DBLPoint&	GetHitEnds ();
//----- 05.09.05 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

	//----- FCToolBaseFDA_xZkqqHx_iCmMiDfEiDhFiDeOiDiJiDfIiCmFjFeLjHhGiCmJiJjOiClGiCmE_xHqqkZx_ -----

	//----- _xZkqqHx_jBeKiInKiPpDjBnEiPiIjHjNiBgJiDeJiBfLiDgPiBfLiDiJiDeDiDgIiBgK_xHqqkZx_ -----
	virtual void	StateIdle (CDC* pDC);
	//----- _xZkqqHx_jBeKiInKiPpDjBnEiPiIjHjN_xHqqkZx_ -----
//----- 05.09.06 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	virtual void	StateStartMoveJoint (CDC* pDC);
//	virtual void	StateMovingJoint (CDC* pDC);
//	virtual void	StateContextMenuJoint (CDC* pDC);
//	virtual void	StateJointLinkCommand (CDC* pDC);
//	virtual void	StateReLink (CDC* pDC);
//	virtual void	StateStopMoveJoint (CDC* pDC);
//	virtual void	StateDoMoveJointSnap (CDC* pDC);
//----- 05.09.06 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

	//----- FCToolBaseFDA_xZkqqHx_iCmMiDfEiDhFiDeOiDiJiDfIiCmFjFeLjHhGiCmJiJjOiClGiCmE_xHqqkZx_ -----
	virtual BOOL	CanLinkToSelection () const;	// Idle_xZkqqHx_iCmF_xHqqkZx_CTRL+MSMOVE_xZkqqHx_iCmFiDiKiDjDiDeOiCkKjCkDiCoKiCoJiCkJiBeI_xHqqkZx_
	virtual void	GetSelectionForLink (FTMolipSet& stMolip) const;	// _xZkqqHx_iDiKiDjDiDeOiCpAjCkDiCoJiClNiCnPiCmMiDiCiDiKiDhGiPfHiNiHiCpAjFnEiClHiBeC_xHqqkZx_

	//----- FCToolBaseEdit_xZkqqHx_iCmMiDfEiDhFiDeOiDiJiDfIiCmFjFeLjAhL_xHqqkZx_ -----
	virtual void	ResetEditHandleList ();

	//----- FCToolSelectTmpl_xZkqqHx_iCmMiDfEiDhFiDeOiDiJiDfIiCmFjFeLjAhL_xHqqkZx_ -----
	virtual long	GetSelectedXXX (XXX_Joint, vector<longPair>* vXxx = NULL, set<longPair>* stXxx = NULL) const;
	virtual long	GetSelectableXXX (XXX_Joint, vector<longPair>* vXxx = NULL) const;
	virtual void	SelectXXX (XXX_Joint, longPair xxx, CDC* pDC);
	virtual void	UnselectXXX (XXX_Joint, longPair xxx, CDC* pDC);
	virtual DBLRect	GetFrameRectXXX (XXX_Joint, longPair xxx) const;

//----- 05.09.05 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	//----- FCToolSelectTmpl_xZkqqHx_iCmMiDfEiDhFiDeOiDiJiDfIiCmFiBeB_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCpAiInKjDkOiClHiCoJiPoKiNiHiCmNjFeLjAhL_xHqqkZx_ -----
//----- 06.12.09 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	virtual void	DrawFirstImageXXX (XXX_Joint, CDC* pDC);
//	virtual void	RedrawMovingImageXXX (XXX_Joint, const DBLPoint& mmptMove, CDC* pDC);
//// 06.12.09 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
////	virtual void	OnDrawMovingImageXXX (XXX_Joint, CDC* pDC);
//	virtual void	DrawLastImageXXX (XXX_Joint, CDC* pDC);
//----- 06.12.09 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	virtual void	MoveXXX (XXX_Joint, const vector<longPair>& vXxx, const DBLPointVector& vmmptMove);
//----- 05.09.05 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

//----- 06.10.17 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	virtual void	AppendJointMovedRgn (long lLineIndex, const longSet& stJointIndex);
//----- 06.10.17 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

protected:
// _xZkqqHx_iClBiCmMiDeOiDiJiDfIiMmFjHeMiCmMjCoIiLgAiBeC_xHqqkZx_
enum
{
	STATE_BEGIN = BASE_CLASS::STATE_END,	// _xZkqqHx_iPpDjBnEiKeKiOgOiBeC_xHqqkZx_
	STATE_END,				// _xZkqqHx_iPpDjBnEiPeJjHlJiBeC_xHqqkZx_
};

protected:
// 05.09.06 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	DBLPoint		m_mmptMov1st;		// _xZkqqHx_iInKjDkOjDfPiBeC_xHqqkZx_
	FCLnPRecVector	m_lnpvSelect;		// _xZkqqHx_jBeJjBpAjCiGiCmMjApMiCmMiPoOjFpBiBeC_xHqqkZx_

// 05.09.05 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	DWORD			m_dwJointLinkKind;	// _xZkqqHx_jCfLjDfPiCmJiDiKiDjDiDeOiCpAjCkDiCoJiPoKiNiHiCmMiDiKiDjDiDeOiOoNiBeC_xHqqkZx_
}; // class FCToolLineEdit.

#endif//__ToolLineEdit_h
