Program 4 - Graphical Objects

Goal Description Hints Passoff

Due Date - 28 Oct

Goal

 
  • Learn how to create objects with methods
  • Learn to build complex scenes from simpler scenes
 CS 142
Description
 

You should implement the following classes

  • Table - This should create a 4 legged table of any color that you desire. This class should have a constructor that allows the setting of the length, width and hieght of the table. This class should also have methods to get and set the length, width and hieght. When these values are set, the object should change its appearance if it is in a Win3D.
  • Chair - This can be a chair of any style. Its constructor should have a parameter for seat height and there should be get and set methods to change the seat height. Changing the seat height should change its appearance.
  • Plate - this is a plate of food with meat (flat cylinder), peas (little green spheres) and carrots (skinny orange cones).

Your main class should construct a scene with a table, 4 chairs and plates at each position with different food combinations on each plate.

You should animate the whole scene by having the chairs move themselves into position at the table and having the plates fly in from out of the sky.

Hints
 
  • Each class should be in its own class file.
  • Table, Chair and Plate should all be subclasses of GroupObj.
  • Table and Chair should have private variables for the size parameters. There should be a private method that sizes and places all of the parts based on the values of these variables. Your constructors should set these variables and then call the private method to get all of the pieces in the right places.
  • Whenever any of the set methods change something, you should set the appropriate private variable and then call your private method that places all the pieces in the right places.
  • START EARLY. This is a much longer problem than the previous ones.
  • Build each class one at a time and test it to be sure it works before going on to the next one. Build up step by step.
  • There is sample code for the City application. It is in three classes: Main, Building, and Road.
Passoff
 

__ 2) Good naming practices.

__ 2) Good use of public and private. Only what is necessary is public.

__ 4) Nice table that can be appropriately resized and correctly uses constructors and get/set methods.

__ 4) Nice chairs that can be appropriately sized and correctly uses constructors and get/set methods.

__ 2) Plates with nice food.

__ 4) Animation works correctly