1.3.49
 
Loading...
Searching...
No Matches
CanopyGenerator.cpp File Reference
#include "CanopyGenerator.h"
#include "pugixml.hpp"

Go to the source code of this file.

Functions

float getVariation (float V, std::minstd_rand0 &generator, bool positive)
 Draw a random number (float) from a uniform distribution between -V and V.
 
int getVariation (int V, std::minstd_rand0 &generator, bool positive)
 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< 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 source 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.cpp.

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.