#include <square.h>
Inherits sparkle::Shape.
Collaboration diagram for sparkle::Square:

Public Member Functions | |
ctors/dtor | |
| Square (int size=20) | |
Modifiers | |
| int | addNode (double x, double y) |
| int | removeNode (Node *nodeToRemove) |
| int | addEdge (int nodeIndex1, int nodeIndex2) |
Getters | |
Not necessarily const | |
| int | numOfNodes () const |
Example implementation of the shape class to create a simple square. The Square will be created with the first corner at the origin and the rest of the points in a square parallel to the axis in the positive quadrant.
|
|
Constructor
|
|
||||||||||||
|
Overridden as no nodes can be added to a square after creation
Reimplemented from sparkle::Shape. |
|
|
Overridden as no nodes can be removed from a square after creation
Reimplemented from sparkle::Shape. |
|
||||||||||||
|
Overridden as no edges can be added to a square after creation
Reimplemented from sparkle::Shape. |
|
|
Overridden to speed up slightly
Reimplemented from sparkle::Shape. |