NetDEM v1.0
Loading...
Searching...
No Matches
netdem::ShapeFactory Class Reference

A class for creating Shape objects using a factory pattern. More...

#include <shape_factory.hpp>

Static Public Member Functions

static ShapeNewShape (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::Typeshape_map
 A map of valid Shape names and types.
 

Detailed Description

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.

Member Function Documentation

◆ NewShape()

Shape * ShapeFactory::NewShape ( std::string const & shape_name,
nlohmann::json const & js )
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.

Parameters
shape_nameThe name of the Shape object to create.
jsThe JSON structure to initialize the new Shape object with.
Returns
A pointer to the new Shape object.

Member Data Documentation

◆ shape_map

unordered_map< string, Shape::Type > ShapeFactory::shape_map
static
Initial value:
= {
{"none", Shape::Type::none},
{"point_sphere", Shape::Type::point_sphere},
{"sphere", Shape::Type::sphere},
{"spherical_harmonics", Shape::Type::spherical_harmonics},
{"trimesh", Shape::Type::trimesh},
{"trimesh_convex", Shape::Type::trimesh_convex},
{"ellipsoid", Shape::Type::ellipsoid},
{"polybezier", Shape::Type::polybezier},
{"triangle", Shape::Type::triangle},
{"plane", Shape::Type::plane},
{"cylinder", Shape::Type::cylinder},
{"poly_super_ellipsoid", Shape::Type::poly_super_ellipsoid},
{"poly_super_quadrics", Shape::Type::poly_super_quadrics},
{"level_set", Shape::Type::level_set},
{"netsdf", Shape::Type::netsdf},
{"coded_netsdf", Shape::Type::coded_netsdf}}
@ coded_netsdf
Definition shape.hpp:36
@ plane
Definition shape.hpp:30
@ sphere
Definition shape.hpp:23
@ poly_super_quadrics
Definition shape.hpp:33
@ triangle
Definition shape.hpp:29
@ trimesh
Definition shape.hpp:25
@ spherical_harmonics
Definition shape.hpp:24
@ trimesh_convex
Definition shape.hpp:26
@ point_sphere
Definition shape.hpp:22
@ level_set
Definition shape.hpp:34
@ netsdf
Definition shape.hpp:35
@ ellipsoid
Definition shape.hpp:27
@ cylinder
Definition shape.hpp:31
@ poly_super_ellipsoid
Definition shape.hpp:32
@ polybezier
Definition shape.hpp:28
@ none
Definition shape.hpp:21

A map of valid Shape names and types.


The documentation for this class was generated from the following files: