#pragma once

#include "cncobj.h"

#define CP_VERTEX_COUNT   1

class CNCCLS_API CCheckPoint :	public CCncObj
{
public:
	CCheckPoint(void);
	virtual ~CCheckPoint(void);

		
	//@1 像素坐标
	float  GetX();
	float  GetY();
	void SetX(float val , BOOL bUpdateMap=FALSE);
	void SetY(float val, BOOL bUpdateMap =FALSE);
	//virtual RvPoint GetCounterCamPos(int index);
	//1

	virtual double GetMacLength(){ return 1.; };
//	virtual RvPoint_f64 GetStartMacPos() ; 
//	virtual RvPoint_f64 GetEndMacPos();
	virtual RvPoint_f64 GetReferMacPos();

	virtual int GetMacPosCount();
	virtual RvPoint_f64 GetMacPosAt(int index) ;
	virtual RvPoint_f64* GetMacPosArray() ;
	virtual void SetMacPosAt(int index, RvPoint_f64 pos) ;

	virtual RvPoint_f  GetCamPosAt(int index) ;
	virtual void     SetCamPosAt(int index, RvPoint_f pos) ;

	virtual void UpdateCamPos() ;
	virtual void UpdateMacPos() ;
	//virtual BOOL UpdateCamPos(double curMacX, double curMacY);
	//virtual BOOL UpdateMacPos(double curMacX, double curMacY) ;
public:
	virtual CUCObj* Clone( CUCObj* twin);
	
    virtual BOOL Serialize(HANDLE device, BOOL bIn );
	virtual void OnEndTrack(CDelegate* pDelegate,HGPD hCur,  GPoint point, int nHitTest);
	virtual void Show(CDelegate* pDelegate, int mode,BOOL bForce);
	virtual void ShowExtender(CDelegate* pDelegate,CLeadMark* pMark );
	virtual void  ShowGrabber(CDelegate* pDelegate, CLeadMark* pMark);	

	virtual int  HitTest(CDelegate* pDelegate,  GPoint point);
public:

	virtual void Scale(double scale);
    virtual void Scale(double scaleX, double scaleY);
    virtual void Rotate(double cx, double cy, double angle);
	
public:
	//int m_nDuration; // 单位:毫秒
	float m_nFovWidth, m_nFovHeight; //单位像素
private:
	//RV_HANDLE DrawFov(CDelegate* pDelegate,  int radius, RV_HANDLE hStroke);
	void UpdateRect();
	//控制点，机械坐标
	RvPoint_f64 m_cp; //在CCncObj复制

};

