File: Plant.h

package info (click to toggle)
mercator 0.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,008 kB
  • sloc: sh: 10,433; cpp: 4,482; makefile: 115
file content (67 lines) | stat: -rw-r--r-- 1,774 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// This file may be redistributed and modified only under the terms of
// the GNU General Public License (See COPYING for details).
// Copyright (C) 2004 Alistair Riddoch

#ifndef MERCATOR_PLANT_H
#define MERCATOR_PLANT_H

#include <wfmath/point.h>
#include <wfmath/quaternion.h>

namespace Mercator {

/// \brief This is the simple class for representing instances of vegetation.
///
/// It is used in instances of class Forest to represent each instance
/// of vegetation created when the Forest is populated.
class Plant {
  private:
    /// Position of the vegetation relative to its grid point.
    WFMath::Point<2> m_displacement;
    /// Orientation of the vegetation.
    WFMath::Quaternion m_orientation;
    /// Height of the vegetation.
    float m_height;
  public:
    /// Height is initialised explicitly to zero.
    Plant();
    /// Nothing special in the destructor.
    ~Plant();

    /// Accessor for displacement from grid point.
    const WFMath::Point<2> & getDisplacement() const {
        return m_displacement;
    }

    /// Set the displacement to a new value.
    void setDisplacement(const WFMath::Point<2> & d) {
        m_displacement = d;
    }

    /// Accessor for orientation.
    const WFMath::Quaternion & getOrientation() const {
        return m_orientation;
    }

    /// Set the orientation to a new value.
    void setOrientation(const WFMath::Quaternion & o) {
        m_orientation = o;
    }

    /// Accessor for height.
    const float getHeight() const {
        return m_height;
    }

    /// Set the height to a new value.
    void setHeight(float h) {
        m_height = h;
    }

    /// Set a named parameter value for this plant.
    void setParameter(const std::string &, float) { }
};

}

#endif // MERCATOR_PLANT_H