Free Electron
Plant.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __vegetation_Plant_h__
8 #define __vegetation_Plant_h__
9 
10 FE_ATTRIBUTE("veg:plantmodel", "Physical vegetation sp<Component>");
11 FE_ATTRIBUTE("veg:plantsketch", "Drawable SketchI in sp<Component>");
12 FE_ATTRIBUTE("veg:plantname", "Growth data lookup key");
13 
14 namespace fe
15 {
16 namespace ext
17 {
18 
19 /**************************************************************************//**
20  @brief Plant RecordView
21 
22  @ingroup vegetation
23 *//***************************************************************************/
24 class FE_DL_EXPORT Plant: public RecordView
25 {
26  public:
27  Functor< sp<Component> > plantModel;
28  Functor< sp<Component> > plantSketch;
29  Functor<String> plantName;
30  Functor<SpatialVector> location; //* collective displacement
31  Functor<SpatialVector> offset; //* start of separate root
32  Functor<Real> reactivity;
33  Functor<Real> threshold;
34 //~ Functor<BWORD> collideSphere;
35  Functor<String> collisionMethod;
36  Functor<BWORD> collideEnd;
37  Functor<Real> repulsion;
38  Functor<Real> repulsionFalloff;
39  Functor<Real> depletion;
40  Functor<Real> depletionFalloff;
41  Functor<Real> windHampering;
42  Functor<Real> windFalloff;
43  Functor<Real> plasticity;
44 
45  Plant(void) { setName("Plant"); }
46 virtual void addFunctors(void)
47  {
48  add(plantModel, FE_USE("veg:plantmodel"));
49  add(plantSketch, FE_USE("veg:plantsketch"));
50  add(plantName, FE_USE("veg:plantname"));
51  add(location, FE_USE("spc:at"));
52  add(offset, FE_USE("spc:offset"));
53  add(reactivity, FE_USE("veg:reactivity"));
54  add(threshold, FE_USE("spc:threshold"));
55 //~ add(collideSphere, FE_USE("spc:collideSphere"));
56  add(collisionMethod, FE_USE("spc:collisionMethod"));
57  add(collideEnd, FE_USE("spc:collideEnd"));
58  add(repulsion, FE_USE("spc:repulsion"));
59  add(repulsionFalloff, FE_USE("spc:repulsionFalloff"));
60  add(depletion, FE_USE("spc:depletion"));
61  add(depletionFalloff, FE_USE("spc:depletionFalloff"));
62  add(windHampering, FE_USE("spc:windHampering"));
63  add(windFalloff, FE_USE("spc:windFalloff"));
64  add(plasticity, FE_USE("spc:plasticity"));
65  }
66 virtual void initializeRecord(void)
67  {
68  plantModel.attribute()->setSerialize(FALSE);
69  plantSketch.attribute()->setSerialize(FALSE);
70 
71  set(location());
72  set(offset());
73 
74  reactivity()=0.0;
75  threshold()=0.0;
76 //~ collideSphere()=FALSE;
77  collisionMethod()="";
78  collideEnd()=FALSE;
79  repulsion()=1.0;
80  repulsionFalloff()=0.0;
81  depletion()=1.0;
82  depletionFalloff()=0.0;
83  windHampering()=0.0;
84  windFalloff()=0.0;
85  plasticity()=0.0;
86  }
87 };
88 
89 } /* namespace ext */
90 } /* namespace fe */
91 
92 #endif /* __vegetation_Plant_h__ */
93 
virtual void initializeRecord(void)
Called at instantiation to initialize attributes.
Definition: Plant.h:66
kernel
Definition: namespace.dox:3
Bound accessor in a RecordView.
Definition: RecordView.h:147
Plant RecordView.
Definition: Plant.h:24
sp< Attribute > attribute(void) const
Return the attribute this accessor is for.
Definition: Accessor.cc:151
Bindable collection of accessor Functors.
Definition: RecordView.h:106
virtual void addFunctors(void)
Called at instantiation to add functors.
Definition: Plant.h:46