Difference between revisions of "Render Part B Assignment"

From CSE425S Wiki
Jump to navigation Jump to search
Line 19: Line 19:
  
 
==Image==
 
==Image==
[[Render_Part_A_Assignment#Image|from Part A]]
+
You will evolve your code from [[Render_Part_A_Assignment#Image|from Part A]]
  
 
superclass: Transform
 
superclass: Transform
 +
 +
be sure to not override render.  implement the render_transformed method instead.
  
 
==ColorTransform==
 
==ColorTransform==

Revision as of 07:29, 15 July 2019

In this studio we will evolve our code from Render_Part_A_Assignment to leverage class hierarchies.

File:Part b class hierarchy.png

Continue editing files in the render/assignment directory.

In this studio, we will have parameters for which explicitly passed arguments are not required (for convenience and backwards compatibility). We will prefer keyword arguments over optional arguments.

Code to Implement

Transform

superclass: Object

Transform's constructor should take x and y parameters and store them in instance variables.

It should define a render method which preserves the current model view transformation, translates in the z==0 plane, passes the render_transformed message to itself, and restores the model view transformation.

All subclasses must implement a private render_transformed method.

Image

You will evolve your code from from Part A

superclass: Transform

be sure to not override render. implement the render_transformed method instead.

ColorTransform

superclass: Transform

Text

from Part A

superclass: ColorTransform

Ellipse

from Part A

superclass: ColorTransform

EquilateralTriangle

from Part A

superclass: ColorTransform

BezierCurve

from Part A

superclass: ColorTransform

Chord

from Part A

superclass: ColorTransform

Rectangle

from Part A

superclass: ColorTransform

CompositeTransform

superclass: Transform

class Scene

superclass: Object

Testing Your Solution

Unit Testing

ruby/render/part_b_test/part_b_unit_test.rb

Visual Comparison

ruby/render/part_b_test/part_b_test_snapshots_web_page_generator.rb