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
PolygonClipView.h
Package: Sutherland-Hodgman.rar [view]
Upload User: shwyly
Upload Date: 2007-11-25
Package Size: 47k
Code Size: 2k
Category:
Graph Drawing
Development Platform:
Visual C++
- // PolygonClipView.h : interface of the CPolygonClipView class
- //
- /////////////////////////////////////////////////////////////////////////////
- #if !defined(AFX_POLYGONCLIPVIEW_H__476467E3_C815_43CA_AF50_10AD5255877C__INCLUDED_)
- #define AFX_POLYGONCLIPVIEW_H__476467E3_C815_43CA_AF50_10AD5255877C__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #define EdgeNum 6
- #define MAX 2*EdgeNum
- typedef struct{
- float x,y;
- }Vertex;
- typedef Vertex Edge[2];
- typedef Vertex VertexArray[MAX];
- class CPolygonClipView : public CView
- {
- protected: // create from serialization only
- CPolygonClipView();
- DECLARE_DYNCREATE(CPolygonClipView)
- // Attributes
- public:
- CPolygonClipDoc* GetDocument();
- CRect screen;
- Edge clipBoundary;
- int *outLength;//= new int outlength;
- int inLength;
- VertexArray inVertexArray,outVertexArray;
- // CPoint startpoint,lastendpoint;
- int count;
- // Operations
- public:
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CPolygonClipView)
- public:
- virtual void OnDraw(CDC* pDC); // overridden to draw this view
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- protected:
- //}}AFX_VIRTUAL
- // Implementation
- public:
- void SHPolygonClip(int inLength,VertexArray inVertexArray,int *outLength,VertexArray outVertexArray,Edge clipBoundary);
- void Output(Vertex *newVertex,int *outLength,VertexArray outVertexArray);
- bool Inside(Vertex* testVertex, Edge clipBoundary);
- void Intersect(Vertex *s,Vertex *p,Edge clipBoundary,Vertex *I);
- virtual ~CPolygonClipView();
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- protected:
- // Generated message map functions
- protected:
- //{{AFX_MSG(CPolygonClipView)
- afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
- afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- #ifndef _DEBUG // debug version in PolygonClipView.cpp
- inline CPolygonClipDoc* CPolygonClipView::GetDocument()
- { return (CPolygonClipDoc*)m_pDocument; }
- #endif
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_POLYGONCLIPVIEW_H__476467E3_C815_43CA_AF50_10AD5255877C__INCLUDED_)