
please wait
Rectangle
, Polygon
, ect... which is from the base class Shape
has a function void draw_lines() const
which draws the lines of a shape (it is different for each shape), but void draw_lines() const
is not called in any of the constructors of the classes such as Rectangle
, Polygon
, ect... The only function called in the constructors of those classes is void Shape::add(Point p)
, it adds a Point
to the member variable vector<Point> Shape::points
(basically Point
is a coordinate system for the window. So when you make an object of class Rectangle
you pass all the arguments and it calls void Shape::add(Point p)
, but it doesn't call void Shape::Rectangle::void draw_lines()
. My question is how are the lines drawn if void Shape::Rectangle::void draw_lines()
isn't called in the constructor or in void Shape::add(Point p)
?
Window::draw()
? I thought it would be called in Window::attach()
when you attach a shape to a window, but it's not.