Mercator
Plant.h
1 // This file may be redistributed and modified only under the terms of
2 // the GNU General Public License (See COPYING for details).
3 // Copyright (C) 2004 Alistair Riddoch
4 
5 #ifndef MERCATOR_PLANT_H
6 #define MERCATOR_PLANT_H
7 
8 #include <wfmath/point.h>
9 #include <wfmath/quaternion.h>
10 
11 #include <string>
12 
13 namespace Mercator {
14 
19 class Plant {
20  private:
22  WFMath::Point<2> m_displacement;
24  WFMath::Quaternion m_orientation;
26  float m_height;
27  public:
29  Plant();
31  ~Plant();
32 
34  const WFMath::Point<2> & getDisplacement() const {
35  return m_displacement;
36  }
37 
39  void setDisplacement(const WFMath::Point<2> & d) {
40  m_displacement = d;
41  }
42 
44  const WFMath::Quaternion & getOrientation() const {
45  return m_orientation;
46  }
47 
49  void setOrientation(const WFMath::Quaternion & o) {
50  m_orientation = o;
51  }
52 
54  const float getHeight() const {
55  return m_height;
56  }
57 
59  void setHeight(float h) {
60  m_height = h;
61  }
62 
64  void setParameter(const std::string &, float) { }
65 };
66 
67 }
68 
69 #endif // MERCATOR_PLANT_H
void setOrientation(const WFMath::Quaternion &o)
Set the orientation to a new value.
Definition: Plant.h:49
WFMath::Quaternion m_orientation
Orientation of the vegetation.
Definition: Plant.h:24
Definition: Area.cpp:20
float m_height
Height of the vegetation.
Definition: Plant.h:26
const float getHeight() const
Accessor for height.
Definition: Plant.h:54
void setHeight(float h)
Set the height to a new value.
Definition: Plant.h:59
WFMath::Point< 2 > m_displacement
Position of the vegetation relative to its grid point.
Definition: Plant.h:22
~Plant()
Nothing special in the destructor.
Definition: Plant.cpp:13
const WFMath::Quaternion & getOrientation() const
Accessor for orientation.
Definition: Plant.h:44
void setDisplacement(const WFMath::Point< 2 > &d)
Set the displacement to a new value.
Definition: Plant.h:39
const WFMath::Point< 2 > & getDisplacement() const
Accessor for displacement from grid point.
Definition: Plant.h:34
void setParameter(const std::string &, float)
Set a named parameter value for this plant.
Definition: Plant.h:64
This is the simple class for representing instances of vegetation.
Definition: Plant.h:19
Plant()
Height is initialised explicitly to zero.
Definition: Plant.cpp:9