27 lines
531 B
Plaintext
27 lines
531 B
Plaintext
Shape class
|
|
data:
|
|
color (required)
|
|
1st point
|
|
# points
|
|
functions:
|
|
constructor(color)? <- optional
|
|
shape::shape(...) <- do this in child?
|
|
copy constructor
|
|
assignment operator
|
|
destructor (virtual)
|
|
draw <- pure virtual
|
|
Shape::draw(Graphics context gc)
|
|
gc->setColor(color)
|
|
|
|
|
|
|
|
|
|
|
|
Shape * S1 = new Line(...)
|
|
Shape * S2 = new Triangle(...)
|
|
|
|
S1->draw(...) draw Line
|
|
S2->draw(...) draw Triangle
|
|
|
|
|
|
Image class |