Rev 779 | Rev 895 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 779 | Rev 824 | ||
---|---|---|---|
Line 389... | Line 389... | ||
389 | }
|
389 | }
|
390 | foreach(const Tree &t, mTrees) { |
390 | foreach(const Tree &t, mTrees) { |
391 | resourceUnitSpecies(t.species()).statistics().add(&t, 0); |
391 | resourceUnitSpecies(t.species()).statistics().add(&t, 0); |
392 | }
|
392 | }
|
393 | 393 | ||
- | 394 | }
|
|
- | 395 | ||
- | 396 | void ResourceUnit::setSaplingHeightMap(float *map_pointer) |
|
- | 397 | {
|
|
- | 398 | // set to zero
|
|
- | 399 | mSaplingHeightMap=map_pointer; |
|
- | 400 | if (!mSaplingHeightMap) |
|
- | 401 | return; |
|
- | 402 | for (int i=0;i<cPxPerRU*cPxPerRU;i++) |
|
- | 403 | mSaplingHeightMap[i]=0.f; |
|
- | 404 | // flag all trees in the resource unit
|
|
- | 405 | for (QVector<Tree>::const_iterator i=mTrees.cbegin(); i!= mTrees.cend(); ++i) { |
|
- | 406 | setMaxSaplingHeightAt(i->positionIndex(), 10.f); |
|
- | 407 | }
|
|
394 | }
|
408 | }
|
395 | 409 | ||
396 | void ResourceUnit::setMaxSaplingHeightAt(const QPoint &position, const float height) |
410 | void ResourceUnit::setMaxSaplingHeightAt(const QPoint &position, const float height) |
397 | {
|
411 | {
|
398 | Q_ASSERT(mSaplingHeightMap); |
412 | Q_ASSERT(mSaplingHeightMap); |