/**
 *  \brief     MeshToVtkWriter class.
 *  \details   Provides methods to write mesh to different VTK formats and to pass mesh data to VTK.
 *  \author    vadims
 *  \date      Nov 22, 2019
 *  \bug       Not all memory is freed when deleting an object of this class.
 *  \warning   Improper use can crash your application
 *  \copyright CENOS LLC
 */

#ifndef MESHTOVTKWRITER_H
#define MESHTOVTKWRITER_H


#include <vtkSmartPointer.h>
#include <vtkUnstructuredGrid.h>
#include "Mesh.h"
#include "vtkForCenos/vtkForCenos.hpp"
#include "topology/geometryData.h"

class MeshToVtkWriter
{
private:
	std::shared_ptr<Mesh> mesh;

	/** Returns object of type vtkUnstructuredGrid
	 * Needed for passing this object to vtkForCenos class
	 */
	vtkSmartPointer<vtkUnstructuredGrid> createVtkUnstructuredGrid(std::vector<MeshEntity_> entity, int grid_id);

public:
	MeshToVtkWriter(std::shared_ptr<Mesh>);
	~MeshToVtkWriter();

	void createMultiblockMesh(vtkForCenos&, std::vector<int>, GeometryData_);

};


#endif // MESHTOVTKWRITER_H