#pragma once

#include "marklocater.h"
#include <cali\ShapeMatch.h>

class CNCCLS_API CShapeLocater : 	public CMarkLocater
{
public:
	CShapeLocater(void);
	virtual ~CShapeLocater(void);

	virtual BOOL Serialize(HANDLE device, BOOL bIn );
	virtual CUCObj* Clone(  CUCObj *twin) ;
	 
	virtual void Show(CDelegate* pDelegate, int mode, BOOL bForced);

	virtual BOOL  Create( const TCHAR* strName = NULL, UINT id =-1, int style = RV_UC_DEFAULT_STYLE)   ;
	virtual void  Destroy()  ;

	//学习的时候，如果成功，将采集模板图
	virtual BOOL    Learn(const RvImage image, double machPosX, double machPosY, int* pErrCode  )  ;
	virtual BOOL    Locate(const RvImage image, RvPoint_f* pResult, int* pErrCode)  ;

	//该函数删除当前学习的模板，恢复到未学习模板状态。
	virtual void    ClearPatterns()  ;

	virtual CCaliber* GetOperator() {return &m_sm;};

	
	virtual void Shot(int mode , const RvImage image   )  ;
	virtual void ShotEx( int mode, const RvImage image , int left, int top) ;

	virtual void   SetCtrlRect(int left, int top, UINT width, UINT height) ;

	virtual RvRect GetPatternRect()  ;
	virtual RvRect GetSearchRect()  ;

	virtual void SetPatternRect(RvRect rect) ;
	virtual void SetSearchRect(RvRect rect) ;

protected:
	CShapeMatch   m_sm;
	 

};

