示例#1
0
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;
}
示例#2
0
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;
}
示例#3
0
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;
}