⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 curversimpleview.h

📁 用两种输入曲线的方式和获取点的方法
💻 H
字号:
// CurverSimpleView.h : interface of the CCurverSimpleView class
//
/////////////////////////////////////////////////////////////////////////////
#include "StdAfx.h"
#include "MainFrm.h"
#include "setValue.h"
#include "SetDistancefa.h"
#if !defined(AFX_CURVERSIMPLEVIEW_H__C8747862_E81A_4E1B_86CF_F7BBE065BFAB__INCLUDED_)
#define AFX_CURVERSIMPLEVIEW_H__C8747862_E81A_4E1B_86CF_F7BBE065BFAB__INCLUDED_
#define M 20
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//原始点的输入的结构
typedef struct 
{
	UINT pointID;
	bool usedFlag;//使用过的点用1标记,否则用0标记
	CPoint pointofxy;
}Orignpoint;
//被选择的点集
typedef struct
{
	UINT pointID;
	CPoint pointofxy;
}SelectedPoint;
class CCurverSimpleView : public CView
{
protected: // create from serialization only
	CCurverSimpleView();
	DECLARE_DYNCREATE(CCurverSimpleView)
public:
	HGLRC m_hglrc;
	CDC*pDC;
	CRect ClientRect;
	BOOL m_bDraw;
	BOOL m_MouseDown;
    vector<Orignpoint>    OrignVS;
	vector<Orignpoint>    featurepoints;
	vector<Orignpoint>    featurepoints2;
	vector<SelectedPoint> selectedpoints;
	vector<CPoint> TrianglePt;
	//vector<CPoint> anglepts;
	GLfloat array[M][3];
	double fa;
public:
	void GLDraw();
	void InitPara();
	void GetLineABC(CPoint pt1,CPoint pt2,float&A,float&B,float&C);
	int GetSelectpointID(vector<Orignpoint> fps,int&id,float fa);
	//void GetCurverPoints(vector<Orignpoint> fps,int&id,float fa);
	BOOL stop();
	void GetRCurver(vector<Orignpoint> fps,int idn,float fa);//id0为第一个临时特征点
	BOOL FlagEnd;
	BOOL m_display;
	BOOL m_b[3];
	int m_MouseDownNum;
	//int id1;//标识临时特征点
	BOOL m_newdraw;
	BOOL m_newdrawpt;
	int m_PtInTriangle;
	CPoint m_ptStart,m_ptOld;
	float computedis(float a,float b,float c,Orignpoint pt);
	void distancejuage(float fa);
	void DrawTriangle();
	void Compute();
	
	//void display(vector<SelectedPoint> pts);
	//void GLDrawPoint(CPoint pt);
// Attributes
public:
	CCurverSimpleDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCurverSimpleView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CCurverSimpleView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CCurverSimpleView)
	afx_msg void OnDataimport();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnDestroy();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnDouglasPeuker();
	afx_msg void OnClear();
	afx_msg void OnDrawnewline();
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnJuagedistance();
	afx_msg void OnJuagepointinorout();
	afx_msg void OnDisplayResult();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in CurverSimpleView.cpp
inline CCurverSimpleDoc* CCurverSimpleView::GetDocument()
   { return (CCurverSimpleDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CURVERSIMPLEVIEW_H__C8747862_E81A_4E1B_86CF_F7BBE065BFAB__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -