dtriangulationView.h
资源名称:package.rar [点击查看]
上传用户:chinasdcnc
上传日期:2022-07-02
资源大小:2702k
文件大小:3k
源码类别:
分形几何
开发平台:
Visual C++
- // dtriangulationView.h : CdtriangulationView 类的接口
- //
- #include "point2d.h"
- #include <stack>
- #pragma once
- class CdtriangulationView : public CView
- {
- protected: // 仅从序列化创建
- CdtriangulationView();
- DECLARE_DYNCREATE(CdtriangulationView)
- // 属性
- public:
- CdtriangulationDoc* GetDocument() const;
- bool isManInputState;
- bool isCircleTest;
- bool isTest;
- bool isPro;
- bool isLButtonDown;
- bool isEnLarge;
- bool isOne;
- bool isDTDemo;
- Point2d startTestPoint, finishTestPoint, tempTestPoint;
- Point2d startRectPoint, endRectPoint, tempRectPoint;
- vector<Edge *> testTris;
- Edge* circleTri;
- Point2d cirTestCenter;
- double cirTestRadius;
- // demo dt
- std::vector <MaxEdge> maxEdges;
- LARGE_INTEGER Freq;
- LARGE_INTEGER BeginTime;
- LARGE_INTEGER EndTime;
- UINT_PTR m_nTimer;
- int tempCount;
- // 操作
- public:
- /**
- * Draws DT
- */
- void drawDT(Edge* e);
- /**
- * Resets every edge to be not visited
- */
- void resetVisitedState(Edge* e);
- /**
- * demo for DAC trigulation algorithm
- */
- MaxEdge delaunayDemo(int begin, int end, int timeInterval);
- // 重写
- public:
- virtual void OnDraw(CDC* pDC); // 重写以绘制该视图
- 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);
- // 实现
- public:
- virtual ~CdtriangulationView();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- protected:
- // 生成的消息映射函数
- protected:
- DECLARE_MESSAGE_MAP()
- public:
- afx_msg void OnGeneratePoints();
- afx_msg void OnInputPoints();
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnTriangulation();
- afx_msg void OnFileNew();
- afx_msg void OnFileOpen();
- afx_msg void OnFileSave();
- afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
- protected:
- HGLRC m_hRC;
- public:
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnDestroy();
- afx_msg BOOL OnEraseBkgnd(CDC* pDC);
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
- afx_msg void OnDcelTest();
- afx_msg void OnCircleTest();
- afx_msg void OnMouseMove(UINT nFlags, CPoint point);
- afx_msg void OnShowEnlarge();
- afx_msg void OnShowRevert();
- afx_msg void OnTimer(UINT_PTR nIDEvent);
- afx_msg void OnDtDemo();
- };
- #ifndef _DEBUG // dtriangulationView.cpp 中的调试版本
- inline CdtriangulationDoc* CdtriangulationView::GetDocument() const
- { return reinterpret_cast<CdtriangulationDoc*>(m_pDocument); }
- #endif