CS321 -- Lab 5: Polygons



->Courses
->CS321
-->Presentation
-->Lab 1
-->Lab 2
-->Lab 3
-->Lab 4
->Lab 5
-->Lab 6
-->Lab 7
-->Lab 8
->Electronic Submission
->Old Exams
->C++ Examples
->Unix Help
->Software
->Tentative Schedule
->Course Policies

[Courses]
[Rich][Home][Rich]
[Author]

Fall Quarter 2001

Purpose

The purpose of this lab is to develop additional functionality for the graphics shell drawing application.

Acknowledgement

This lab was developed by Dr. Henry Welch.

General Lab Information

Without removing the ability to draw points, lines, and any other shapes you have coded or change the color from the command line, make the following enhancements to your graphics package.

  • Develop a mechanism for specifying polygons using the mouse (it is okay to lose the other shapes that are currently being drawn using the mouse). Polygon drawing may become a bit tricky since each point is defined by a different event and when the polygon begins the number of vertices is not known. Please review your understanding of dynamic memory allocation. (Depending on how you proceed this may complicate your memory recovery operations in some of your destructors.) In addition you should probably address the challenge of what happens when an Paint event occurs before a polygon is completely defined and what happens when the user executes a text command in the middle as well.
  • You MUST have a polygon class. It is NOT acceptable to save a polygon as a bunch of lines.
  • Don't forget to update your help information
  • Make certain that your polygons can be read from and written to files.

NOTE: You do not have to use your line drawing algorithm from lab 4. You may replace your algorithm with the one provided by QPainter.

Application demonstration

You should demonstrate the successful operation of your application before or during week 7 lab.

Lab report (due 11pm, the day prior to week 7 lab)

The lab reports should be self-contained. That is, it should be possible for someone to understand what you did and why without seeing anything other than your report and any previous reports that you have submitted. Your report should include:

  • Purpose
  • Problem Statement
  • Procedure -- what approach you used to solve the problem
  • Discussion including:
    • A tally of the number of new Non-commented Lines Of Code (NLOC) written for this lab assignment. You should use the CLC perl script on your code. If possible, break the NLOC down into the various features you needed to implement.
    • A summary of your activity log indicating how much time you spent on each phase of the assignment. Please report the time in the following categories:
      • Designing
      • Coding
      • Debugging (before you think it's working)
      • Testing (after you think it's working)
      • Report writing
      • Other
    • A narrative describing any specific problems you encountered and how you solved them.
  • Conclusions (what you learned, suggestions of how the lab could be improved, things you would have done differently, etc.)
  • Documented source code (clearly identifying any changes made since your last submission). Note: you should include all the source code necessary to compile your project except for unmodified source code written by Dr. Welch. For example, you don't need to include shell.cpp if you didn't modify it.
    You may wish to use gensrc, a shell script which will produce an XML document that may be used as a starting point for your report. The file will include all of the source code files (provided you modify the script appropriately... edit gensrc for details on how to do this.)
  • Extra credit is available but only if it is clearly identified during the demonstration and in your report.
  • Be sure to address any areas concern from previous submissions.

As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic Submission Guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well.

If you have any questions, consult the instructor.

© 1998-2001 Dr. Christopher C. Taylor Office: CC-27C Phone: 277-7339 Last Updated: May 9, 2001
I am responsible for all content posted on these pages; MSOE is welcome to share these opinions but may not want to.