#ifndef __CUTLINE_H_INCLUDE__
#define __CUTLINE_H_INCLUDE__
 
#include "cncobj.h"

#define CL_MAX_CP_CNT  2


// This class is exported from the CutLine.dll
class CNCCLS_API CCutLine:public CCncObj 
{

public:
	CCutLine(void);
	virtual ~CCutLine(void);

	virtual double GetMacLength();
		
	//@1ÏñËØ×ø±ê
	void GetEndPoint1(float& x, float& y);
	void SetEndPoint1(float x, float y, BOOL bUpdateMap);
	void GetEndPoint2(float& x, float& y);
	void SetEndPoint2(float x, float y, BOOL bUpdateMap);
	//RvPoint GetCounterCamPos(int index);
	//end of @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 void Show(CDelegate* pDelegate, int mode,BOOL bForce);

	virtual void  ShowExtender(CDelegate* pDelegate,CLeadMark* pMark);
	virtual void  ShowGrabber(CDelegate* pDelegate, CLeadMark* pMark);	

	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 Scale(double scale);
    virtual void Scale(double scaleX, double scaleY);
    virtual void Rotate(double cx, double cy, double angle);


private:
	void UpdateMachRect(void);
	void UpdateRect();  //object client

	RvPoint_f64  m_cps[CL_MAX_CP_CNT];
	 
	RV_HANDLE DrawCutter(CDelegate* pDelegate,   float radius, RV_HANDLE hStroke);

	double CalcAngle(double x0, double y0, double x1, double y1 );

	RV_HANDLE DrawLinePath(HGDC dc,  double x0, double y0, double x1, double y1, double r, RV_HANDLE hStroke);


	
};

#endif


