#include "PointCloudFactory.h" #include "PointCloudSet.h" #include "CgnsBCZone.h" #include "CgnsFamily.h" namespace PointCloudData { QHash PointCloudFactory::_createSetFun = QHash(); PointCloudData::PointCloudSet* PointCloudFactory::CreatePointCloudSet(int type) { SetType stype = (SetType)type; PointCloudSet* set = nullptr; switch (stype) { case PointCloudData::Node: set = new PointCloudSet("", Node); break; case PointCloudData::Element: set = new PointCloudSet("", Element); break; case PointCloudData::Family: set = new CgnsFamily; break; case PointCloudData::BCZone: set = new CgnsBCZone; break; default: CREATEPointCloudSET fun = _createSetFun.value(type); if (fun!= nullptr) set = fun(type); break; } return set; } void PointCloudFactory::registerFunction(int type, CREATEPointCloudSET fun) { _createSetFun.insert(type, fun); } void PointCloudFactory::remove(int type) { _createSetFun.remove(type); } }