/* * ShapeFactory.hpp * * Created on: Sep 5, 2012 * Author: ankele */ #ifndef SHAPEFACTORY_HPP_ #define SHAPEFACTORY_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/Singleton.hpp" #include "LinearAlgebra/Vector.hpp" #include "Shape.hpp" class ShapeFactory : public Singleton { friend class Singleton; public: ShapeType getShapeByName(const std::string &name) const; std::string getShapeName(ShapeType type) const; const std::vector &getBaseShapeNames() const; bool isValidShapeName(const std::string &name) const; bool isSimpleShape(const ShapeType type) const; bool isSimpleShape(const std::string &name) const; // create a shape Shape produce(ShapeType type, const Vector &translation = Vector(0., 0., 0.), const Vector &stretch = Vector(1., 1., 1.), double angleX = 0, double angleY = 0, double angleZ = 0) const; private: // private constructor and destructor due to singleton ShapeFactory(); virtual ~ShapeFactory(); // name/type maps std::vector baseShapeNames; typedef std::map ShapeNameMap; ShapeNameMap shapeNameMap; typedef std::map NameShapeMap; NameShapeMap nameShapeMap; }; #endif /* SHAPEFACTORY_HPP_ */