Free Electron
PlantModelI.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_PlantModelI_h__
8 #define __vegetation_PlantModelI_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Vegetation subsystem
17 
18  @ingroup vegetation
19 *//***************************************************************************/
20 class FE_DL_EXPORT PlantModelI:
21  virtual public Component,
22  public CastableAs<PlantModelI>
23 {
24  public:
25 
26  //* TODO consider using a Record
27  /// @brief Stem Segment in a PlantModelI
28  class Stick: public CastableAs<Stick>
29  {
30  public:
31  virtual ~Stick(void) {}
32  virtual const SpatialVector& base(void) const =0;
33  virtual const SpatialVector& span(void) const =0;
34  virtual const SpatialQuaternion& rotation(void) const =0;
35  virtual Real radius1(void) const =0;
36  virtual Real radius2(void) const =0;
37  virtual I32 resolution(void) const =0;
38  virtual String stateString(void) const =0;
39  virtual void setWindVelocity(
40  const SpatialVector& a_windVelocity)=0;
41  virtual void setTarget(
42  const SpatialVector& a_target) =0;
43  virtual void setTargeted(const I32 a_targeted) =0;
44  };
45 
46  /// @brief Organ of photosynthesis and transpiration
47  class Leaf: public CastableAs<Leaf>
48  {
49  public:
50  virtual ~Leaf(void) {}
51  virtual const SpatialVector& center(void) const =0;
52  virtual const SpatialVector& normal(void) const =0;
53  };
54 
55 virtual void reset(void) =0;
56 virtual void generate(const Record seed) =0;
57 virtual void addBranch(U32 a_fromIndex,U32 a_toIndex,
58  U32 a_level,Real a_radius1,Real a_radius2,
59  const SpatialVector& a_span,
60  Real a_rigidity) =0;
61 virtual void prepare(void) =0;
62 virtual void update(const Real deltaT) =0;
63 
64 virtual U32 numSticks(void) const =0;
65 virtual Stick* stick(U32 index) =0;
66 
67 virtual U32 numLeaves(void) const =0;
68 virtual Leaf* leaf(U32 index) =0;
69 virtual
70 const SpatialVector* leafPoints(void) const =0;
71 virtual
72 const SpatialVector* leafNormals(void) const =0;
73 
74 virtual U32 stickBundles(void) const =0;
75 virtual U32 stickBundleSize(U32 bundle) const =0;
76 virtual
77 const SpatialTransform* stickTransforms(U32 bundle) const =0;
78 virtual
79 const SpatialVector* stickScale(U32 bundle) const =0;
80 virtual
81 const Real* stickBaseScale(U32 bundle) const =0;
82 virtual
83 const U32* stickSlices(U32 bundle) const =0;
84 
85 virtual void setLocation(const SpatialVector& location) =0;
86 virtual void setOffset(const SpatialVector& offset) =0;
87 
88 virtual sp<SurfaceI> collider(void) =0;
89 virtual void setCollider(sp<SurfaceI> a_spCollider) =0;
90 
91 virtual SpatialTransform& colliderTransform(void) =0;
92 virtual void setColliderTransform(
93  const SpatialTransform& a_rspColliderTransform) =0;
94 
95 virtual SpatialVector& effectorForce(void) =0;
96 
97 virtual void setGravity(const SpatialVector& a_gravity) =0;
98 virtual void setUniformVelocity(const SpatialVector& a_velocity) =0;
99 virtual void setUniformRigidity(const Real a_rigidity) =0;
100 virtual void setDamping(const Real a_damping) =0;
101 virtual void setReactivity(const Real a_reactivity) =0;
102 virtual void setThreshold(const Real a_threshold) =0;
103 virtual void setCollisionMethod(
104  const String a_collisionMethod) =0;
105 virtual void setCollideEnd(const BWORD a_collideEnd) =0;
106 virtual void setRepulsion(const Real a_repulsion) =0;
107 virtual void setRepulsionFalloff(const Real a_repulsionFalloff) =0;
108 virtual void setDepletion(const Real a_depletion) =0;
109 virtual void setDepletionFalloff(const Real a_depletionFalloff) =0;
110 virtual void setWindHampering(const Real a_windHampering) =0;
111 virtual void setWindFalloff(const Real a_windFalloff) =0;
112 virtual void setPlasticity(const Real a_plasticity) =0;
113 virtual void setCompensation(const BWORD a_compensation) =0;
114 virtual void setCorrection(const BWORD a_correction) =0;
115 };
116 
117 } /* namespace ext */
118 } /* namespace fe */
119 
120 #endif /* __vegetation_PlantModelI_h__ */
Stem Segment in a PlantModelI.
Definition: PlantModelI.h:28
kernel
Definition: namespace.dox:3
Organ of photosynthesis and transpiration.
Definition: PlantModelI.h:47
Automatically reference-counted string container.
Definition: String.h:128
Reference to an instance of a Layout.
Definition: RecordSB.h:35
Base for all interfacable components.
Definition: Component.h:20
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
Vegetation subsystem.
Definition: PlantModelI.h:20
Per-class participation non-RTTI fallback dynamic casting mechanism.
Definition: Castable.h:192