Subversion Repositories public iLand

Rev

Rev 1182 | Rev 1203 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1182 Rev 1190
Line 885... Line 885...
885
885
886
    const SpeciesSet *set = GlobalSettings::instance()->model()->ru()->speciesSet();
886
    const SpeciesSet *set = GlobalSettings::instance()->model()->ru()->speciesSet();
887
    double height, age;
887
    double height, age;
888
    int total = 0;
888
    int total = 0;
889
    for (int row=0;row<init.rowCount();++row) {
889
    for (int row=0;row<init.rowCount();++row) {
890
        int pxcount = init.value(row, icount).toDouble() * area_factor + 0.5; // no. of pixels that should be filled (sapling grid is the same resolution as the lif-grid)
-
 
-
 
890
        int pxcount = qRound(init.value(row, icount).toDouble() * area_factor + 0.5); // no. of pixels that should be filled (sapling grid is the same resolution as the lif-grid)
891
        const Species *species = set->species(init.value(row, ispecies).toString());
891
        const Species *species = set->species(init.value(row, ispecies).toString());
892
        if (!species)
892
        if (!species)
893
            throw IException(QString("Error while loading saplings: invalid species '%1'.").arg(init.value(row, ispecies).toString()));
893
            throw IException(QString("Error while loading saplings: invalid species '%1'.").arg(init.value(row, ispecies).toString()));
894
        height = iheight==-1?0.05: init.value(row, iheight).toDouble();
894
        height = iheight==-1?0.05: init.value(row, iheight).toDouble();
895
        age = iage==-1?1:init.value(row,iage).toDouble();
895
        age = iage==-1?1:init.value(row,iage).toDouble();