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
inside.c
Package: leda.tar.gz [view]
Upload User: gzelex
Upload Date: 2007-01-07
Package Size: 707k
Code Size: 1k
Category:
Mathimatics-Numerical algorithms
Development Platform:
MultiPlatform
- #include <LEDA/plane.h>
- #include <LEDA/window.h>
- main()
- { window W;
- string s[5];
- s[0] = "no grid ";
- s[1] = "10 pixel";
- s[2] = "20 pixel";
- s[3] = "30 pixel";
- s[4] = "40 pixel";
- int grid_width = 10 * W.read_panel("GRID MODE ? ",5,s);
- W.clear();
- W.init(0,1000,0, grid_width);
- W.set_node_width(2);
- polygon P;
- W >> P;
- W << P;
- int key;
- double x,y;
- while ((key = W.read_mouse(x,y)) !=3)
- { point p(x,y);
- W << p;
- if (key == 1)
- { if (P.inside(p)) W.draw_text(p,"INSIDE");
- else W.draw_text(p,"OUTSIDE");
- }
- else
- { W.clear();
- W << P;
- int n = W.read_int("n = ");
- while (n--)
- { p = point(rand_int(0,1000),rand_int(0,1000));
- if (P.inside(p)) W.draw_filled_node(p);
- else W << p;
- }
- }
- }
- return 0;
- }