Chapter 5. The Figure Hierarchy

This chapter introduces the figure classes of the drawing program. Each figure is responsible for deciding whether it is hit by a mouse click or if it is enclosed by a rectangle. It is also responsible for moving or modifying, as well as drawing and communicating with a file stream and the clipboard.

The drawing figure hierarchy is made up of the Draw, LineFigure, ArrowFigure, RectangleFigure, and EllipseFigure classes, as shown in the following image:

The Figure Hierarchy

The DrawFigure class

The Draw class is the root class of the hierarchy and is mostly made up of virtual and pure virtual methods intended to be overridden by the subclasses. ...

Get C++ Windows Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.