Subversion Repositories public iLand

Rev

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

Rev 40 Rev 47
Line 16... Line 16...
16
    StampContainer();
16
    StampContainer();
17
    ~StampContainer();
17
    ~StampContainer();
18
    void useLookup(const bool use) { m_useLookup = use; }
18
    void useLookup(const bool use) { m_useLookup = use; }
19
    /// addStamp() add a pre-allocated stamp @param stamp to internal collection. Caller must allocate stamp on the heap,
19
    /// addStamp() add a pre-allocated stamp @param stamp to internal collection. Caller must allocate stamp on the heap,
20
    /// freeing is done by this class.
20
    /// freeing is done by this class.
21
    int addStamp(Stamp* stamp, const float bhd, const float hd_value);
-
 
-
 
21
    int addStamp(Stamp* stamp, const float bhd, const float hd_value, const float crown_radius_m);
22
    int addReaderStamp(Stamp *stamp, const float crown_radius_m);
22
    int addReaderStamp(Stamp *stamp, const float crown_radius_m);
23
    const Stamp* stamp(const float bhd_cm, const float height_m) const;
23
    const Stamp* stamp(const float bhd_cm, const float height_m) const;
24
    const Stamp* readerStamp(const float crown_radius_m) const; ///< retrieve reader-stamp. @param radius of crown in m. @return the appropriate stamp or NULL if not found.
24
    const Stamp* readerStamp(const float crown_radius_m) const; ///< retrieve reader-stamp. @param radius of crown in m. @return the appropriate stamp or NULL if not found.
25
    const int count() const { return m_stamps.count(); }
25
    const int count() const { return m_stamps.count(); }
26
    /// save the content of the StampContainer to the output stream (binary encoding)
26
    /// save the content of the StampContainer to the output stream (binary encoding)
Line 29... Line 29...
29
    void load(QDataStream &in);
29
    void load(QDataStream &in);
30
30
31
    /** factory creation function for stamps of different size.
31
    /** factory creation function for stamps of different size.
32
        newStamp() creates new Stamp-Objects on the heap with a given type (see @enum Stamp::StampType).*/
32
        newStamp() creates new Stamp-Objects on the heap with a given type (see @enum Stamp::StampType).*/
33
    static Stamp* newStamp(const Stamp::StampType type);
33
    static Stamp* newStamp(const Stamp::StampType type);
-
 
34
    /** this functions attaches the appropriate reader (dep. on crown radius) to each stamp of the container.
-
 
35
        The reader-stamp is returned by a call to the reader()-function of the Stamp itself.
-
 
36
        @param Container holding the reader stamps.*/
-
 
37
    void attachReaderStamps(const StampContainer &source);
34
38
35
    QString dump();
39
    QString dump();
36
40
37
private:
41
private:
38
    static const int cBHDclassWidth;
42
    static const int cBHDclassWidth;
Line 43... Line 47...
43
    static const int cHDclassCount; ///< class count. highest class: 140-150
47
    static const int cHDclassCount; ///< class count. highest class: 140-150
44
    struct StampItem {
48
    struct StampItem {
45
        Stamp* stamp;
49
        Stamp* stamp;
46
        float bhd;
50
        float bhd;
47
        float hd;
51
        float hd;
-
 
52
        float crown_radius;
48
    };
53
    };
49
    inline int getKey(const float bhd, const float hd_value);
54
    inline int getKey(const float bhd, const float hd_value);
50
    int m_maxBhd;
55
    int m_maxBhd;
51
    bool m_useLookup; // use lookup table?
56
    bool m_useLookup; // use lookup table?
52
    QList<StampItem> m_stamps;
57
    QList<StampItem> m_stamps;