#ifndef _CIVINPEXPOTER_H
#define _CIVINPEXPOTER_H
#include "CivPgConn.h"
#include "CivNewInp.h"

/**
* 抽象建造者
*/
class CivBuilder
{
public:

	CivBuilder();
	virtual ~CivBuilder();

	virtual void setQualityType(const QualityAnalyType analyType, const std::string& qulityName) = 0;
	virtual void setDuration(int duration) = 0;
	virtual void registDb(CivDbConn* dbConn)=0;
	virtual void buildNode() = 0;
	virtual void buildPipe() = 0;
	virtual void buildTank() = 0;
	virtual void buildVavle() = 0;
	virtual void buildPump() = 0;
	virtual void buildReservoir() = 0;
	virtual void buildEmitter() = 0;
	virtual void buildPatterns() = 0;
	virtual void buildParamter() = 0;
	virtual void buildCoordnates() = 0;
	virtual void buildVertices() = 0;
	virtual void buildLabels() = 0;
	virtual void buildTags() = 0;
	virtual void buildBackDrop() = 0;
	virtual void buildQuality() = 0;
	virtual void buildSources() = 0;
	virtual void buildMixing() = 0;
	virtual void buildCurves() = 0;
	virtual void buildStatus() = 0;
	virtual void buildControls() = 0;
	virtual void buildRules() = 0;
	virtual void buildDemands() = 0;
	virtual CivNewInp* getNewInp();

protected:
	CivNewInp* mNewInp;
};


/**
* 导出inp文件类
*/
class CivInpBuilder:public CivBuilder
{
public:
	explicit CivInpBuilder();
	explicit CivInpBuilder(CivDbConn* dbConn);
	~CivInpBuilder();

	virtual void setQualityType(const QualityAnalyType analyType, const std::string& qulityName);
	virtual void setDuration(int duration);
	// 注册数据库连接
	virtual void registDb(CivDbConn* dbConn);
	virtual void buildNode();
	virtual void buildPipe();
	virtual void buildTank();
	virtual void buildVavle();
	virtual void buildPump();
	virtual void buildReservoir();
	virtual void buildEmitter();
	virtual void buildPatterns();
	virtual void buildParamter();
	virtual void buildCoordnates();
	virtual void buildVertices();
	virtual void buildLabels();
	virtual void buildTags();
	virtual void buildBackDrop();
	virtual void buildQuality();
	virtual void buildSources();
	virtual void buildMixing();
	virtual void buildCurves();
	virtual void buildStatus();
	virtual void buildControls();
	virtual void buildRules();
	virtual void buildDemands();
	virtual CivNewInp* getNewInp();       

private:
	CivDbConn* mDbConn;
};
#endif // !_CIVINPEXPOTER_H



