Difference between revisions of "Render Part C Assignment"

From CSE425S Wiki
Jump to navigation Jump to search
Line 15: Line 15:
 
:up
 
:up
 
:down</nowiki>
 
:down</nowiki>
 +
 +
:left corresponds to translating along the negative x axis
 +
 +
:right corresponds to translating along the positive x axis
 +
 +
:down corresponds to translating along the negative y axis
 +
 +
:up corresponds to translating along the positive y axis
  
 
===calculate_bounds===
 
===calculate_bounds===

Revision as of 02:06, 19 July 2019

In this studio we will evolve our code from Render_Part_B_Assignment to add new methods and a new class.

Render part c class hierarchy.svg

Continue editing files in the render/assignment directory.

Code to Implement

Transform

move

the move method will accept two parameters: direction and amount.

direction can be one of four symbols

:left
:right
:up
:down
left corresponds to translating along the negative x axis
right corresponds to translating along the positive x axis
down corresponds to translating along the negative y axis
up corresponds to translating along the positive y axis

calculate_bounds

Rectangle

calculate_local_bounds

BezierCurve, Chord, Ellipse, EquilateralTriangle, Image, Text

Imagine what it would be like to define calculate_local_bounds for each of these classes.

CompositeTransform

calculate_local_bounds

Scene

calculate_bounds

ConvexPolygon

render_transformed

calculate_local_bounds