LayerModel* LayerModelFactory::makeLayer( Process::ProcessModel& proc, const Id<LayerModel>& viewModelId, const QByteArray& constructionData, QObject* parent) { auto lm = makeLayer_impl(proc, viewModelId, constructionData, parent); proc.addLayer(lm); return lm; }
LayerModel* ScenarioModel::makeLayer_impl( const id_type<LayerModel>& viewModelId, const QByteArray& constructionData, QObject* parent) { QMap<id_type<ConstraintModel>, id_type<AbstractConstraintViewModel>> map; QDataStream s{constructionData}; s >> map; auto scen = new TemporalScenarioLayer {viewModelId, map, *this, parent}; makeLayer_impl(scen); return scen; }
LayerModel* ScenarioModel::cloneLayer_impl( const id_type<LayerModel>& newId, const LayerModel& source, QObject* parent) { auto scen = new TemporalScenarioLayer{ static_cast<const TemporalScenarioLayer&>(source), newId, *this, parent}; makeLayer_impl(scen); return scen; }