#pragma once


#include "PatMat.h" 
#include <cali/AreaCal.h>


class PATMAT_API CContourAlign :	public CAreaCal
{
public:
	CContourAlign(void);
	virtual ~CContourAlign(void);

	virtual BOOL    Serialize(HANDLE device, BOOL bIn );
	virtual CUCObj* Clone(  CUCObj *twin) ;
	   
	//virtual BOOL    Learn(const RvImage image=NULL, int* pErrCode = NULL);  
	virtual int     Recognize(const RvImage image=NULL, int* pErrCode = NULL);
	virtual void    Clear();  
	 
	BOOL    AddMother(const RvContour contour);
	int     AddChild(const RvContour contour);  //返回0，添加不成功,否则返回当前子数量
	void    RemoveChild(int index);
	int     GetChildCount();
	BOOL    IsMotherExist();
	const RvContour GetMother();
	const RvContour GetChildAt(int index);

	void  RemoveAll();

	RvSequence  Retrieve(const RvImage image);
	 
	virtual void    Show(CDelegate* pDelegate,int mode, BOOL bForce) ;
	 
public:
	double  m_nPerimToler ;        //周长长度允许误差, x%
	double  m_nAspectRatioToler;   //长宽比允许误差,   x%， 各向同性时无效
	BOOL    m_bIsotropic ;         //各向同性

protected:
	void*  m_pPattern;
};

