#ifndef __LINE_H_INCLUDED_
#define __LINE_H_INCLUDED_

#include "indix.h"
 

class INDIX_API CLine: public CIndicater
{
public:
	CLine(void);
    virtual ~CLine(void);

	//end point type
	enum EP_TYPE{
		EP_ARROW1, //SOLID
		EP_ARROW2, //LINE
		EP_DOT,
	};

	

	virtual BOOL Serialize(HANDLE device, BOOL bIn ) ;

	virtual void Show(CDelegate* pDelegate,int mode, BOOL bForced);
	virtual void ShowSketch(CDelegate* pDelegate,CSketchMark* pMark, HGPD hGpd, int grabType, GPoint grabPos);
//	virtual void ShowSketch(CDelegate* pDelegate,RvPoint leftTop, RvPoint rightBottom);

	virtual CUCObj* Clone(  CUCObj *twin);

	void   SetPos(int index, GPoint val);
	GPoint GetPos(int index);

	int GetEndPointType(){ return m_nEndPointType; };
	void SetEndPointType(EP_TYPE type);

	BOOL  IsEndPointVisible(int index) ;
	void  SetEndPointVisible(int index, int flag);

	virtual void Move(double dx, double dy) ;
	virtual void   SetCtrlRect(int left, int top, int right, int bottom) ;
	virtual RvRect GetCtrlRect();
	virtual void   SetCtrlPos(int x, int y);
	virtual RvPoint GetCtrlPos();
public:
	virtual BOOL OnPositionChange( HGPD hOri, HGPD hCur, HGPD hNew, GPoint grabPos, RvOffset &offset) ;
	virtual BOOL OnExtenderChange( HGPD hCur, HGPD hNew, int index, GPoint &curPos) ;

	virtual void OnEndTrack(CDelegate* pDelegate,HGPD hCur,  GPoint point, int nHitTest) ;

	virtual int  HitTest(CDelegate* pDelegate,  GPoint point);
 
	virtual HGPD CreateGraphicDescriptor(CDelegate* pDelegate) ;
 

	virtual GRect  GetGrabberRect(CDelegate* pDelegate,RvSize size) ;
	virtual GRect  GetExtenderRect(CDelegate* pDelegate,int index, RvSize size) ;

protected:
	 int m_nEndPointType;
	 int m_nEndPointVisible;

private:

	RvLine m_line;

};





#endif //END OF __LINE_H_INCLUDED_