Called in Picture::output() . It determines whether a
Shape can be output. If it can, and an output() function
for the type of the Shape exists, a vector<Shape*>
containing a pointer to the Shape is returned.
On the other
hand, it is possible to define a type derived from Shape , without
an output() function of its own, and not derived from a type that
has one. It may then consist of one or more objects of types that do
have output() functions. In this case, the vector<Shape*>
returned by extract() will contain pointers to all of these
subsidiary Shapes , and Picture::output() will treat them
as independent objects. In particular, if any one of them cannot be
projected using the arguments passed to Picture::output() , this
will have no effect on whether the others are outputted or not.
Currently, there are no Shapes without an output()
function, either belonging to the class, or inherited. However, it's
useful to be able to define Shapes in this way, so that they can
be tested without having to define an output() function first.
|