NetDEM v1.0
|
A class for creating Shape objects using a factory pattern. More...
#include <shape_factory.hpp>
Static Public Member Functions | |
static Shape * | NewShape (std::string const &shape_name, nlohmann::json const &js) |
Create a new Shape object by name. | |
Static Public Attributes | |
static std::unordered_map< std::string, Shape::Type > | shape_map |
A map of valid Shape names and types. | |
A class for creating Shape objects using a factory pattern.
This class provides a static method for creating Shape objects by name and a map of valid Shape names and types.
|
static |
Create a new Shape object by name.
This static method creates a new Shape object of the specified type by name and initializes it from a JSON structure.
shape_name | The name of the Shape object to create. |
js | The JSON structure to initialize the new Shape object with. |
|
static |
A map of valid Shape names and types.