Inheritance in Graphics

Slides:



Advertisements
Similar presentations
Slideshow 16, Mathematics Mr Richard Sasaki Room 307.
Advertisements

Patterns. PATTERNS A pattern constitutes a set of numbers or objects in which all the members are related with each other by a specific rule. It is also.
2 D shapes only have two dimensions, such as width and length Some are: Polygons and Some are: Not Polygons.
BASIC 2-Dimensional SHAPES OF GEOMETRY
Objective: To describe properties 2 D shapes
2.5 OOP Principles Part 2 academy.zariba.com 1. Lecture Content 1.Polymorphism 2.Cohesion 3.Coupling 2.
Chapter 15 Polymorphism and Virtual Functions. Learning Objectives Virtual Function Basics – Late binding – Implementing virtual functions – When to use.
Presentation On Shapes Basic Summary: On Shapes By Priyank Shah.
Facts about Area of Shapes Dr. Kent Bryant 5/2011.
Today we will derive and use the formula for the area of a triangle by comparing it with the formula for the area of a rectangle. derive = obtain or receive.
Perimeter & Area Lessons 19 & 20.
Exploring Area of Polygons
CS 450: Computer Graphics PIXEL AdDRESSING AND OBJECT GEOMETRY
CSCE 121: Introduction to Program Design and Concepts Dr. J. Michael Moore Spring 2015 Set 12: A Display Model 1 Based on slides created by Bjarne.
1.8: Perimeter, Circumference, and Area
By. Circle Draw a circle in the box Tell about its attributes: sides, angles, whether or not it’s a polygon. Add any additional information you know about.
Geometry: Area By Mrs. Hafer. What is area? Area tells the size of a shape or figure. It tells us the size of squares, rectangles, circles, triangles,
Different types of Shapes By: Raquel Rebbe We can make different shapes!! Circles Triangles Quadrilaterals And so much more!
Jeopardy Terminology Geometry This PowerPoint was revised from the original version from; geometry.ppt.
Definition: Rectangle A rectangle is a quadrilateral with four right angles.
2D shapes © D shapes How do most 2D shapes get their names? 3 – Triangle 5 – Pentagon 6 – Hexagon 7- Heptagon 8 – Octagon.
Creating Graphics— Lines and Shapes Follow the instructions on each slide.
Solid Figures Brought to you by powerpointpros.com.
Area, Circumference & Perimeter
Level 5 Areas of Compound Shapes. Compound Shapes Shapes Compound shapes Can you describe what a compound shape is?
Area of Composite Figures
Area of Composite Figures
By Mackenzie.  Defining Attributes:  6 flat faces  8 vertices  12 edges  Stacks and slides  Shape of faces is a square.
How many …?. What shape can you see? I can see some _____. Q1 Q1 stars.
9.1 PERIMETER AND AREA OF PARALLELOGRAMS Objective: Students find the perimeter and area of parallelograms.
Jeopardy Terminology Quiz Geometry All points on a circle are the same distance from this point. (100)
Warm up Give the formulas for how to find the area of a: Rectangle Triangle Circle Kite.
Surface area of a cylinder Imagine a cylinder opened out Rectangle Circle.
A square with side length of 5 feet B circle with the radius of 3 feet
Equations of Circles.
Desert Willow Elementary School
Area of a Rectangle = base x height
Equations of Circles.
What is a Unit Circle? A unit circle is a circle with a radius of one
Pyramids.
Area of Composite Figures
3.1 Surface Area of Prisms October
Name the shape below. rectangle rhombus square triangle A B C D
UNIT 8: 2-D MEASUREMENTS PERIMETER AREA SQUARE RECTANGLE PARALLELOGRAM
Concept. Skills Check 1-5 (I will scan it in at the end of class) Going over the quiz.
Geometry 2 Dimensional Shapes.
GEOMETRICAL SHAPES PREPARED BY SUJA T V PRT K V KANNUR.
The Circumference of a Circle
Section 12.2 Implicitly Defined Curves and Cicles
Equations of Circles.
Transformations: Dilations
Effects of Changing Dimensions on Perimeter and Area
Surface Area of Prisms and Cylinders
Polymorphism Professor Hugh C. Lauer CS-2303, System Programming Concepts (Slides include materials from The C Programming Language, 2nd edition, by Kernighan.
Shapes.
Performing Essential Operations
Event Driven Programming Anatomy – Handle
Cross section: Triangle
Graphics and FLTK CSCE 121 J. Michael Moore
SHAPES By: Ms. Conquest.
The area of a parallelogram and a triangle
Working with images and scenes
Geometry Vocabulary.
Rectangle, x = 100, y = 200 Ellipse, x = 200, y = 300 #1.
Surface Area.
Can you work out the next shape in the pattern?
Spell your name using word art from above
Area: Formulas and Derivations
2D Shapes Rectangle Circle Triangle Rectangle. What shape is the door? Rectangle.
Presentation transcript:

Inheritance in Graphics CSCE 121 J. Michael Moore Based on slides created by Carlos Soto.

An inherited class example: Shapes We can derive lots of different classes from a base Shape class Each has distinct properties, but they may share some attributes too Shape Ellipse Polygon Curve Line Circle Triangle Rectangle

An inherited class example: Shape What might be specific to each derived class (e.g. Circle, Ellipse, Polygon, Rectangle, etc.): Area, dimensions, center, etc. What all Shapes may have in common: Line color Location on screen Ability to be displayed/drawn on the screen HOW to draw is specific to each derived Shape class (recall overriding)

Simplified Shapes Classes Rectangle Circle

Simplified Shapes Classes position color get/set_color() get/set_position() draw() Note: draw is virtual! Circle radius get/set_radius() draw() Rectangle width height get/set_width() get/set_height() draw()