#pragma once

#include <string>
#include <map>
#include <list>
#include <TopTools_ListOfShape.hxx>
#include "nlohmann/json.hpp"
#include "topology/geometryData.h"
#include "base/base.h"
#include "misc/ProgressIndicator.hpp"
#include "mesh/MeshGenerator.h"
#include "TemplateType.h"
#include "setup/physics.hpp"

using json = nlohmann::json;

class BasicTemplate
{
public:
	BasicTemplate(std::string path);

	virtual void parseInputJSON(json* j) = 0;
	virtual void generateGeometry() = 0;
	virtual void assignMeshSizes(MeshGenerator_, GeometryData_, double, double) = 0;
	virtual bool validate(std::string&) = 0;

	GeometryData_ getGeometryData();
	void setProgressIndicator(std::shared_ptr<ProgressIndicator>);
	void setStopper(bool*);
	templateType getType();
	void setPhysics(std::vector<Physics> );
	std::string getName();
	void setIndex(int i);

protected:
	std::string project_path;
	std::string name;
	TopoDS_Shape compound;
	GeometryData_ geom_data;
	std::shared_ptr<ProgressIndicator> progress;
	bool* stopper;
	templateType type;

	// physics are used to determine meshing parameters in some cases
	std::vector<Physics> physics;
	int index;
};

typedef std::shared_ptr<BasicTemplate> BasicTemplate_;