#if !defined(__RV_CORNER_PROBE_H_INCLUDED_)
#define __RV_CORNER_PROBE_H_INCLUDED_

#pragma once

#include <cali\areacal.h>
#include <cali\CurveCal.h>

#include "gauge.h"

#define CP_MAX_POS_COUNT   2

//  Shape of Corner
//  Default:
//               |__  or    __
//                           |
//  Pole:        ___
//               ___|
//  
//  Stair:         |__
//                  __
//                 |
//
//  Line:         ____   or  |
//                           |
//
//  Arc:         C 主要位置：零件圆弧倒角
//           
//
//
class GAUGE_API CCornerProbe:	public CAreaCal
{
public:
	CCornerProbe(void);
	virtual ~CCornerProbe(void);

	enum CP_TYPE{
	    CP_DEFAULT =0, //默认，角点
		CP_POLE,       //顶端
		CP_STAIR   ,   //台阶   
		CP_LINE,       //直线点
		CP_ARC,        //圆弧点
	};
	  
	virtual void Show(CDelegate* pDelegate, int mode,BOOL bForce);	 
	virtual CUCObj* Clone( CUCObj* twin) ;
	virtual BOOL Serialize(HANDLE device, BOOL bIn );
	 
	virtual void Reset();
  
	 
	RvPoint_f GetCurPos(BOOL bSecondPos);
	BOOL IsPosValid(){ return m_bValidPos; };

	int  GetCornerType(){ return m_nCornerType;};
	void SetCornerType(CP_TYPE type);
	 
	virtual RV_BOOL Inspect(int* pErrCode ) ;

	virtual void SetShape(int shape);
	virtual void  SetDisplayStyle(int style){;}; 

public:
	void OnEndTrack(CDelegate* pDelegate, HGPD hCur,  GPoint point, int type);
public:  	
  //  int    m_nSubPixelLevel;
	int    m_nDirect;       
	int    m_nCrossSize;
protected:
	RV_HANDLE DrawMarks(HGDC dc, RV_HANDLE hStroke);
	  
	CP_TYPE      m_nCornerType;
	RvPoint_f    m_curPos[CP_MAX_POS_COUNT];
	BOOL         m_bValidPos; 
   /// float        m_nArcRadius;
	  
};



#endif