Assignment 1 information

Announcements

Assignment information

whuang@cs.rpi.edu; email
Last updates: February 2; January 29; January 28, 2001


Support Code for reading input files

Here's a program that will read the input files for this problem. I have tested it under UNIX g++ and Windows Visual C++. It is not extremely robust, but it seems to work fine. In particular, it does not properly give an error when the file is not found under Windows.

NOTE: This is just sample code. I do read the points into a list of CGAL-supported points, but I throw all the information away once I read it. You'll probably want to keep it around in some class of your own design. Here's the file:

This code is a rewritten version of the code that Rob Foulis submitted for the first part of Assignment 1 (which I believe was an extension of the code I had provided in the convexhull program).

CGAL: The Computational Geometry Algorithms Library

This is a well constructed library of computational geometry representations and algorithms developed by a several research groups in Europe.

CGAL under windows

I had a little trouble getting CGAL to install under windows. Here are the steps that I took. If anyone has an easier way, let me know! (Actually, the easier way would probably be to do it under Cygwin, but I was assuming most of you wouldn't be using it.)

After this, go read the install.txt file very carefully! It tells you almost everything you need to know to set up Visual C++ to link to the CGAL library. This information is contained in section 4.2. The only thing that they don't say in this file is that when you add the CGAL.lib and gmp.lib in the Project/Settings/Link/Input page, you also have to add directories to the "Additional library paths" slot. On my computer, these are:

c:\cgal-2.2\lib\msvc,c:\cgal-2.2\auxiliary\wingmp\gmp-2.0.2\msvc

I had to make a few minor changes to my convexhull.cpp program to make it work. (For example, I didn't know how to specify command line arguments, and also the file I/O was slightly different for me --- I had to replace the error message in the file reading loop with a break statement.)

Although you are certainly more adept than I with Visual C++, here's my workspace/project files for the convexhull program. (Although note that it is set up for where I installed CGAL, in c:\CGAL-2.2)

The Toogl graphics library for Windows

The Vogle graphics library for X11/UNIX

Sample inputs

Here are some sample inputs you can try: