Subversion Repositories public iLand

Rev

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

Rev 1178 Rev 1179
Line 357... Line 357...
357
357
358
    kernel.setup(mSeedMap.cellsize(), 2*max_radius + 1 , 2*max_radius + 1);
358
    kernel.setup(mSeedMap.cellsize(), 2*max_radius + 1 , 2*max_radius + 1);
359
    int kernel_offset = max_radius;
359
    int kernel_offset = max_radius;
360
360
361
    // filling of the kernel.... use the treemig
361
    // filling of the kernel.... use the treemig
-
 
362
    double dist_center_cell = sqrt(cell_size*cell_size/M_PI);
362
    QPoint center = QPoint(kernel_offset, kernel_offset);
363
    QPoint center = QPoint(kernel_offset, kernel_offset);
363
    const float *sk_end = kernel.end();
364
    const float *sk_end = kernel.end();
364
    for (float *p=kernel.begin(); p!=sk_end;++p) {
365
    for (float *p=kernel.begin(); p!=sk_end;++p) {
365
        double d = kernel.distance(center, kernel.indexOf(p));
366
        double d = kernel.distance(center, kernel.indexOf(p));
366
        if (d==0.)
367
        if (d==0.)
367
            *p = treemig_centercell(sqrt(cell_size*cell_size/M_PI)); // r is the radius of a circle with the same area as a cell
-
 
-
 
368
            *p = treemig_centercell(dist_center_cell); // r is the radius of a circle with the same area as a cell
368
        else
369
        else
369
            *p = d<=max_dist?static_cast<float>(treemig(d)):0.f;
-
 
-
 
370
            *p = d<=max_dist?static_cast<float>(( treemig(d+dist_center_cell) + treemig(d+dist_center_cell))/2. ):0.f;
370
    }
371
    }
371
372
372
    // normalize
373
    // normalize
373
    float sum = kernel.sum();
374
    float sum = kernel.sum();
374
    if (sum==0. || occupation==0.)
375
    if (sum==0. || occupation==0.)