RandomSizeShapeFactory Class Reference
#include <shapefactory.h>
Static Public Member Functions | |
static Shape * | createShape (std::string name) |
Detailed Description
A factory class to generate Shapes with randomly generated sizes/dimensions.
Member Function Documentation
◆ createShape()
|
static |
Static factory method for creating shapes. Takes in a string representation of a shape and returns a pointer to that particular shape. Only works for shapes that derive from the Shape object. Center points for returned shapes will always be (0,0).
- Precondition
- None
- Postcondition
- Does not change the object
- Parameters
-
name The name of the shape to generate (e.g. "triangle", "rectangle", or "circle"). Input is case-sensitive.
- Returns
- A pointer to a Shape object dynamically allocated on the heap if "name" is a valid, recognized shape type or NULL if "name" does not specify the name of a known shape.
The documentation for this class was generated from the following files:
- /home/awalsh128/doxygen-themes/example_src/shapefactory.h
- /home/awalsh128/doxygen-themes/example_src/shapefactory.cpp