Subversion Repositories public iLand

Rev

Rev 549 | Rev 603 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1
 
106 Werner 2
#ifndef STANDLOADER_H
3
#define STANDLOADER_H
287 werner 4
#include <QtCore/QString>
106 Werner 5
 
6
class Model;
187 iland 7
class ResourceUnit;
290 werner 8
class RandomCustomPDF;
9
class Species;
106 Werner 10
class StandLoader
11
{
12
public:
290 werner 13
    StandLoader(Model *model): mModel(model), mRandom(0) {}
14
    ~StandLoader();
106 Werner 15
    void processInit();
393 werner 16
    /// load a single tree file (picus or iland style). return number of trees loaded.
17
    int loadPicusFile(const QString &fileName, ResourceUnit *ru=NULL);
18
    /// load a tree distribution based on dbh classes. return number of trees loaded.
549 werner 19
    int loadiLandFile(const QString &fileName, ResourceUnit *ru=NULL, int stand_id=0);
389 werner 20
    int loadSingleTreeList(const QString &content, ResourceUnit*ru = NULL, const QString &fileName="");
549 werner 21
    int loadDistributionList(const QString &content, ResourceUnit *ru = NULL, int stand_id=0, const QString &fileName="");
600 werner 22
    // load regeneration in stands
23
    int loadSaplings(const QString &content, int stand_id, const QString &fileName=QString());
106 Werner 24
private:
290 werner 25
    struct InitFileItem
26
    {
27
        Species *species;
28
        int count;
29
        double dbh_from, dbh_to;
30
        double hd;
31
        int age;
311 werner 32
        double density;
290 werner 33
    };
393 werner 34
    /// load tree initialization from a file. return number of trees loaded.
549 werner 35
    int loadInitFile(const QString &fileName, const QString &type, int stand_id=0, ResourceUnit *ru=NULL);
393 werner 36
    void executeiLandInit(ResourceUnit *ru); ///< shuffle tree positions
549 werner 37
    void executeiLandInitStand(int stand_id); ///< shuffle tree positions
393 werner 38
    void copyTrees(); ///< helper function to quickly fill up the landscape by copying trees
39
    void evaluateDebugTrees(); ///< set debug-flag for trees by evaluating the param-value expression "debug_tree"
106 Werner 40
    Model *mModel;
290 werner 41
    RandomCustomPDF *mRandom;
600 werner 42
    QVector<InitFileItem> mInitItems;
106 Werner 43
};
44
 
45
#endif // STANDLOADER_H