📄 voronoidoc.h
字号:
// VoronoiDoc.h : interface of the CVoronoiDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_VORONOIDOC_H__38C5DC46_4416_4908_989D_A2584E51217A__INCLUDED_)
#define AFX_VORONOIDOC_H__38C5DC46_4416_4908_989D_A2584E51217A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Point.h"
#include "Pline.h"
#include "PlineRgn.h"
typedef struct
{
char m_Name[21];
BOOL b_Display;
int reserved;
}LayerStruct;
class CGraphPara
{
protected:
int n_ColorNumbAll;
int n_LayerNumbAll;
int n_ColorNumb;
int n_LayerNumb;
long* m_ColorList;
LayerStruct* m_LayerList;
public:
CGraphPara();
virtual ~CGraphPara();
COLORREF GetColor(int n);
BOOL GetDisplayStatue(int n);
};
class CVoronoiDoc : public CDocument
{
private:
CGraphPara m_GraphPara;
CTypedPtrArray<CObArray,CNetPoint*>m_NetPointArray;
CTypedPtrArray<CObArray,CPline*>m_PLineArray;
CTypedPtrArray<CObArray,CPlineRgn*>m_PLineRgnArray;
protected: // create from serialization only
CVoronoiDoc();
DECLARE_DYNCREATE(CVoronoiDoc)
// Attributes
public:
int *m_Index;
CNetPoint* AddNetPoint(double x,double y,double rRadiu,short Layer,int id_only,short ColorPen);
CPline* AddPLine(short ColorPen,short ColorBrush,float LineWide,short LineType,
short Layer,int id_only,int Number,PointStruct* PointList);
CPlineRgn* AddPLineRgn(short ColorPen,short ColorBrush,float LineWide,short LineType,
short Layer,int id_only,int Number,PointStruct* PointList,
BOOL bTransparent,BOOL bFill);
CDraw* GetGraph(short Lb,int Index);
int GetGraphNumb(short Lb);
int GetGraphUpperBound(short Lb);
int GetGraphID();
void Draw(CDC *pDC,int m_DrawMode,int m_DrawModel,short BackColor);
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CVoronoiDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
CPlineRgn* ConstructProtrude(PointStruct* PointList,int n);
int ZX(int n,int j,int k,LineStruct* LineList,PointStruct* PointList);
double distance(double x1,double y1,double x2,double y2);
int FourPointVoronoi(PointStruct* PointList1,LineStruct* LineList);
void TriangularVoronoi(PointStruct *PointList,LineStruct* LineList);
short RZDJ(PointStruct* Point1,PointStruct* Point2,PointStruct* Point3);
BOOL IntersectOrNot(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4);
void ZCX(PointStruct* Point1,PointStruct* Point2,LineStruct* Line);
PointStruct* intersect(LineStruct* Line1, LineStruct* Line2);
int ConstructVoronoi(int n,PointStruct* PointList,CDC* pDC,LineStruct* LineList);
BOOL same(double x1,double y1,double x2,double y2,double lx1,double ly1,double lx2,double ly2);
void GetProtrude(CDC *pDC);
void GetVoronoi(CDC *pDC);
virtual ~CVoronoiDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CVoronoiDoc)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_VORONOIDOC_H__38C5DC46_4416_4908_989D_A2584E51217A__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -