1.3.49
 
Loading...
Searching...
No Matches
CanopyGenerator.h File Reference
#include <random>
#include "Context.h"

Go to the source code of this file.

Data Structures

struct  BaseCanopyParameters
 Base struct class for Canopy parameters. More...
 
struct  HomogeneousCanopyParameters
 Parameters defining the homogeneous canopy. More...
 
struct  SphericalCrownsCanopyParameters
 Parameters defining the canopy with spherical crowns. More...
 
struct  ConicalCrownsCanopyParameters
 Parameters defining the canopy with conical crowns. More...
 
struct  BaseGrapeVineParameters
 
struct  VSPGrapevineParameters
 Parameters defining the grapevine canopy with vertical shoot positioned (VSP) trellis. More...
 
struct  SplitGrapevineParameters
 Parameters defining the grapevine canopy with a split (quad) trellis. More...
 
struct  UnilateralGrapevineParameters
 Parameters defining the grapevine canopy with unilateral trellis. More...
 
struct  GobletGrapevineParameters
 Parameters defining the grapevine canopy with goblet (vent a taille) trellis. More...
 
struct  WhiteSpruceCanopyParameters
 Parameters defining the white spruce. More...
 
struct  TomatoParameters
 Parameters defining the tomato plant canopy. More...
 
struct  StrawberryParameters
 Parameters defining the strawberry plant canopy. More...
 
struct  WalnutCanopyParameters
 Parameters defining the walnut tree canopy. More...
 
struct  SorghumCanopyParameters
 Parameters defining Sorghum plant canopy. More...
 
struct  BeanParameters
 Parameters defining the bean plant canopy. More...
 
class  CanopyGenerator
 

Functions

float getVariation (float V, std::minstd_rand0 &generator, bool positive=false)
 Draw a random number (float) from a uniform distribution between -V and V.
 
int getVariation (int V, std::minstd_rand0 &generator, bool positive=false)
 Draw a random number (int) from a uniform distribution between -V and V.
 
uint getVariation (uint V, std::minstd_rand0 &generator)
 Draw a random number (uint) from a uniform distribution between 0 and V.
 
helios::vec3 interpolateTube (const std::vector< helios::vec3 > &P, float frac)
 Interpolate the position of a point along a tube.
 
float interpolateTube (const std::vector< float > &P, float frac)
 Interpolate the radius of a point along a tube.
 
float evaluateCDFresid (float thetaL, std::vector< float > &ru_v, const void *a_distribution)
 Evaluate the error between a predicted and actual leaf angle cumulative distribution at a given leaf angle.
 

Detailed Description

Primary header file for canopy geometry generator plug-in.

Copyright (C) 2016-2025 Brian Bailey

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Definition in file CanopyGenerator.h.

Function Documentation

◆ evaluateCDFresid()

float evaluateCDFresid ( float  thetaL,
std::vector< float > &  ru_v,
const void *  a_distribution 
)

Evaluate the error between a predicted and actual leaf angle cumulative distribution at a given leaf angle.

Parameters
[in]thetaLLeaf angle in radians.
[in]ru_vPredicted CDF value (on the first value in this vector is used - it is a vector so it matches the arguments needed by the 'fzero' function).
[in]a_distributionLabel for a "classical" leaf angle distribution (spherical, uniform, planophile, erectophile, plagiophile, extremophile).

Definition at line 3082 of file CanopyGenerator.cpp.

◆ getVariation() [1/3]

float getVariation ( float  V,
std::minstd_rand0 &  generator,
bool  positive = false 
)

Draw a random number (float) from a uniform distribution between -V and V.

Parameters
[in]VMaximum/minimum value of the distribution.
[in]generatorRandom number generator.
[in]positiveIf true, only positive values are returned.

Definition at line 2776 of file CanopyGenerator.cpp.

◆ getVariation() [2/3]

int getVariation ( int  V,
std::minstd_rand0 &  generator,
bool  positive = false 
)

Draw a random number (int) from a uniform distribution between -V and V.

Parameters
[in]VMaximum/minimum value of the distribution.
[in]generatorRandom number generator.
[in]positiveIf true, only positive values are returned.

Definition at line 2787 of file CanopyGenerator.cpp.

◆ getVariation() [3/3]

uint getVariation ( uint  V,
std::minstd_rand0 &  generator 
)

Draw a random number (uint) from a uniform distribution between 0 and V.

Parameters
[in]VMaximum/minimum value of the distribution.
[in]generatorRandom number generator.

Definition at line 2798 of file CanopyGenerator.cpp.

◆ interpolateTube() [1/2]

float interpolateTube ( const std::vector< float > &  P,
float  frac 
)

Interpolate the radius of a point along a tube.

Parameters
[in]PVector of radii making up the tube.
[in]fracFractional position along the tube.

Definition at line 3048 of file CanopyGenerator.cpp.

◆ interpolateTube() [2/2]

helios::vec3 interpolateTube ( const std::vector< helios::vec3 > &  P,
float  frac 
)

Interpolate the position of a point along a tube.

Parameters
[in]PVector of 3D points making up the tube.
[in]fracFractional position along the tube.

Definition at line 3014 of file CanopyGenerator.cpp.