Now we see it at work...
Color *yellow = new Color( 1.0, 1.0, 0.0 ); // yellow
Color *green = new Color( 0.0, 1.0, 0.0 ); // green
body *c1 = new cylinder (1.,2.); // default-colored cylinder
body *c2 = new cylinder (1.,2.,*green); // green cylinder
body *c3 = new cube (1.,*yellow); // yellow cube
cylinder of radius 1 height 2 Color ( 0, 0, 0 )
cylinder of radius 1 height 2 Color ( 0, 1, 0 )
cube of length 1 Color ( 1, 1, 0 )
Here we had ‘cylinder” and “cube” before
That’s it! The fully functional, fully by-the-rules body class and its children.
Find the code in the 9_body_final/ directory.