You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.8 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include "ItemSelectPoint.h"
#include <vector>
namespace NItem
{
#define DF_CALIBRATE_FOUR_POINT 0 //四点校位
#define DF_CALIBRATE_TWO_POINT 1 //两点校位
#define DF_CALIBRATE_TO_RECT 2 //校正为矩形
#define DF_CALIBRATE_ANY_POINT 3 //任意多点校正
#define POINT_INPUT 0 //手工输入式
#define POINT_SELECT 1 //拾取点式
#define POINT_FILE 2 //从文件获取坐标式
enum COORDINATE_MODE
{
COORDINATE_MODE_XY = 0,
COORDINATE_MODE_DMS = 1,
COORDINATE_MODE_DEGREE = 2
};
class CItemCalibrate :
public CItemSelectPoint
{
public:
CItemCalibrate(CSigmaDoc * ppDoc);
virtual ~CItemCalibrate(void);
void OnDraw(CXyDC* pDC) override;
void OnLButtonDown(CDC *pDC, UINT nFlags, CPoint point, int vk) override;
virtual BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) override;
virtual BOOL DoSelectEnd(void);
virtual BOOL Select(POSITION pos, CPoint2D point);
virtual void Redo(void);
virtual void Undo(void);
virtual int GetSubMenu();
bool CalibrateForFourPoint(std::vector<CPoint2D> & pts, COORDINATE_MODE mode);
bool CalibrateForTwoPoint(std::vector<CPoint2D> & pts, COORDINATE_MODE mode);
protected:
void ConvertToDMSAndFill(std::vector<CPoint2D> & pts, int num);
void ConvertToDegreeAndFill(std::vector<CPoint2D> & pts, int num);
void FillCoordinateInput(std::vector<CPoint2D> & pts, int num);
protected:
int m_idea; //处理方式
int m_mode; //输入方式(拾取点式|手工输入式|从文件获取坐标式)
int m_nCoorIdea; //坐标输入方式0XY、1度分秒、2
UINT m_nBackupID;
CList<CPoint2D,CPoint2D> RedoPointList;
CList<CPoint2D,CPoint2D> PointList; //保存实际点坐标
BOOL CalibrateAny(void);
BOOL CalibrateOther(void);
public:
void SetIdea(int nIdea);
void SetMode(int nMode);
int GetIdea(void);
int GetCoordinateMode(void);
int MetaToImage(BOOL bAddAction);
void SetBackupID(UINT nID);
};
};