Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
DelaunayDoc.h
Package: VC++Delaunay.zip [view]
Upload User: azhong891
Upload Date: 2013-06-04
Package Size: 197k
Code Size: 4k
Category:
GIS program
Development Platform:
Visual C++
- // DelaunayDoc.h : interface of the CDelaunayDoc class
- //
- /////////////////////////////////////////////////////////////////////////////
- #if !defined(AFX_DELAUNAYDOC_H__8BFDEC2D_B5F7_11D3_AB59_080039014899__INCLUDED_)
- #define AFX_DELAUNAYDOC_H__8BFDEC2D_B5F7_11D3_AB59_080039014899__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- //***********************************//
- #include <afxtempl.h>
- #include "pointpos.h"
- #include "triangle.h"
- #include "border.h"
- #include<glgl.h>
- #include<glglu.h>
- #include<glglaux.h>
- //**************************//
- /******************************/
- enum DO_WHAT
- {
- DO_ADD,
- DO_INTERPOLATION,
- DO_DRAW2,
- DO_DRAW3,
- DO_HCT,
- DO_LINE,
- DO_FILL,
- DO_WANG,
- };
- /******************************/
- class CDelaunayDoc : public CDocument
- {
- protected: // create from serialization only
- CDelaunayDoc();
- DECLARE_DYNCREATE(CDelaunayDoc)
- // Attributes
- public:
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CDelaunayDoc)
- public:
- virtual BOOL OnNewDocument();
- virtual void Serialize(CArchive& ar);
- virtual void DeleteContents();
- //}}AFX_VIRTUAL
- // Implementation
- //******************************//
- public:
- void Wang();
- int Belong(double x, double y,CTriangle* tri);
- CTriangle* Belong(double x,double y);
- double Power(double a, int e);
- int Factorial(int n);
- double S(POI p1, POI p2, POI p3);
- double Bezier(double x, double y,int m_p1,int m_p2,CTriangle* tri);
- void DrawTri(int m_p1,int m_p2,CTriangle* tri);
- double F(CTriangle *temp, int i, int j);
- double D(CTriangle *temp, int i, int j);//沿边方向导:i to j
- CPointPos* GetChuiZu(double x,double y,CPointPos* p2,CPointPos* p3);
- double GetMold(CPointPos* p);
- void BaryCenter(CTriangle* temp);
- void Get_Fx_Fy_N(int p);
- double DotProduction(double x1,double y1,double z1,double x2,double y2,double z2);//内积
- POI Unitization(POI p);
- POI VectorProduct(double x1,double y1,double z1,double x2,double y2,double z2);//外积
- double GetDistance(CPointPos* p1,CPointPos* p2);
- POI GetTriNormal(CTriangle *temp);
- void FindRelativeTri(int p);
- bool DelEdgeOrNot(int p1,int p2,int p);
- int TheOtherPoint(int p1,int p2,CTriangle* temp);
- CPointPos* CDelaunayDoc::IntersectionPoint(CPointPos *point1, CPointPos *point2,CPointPos *point3, CPointPos *point4);
- void EditCon(int r,int l ,int p);
- void DelTriMarked();
- int GetInitEdges(double x,double y,int p);
- int TwoEdgeSuperposition(CBorder *b1, CBorder *b2);
- double S(int p1,int p2,int p3);
- double S(CPointPos *p1,CPointPos *p2,CPointPos *p3);
- void AddTriangle(int p);
- //int m_clen;//凸包边界的节点个数,it be replaced by 'm_con.GetSize()' now
- //int m_plen;//当前节点个数,it be replaced by 'm_point.GetSize()' now
- void Center(CTriangle* temp);
- DO_WHAT m_DoWhat;
- CTypedPtrArray<CObArray,CPointPos*> m_point;//存节点
- //CTypedPtrArray<CObArray,CPointPos*> m_n;//存节点的法向量
- CTypedPtrList<CObList,CTriangle*> m_tri;//存三角链
- void AddPoint(double x,double y);
- CArray<POSITION,POSITION&> m_index;//指向三角形链的节点的指针数组,对将要删出的三角形做标志
- CTypedPtrArray<CObArray,CBorder*> m_edge;//Record the border of the inserted polygon
- CWordArray m_con;//存放凸包边界上所有节点的坐标数组下标(of m_point),逆时针
- //******************************//
- virtual ~CDelaunayDoc();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- protected:
- // Generated message map functions
- protected:
- //{{AFX_MSG(CDelaunayDoc)
- afx_msg void OnButtonAdd();
- afx_msg void OnUpdateButtonAdd(CCmdUI* pCmdUI);
- afx_msg void OnButtonBB();
- afx_msg void OnUpdateButtonBB(CCmdUI* pCmdUI);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_DELAUNAYDOC_H__8BFDEC2D_B5F7_11D3_AB59_080039014899__INCLUDED_)