Public Member Functions | |
CanopyGenerator (helios::Context *context) | |
Canopy geometry generator constructor. | |
template<typename CanopyType , typename... Args> | |
void | storeCanopyParameters (Args &&...args) |
Stores the given canopy parameters. | |
std::vector< std::shared_ptr< BaseCanopyParameters > > | getCanopyParametersList () |
void | loadXML (const char *filename, bool build=true) |
Reads the XML file of the given name and stores all the configured canopy parameters. | |
void | buildCanopies () |
Builds canopies for all the stored canopy parameters. | |
void | buildCanopy (const HomogeneousCanopyParameters ¶ms) |
Build a canopy consisting of a homogeneous volume of leaves. | |
void | buildCanopy (const SphericalCrownsCanopyParameters ¶ms) |
Build a canopy consisting of spherical crowns filled with homogeneous leaves. | |
void | buildCanopy (const ConicalCrownsCanopyParameters ¶ms) |
Build a canopy consisting of conical crowns filled with homogeneous leaves. | |
void | buildCanopy (const VSPGrapevineParameters ¶ms) |
Build a canopy consisting of grapevines on VSP trellis. | |
void | buildCanopy (const SplitGrapevineParameters ¶ms) |
Build a canopy consisting of grapevines on split trellis. | |
void | buildCanopy (const UnilateralGrapevineParameters ¶ms) |
Build a canopy consisting of grapevines on unilateral trellis. | |
void | buildCanopy (const GobletGrapevineParameters ¶ms) |
Build a canopy consisting of grapevines on Goblet trellis. | |
void | buildCanopy (const WhiteSpruceCanopyParameters ¶ms) |
Build a canopy consisting of white spruce trees. | |
void | buildCanopy (const TomatoParameters ¶ms) |
Build a canopy consisting of tomato plants. | |
void | buildCanopy (const StrawberryParameters ¶ms) |
Build a canopy consisting of strawberry plants. | |
void | buildCanopy (const WalnutCanopyParameters ¶ms) |
Build a canopy consisting of walnut trees. | |
void | buildCanopy (const SorghumCanopyParameters ¶ms) |
Build a canopy consisting of sorghum plants. | |
void | buildCanopy (const BeanParameters ¶ms) |
Build a canopy consisting of common bean plants. | |
void | buildGround (const helios::vec3 &ground_origin, const helios::vec2 &ground_extent, const helios::int2 &texture_subtiles, const helios::int2 &texture_subpatches, const char *ground_texture_file) |
Build a ground consisting of texture sub-tiles and sub-patches, which can be different sizes. | |
void | buildGround (const helios::vec3 &ground_origin, const helios::vec2 &ground_extent, const helios::int2 &texture_subtiles, const helios::int2 &texture_subpatches, const char *ground_texture_file, float ground_rotation) |
Build a ground with azimuthal rotation consisting of texture sub-tiles and sub-patches, which can be different sizes. | |
std::vector< uint > | getTrunkUUIDs (uint PlantID) |
Get the unique universal identifiers (UUIDs) for the primitives that make up the plant trunk. | |
std::vector< uint > | getTrunkUUIDs () |
Get the unique universal identifiers (UUIDs) for all trunk primitives in a single 1D vector. | |
std::vector< uint > | getBranchUUIDs (uint PlantID) |
Get the unique universal identifiers (UUIDs) for the primitives that make up the plant branches. | |
std::vector< uint > | getBranchUUIDs () |
Get the unique universal identifiers (UUIDs) for all branch primitives in a single 1D vector. | |
std::vector< std::vector< uint > > | getLeafUUIDs (uint PlantID) |
Get the unique universal identifiers (UUIDs) for the primitives that make up the plant leaves. | |
std::vector< uint > | getLeafUUIDs () |
Get the unique universal identifiers (UUIDs) for all leaf primitives in a single 1D vector. | |
std::vector< std::vector< std::vector< uint > > > | getFruitUUIDs (uint PlantID) |
Get the unique universal identifiers (UUIDs) for the primitives that make up the tree fruit. | |
std::vector< uint > | getFruitUUIDs () |
Get the unique universal identifiers (UUIDs) for all fruit primitives in a single 1D vector. | |
std::vector< uint > | getGroundUUIDs () |
Get the unique universal identifiers (UUIDs) for the primitives that make up the ground. | |
std::vector< uint > | getAllUUIDs (uint PlantID) |
Get the unique universal identifiers (UUIDs) for all primitives that make up the tree. | |
uint | getPlantCount () |
Get the current number of plants added to the Canopy Generator. | |
void | seedRandomGenerator (uint seed) |
Seed the random number generator. This can be useful for generating repeatable trees, say, within a loop. | |
void | disableMessages () |
Disable standard messages from being printed to screen (default is to enable messages) | |
void | enableMessages () |
Enable standard messages to be printed to screen (default is to enable messages) | |
void | buildIndividualPlants (helios::vec3 position) |
Builds individual plants based on the stored canopy parameters, at the given position. | |
void | buildIndividualPlants () |
Builds individual plants based on the stored canopy parameters (using canopy_origin as the position) | |
std::vector< std::vector< uint > > | addGrapeCluster (helios::vec3 position, float grape_rad, float cluster_rad, helios::RGBcolor grape_color, uint grape_subdiv) |
Function to add an individual grape berry cluster. | |
uint | grapevineVSP (const VSPGrapevineParameters ¶ms, const helios::vec3 &origin) |
Function to add an individual grapevine plant on a vertical shoot positioned (VSP) trellis. | |
uint | grapevineSplit (const SplitGrapevineParameters ¶ms, const helios::vec3 &origin) |
Function to add an individual grapevine plant on a split trellis. | |
uint | grapevineUnilateral (const UnilateralGrapevineParameters ¶ms, const helios::vec3 &origin) |
Function to add an individual grapevine plant on a unilateral trellis. | |
uint | grapevineGoblet (const GobletGrapevineParameters ¶ms, const helios::vec3 &origin) |
Function to add an individual grapevine plant on a goblet (vent a taille) trellis. | |
uint | whitespruce (const WhiteSpruceCanopyParameters ¶ms, const helios::vec3 &origin) |
Function to add an individual white spruce tree. | |
uint | tomato (const TomatoParameters ¶ms, const helios::vec3 &origin) |
Function to add an individual tomato plant. | |
uint | strawberry (const StrawberryParameters ¶ms, const helios::vec3 &origin) |
Function to add an individual strawberry plant. | |
uint | walnut (const WalnutCanopyParameters ¶ms, const helios::vec3 &origin) |
Function to add an individual walnut tree. | |
uint | sorghum (const SorghumCanopyParameters ¶ms, const helios::vec3 &origin) |
Function to add an individual sorghum plant. | |
uint | bean (const BeanParameters ¶ms, const helios::vec3 &origin) |
Function to add an individual bean plant. | |
void | createElementLabels () |
Create primitive data that explicitly labels all primitives according to the plant element they correspond to. | |
void | disableElementLabels () |
Toggle off primitive data element type labels. | |
Static Public Member Functions | |
static int | selfTest (int argc=0, char **argv=nullptr) |
Unit testing routine. | |
Definition at line 1037 of file CanopyGenerator.h.
|
explicit |
Canopy geometry generator constructor.
[in] | context | Pointer to the Helios context |
Definition at line 1879 of file CanopyGenerator.cpp.
std::vector< std::vector< uint > > CanopyGenerator::addGrapeCluster | ( | helios::vec3 | position, |
float | grape_rad, | ||
float | cluster_rad, | ||
helios::RGBcolor | grape_color, | ||
uint | grape_subdiv | ||
) |
Function to add an individual grape berry cluster.
[in] | position | Cartesian (x,y,z) position of the cluster main stem. |
[in] | grape_rad | Maximum grape berry radius. |
[in] | cluster_rad | Radius of berry cluster at widest point. |
[in] | grape_subdiv | Number of azimuthal and zenithal berry sub-triangle subdivisions. |
Definition at line 21 of file grapevine.cpp.
uint CanopyGenerator::bean | ( | const BeanParameters & | params, |
const helios::vec3 & | origin | ||
) |
void CanopyGenerator::buildCanopies | ( | ) |
Builds canopies for all the stored canopy parameters.
Definition at line 2150 of file CanopyGenerator.cpp.
void CanopyGenerator::buildCanopy | ( | const BeanParameters & | params | ) |
Build a canopy consisting of common bean plants.
[in] | params | Structure containing parameters for bean canopy. |
Definition at line 2737 of file CanopyGenerator.cpp.
void CanopyGenerator::buildCanopy | ( | const ConicalCrownsCanopyParameters & | params | ) |
Build a canopy consisting of conical crowns filled with homogeneous leaves.
[in] | params | Structure containing parameters for conical crown canopy. |
Definition at line 2314 of file CanopyGenerator.cpp.
void CanopyGenerator::buildCanopy | ( | const GobletGrapevineParameters & | params | ) |
Build a canopy consisting of grapevines on Goblet trellis.
[in] | params | Structure containing parameters for Goblet grapevine canopy. |
Definition at line 2532 of file CanopyGenerator.cpp.
void CanopyGenerator::buildCanopy | ( | const HomogeneousCanopyParameters & | params | ) |
Build a canopy consisting of a homogeneous volume of leaves.
[in] | params | Structure containing parameters for homogeneous canopy. |
Definition at line 2156 of file CanopyGenerator.cpp.
void CanopyGenerator::buildCanopy | ( | const SorghumCanopyParameters & | params | ) |
Build a canopy consisting of sorghum plants.
[in] | params | Structure containing parameters for sorghum plant canopy. |
Definition at line 2708 of file CanopyGenerator.cpp.
void CanopyGenerator::buildCanopy | ( | const SphericalCrownsCanopyParameters & | params | ) |
Build a canopy consisting of spherical crowns filled with homogeneous leaves.
[in] | params | Structure containing parameters for spherical crown canopy. |
Definition at line 2222 of file CanopyGenerator.cpp.
void CanopyGenerator::buildCanopy | ( | const SplitGrapevineParameters & | params | ) |
Build a canopy consisting of grapevines on split trellis.
[in] | params | Structure containing parameters for split trellis grapevine canopy. |
Definition at line 2452 of file CanopyGenerator.cpp.
void CanopyGenerator::buildCanopy | ( | const StrawberryParameters & | params | ) |
Build a canopy consisting of strawberry plants.
[in] | params | Structure containing parameters for strawberry canopy. |
Definition at line 2650 of file CanopyGenerator.cpp.
void CanopyGenerator::buildCanopy | ( | const TomatoParameters & | params | ) |
Build a canopy consisting of tomato plants.
[in] | params | Structure containing parameters for tomato canopy. |
Definition at line 2621 of file CanopyGenerator.cpp.
void CanopyGenerator::buildCanopy | ( | const UnilateralGrapevineParameters & | params | ) |
Build a canopy consisting of grapevines on unilateral trellis.
[in] | params | Structure containing parameters for unilateral grapevine canopy. |
Definition at line 2492 of file CanopyGenerator.cpp.
void CanopyGenerator::buildCanopy | ( | const VSPGrapevineParameters & | params | ) |
Build a canopy consisting of grapevines on VSP trellis.
[in] | params | Structure containing parameters for VSP grapevine canopy. |
Definition at line 2407 of file CanopyGenerator.cpp.
void CanopyGenerator::buildCanopy | ( | const WalnutCanopyParameters & | params | ) |
Build a canopy consisting of walnut trees.
[in] | params | Structure containing parameters for walnut tree canopy. |
Definition at line 2679 of file CanopyGenerator.cpp.
void CanopyGenerator::buildCanopy | ( | const WhiteSpruceCanopyParameters & | params | ) |
Build a canopy consisting of white spruce trees.
[in] | params | Structure containing parameters for white spruce canopy. |
Definition at line 2572 of file CanopyGenerator.cpp.
void CanopyGenerator::buildGround | ( | const helios::vec3 & | ground_origin, |
const helios::vec2 & | ground_extent, | ||
const helios::int2 & | texture_subtiles, | ||
const helios::int2 & | texture_subpatches, | ||
const char * | ground_texture_file | ||
) |
Build a ground consisting of texture sub-tiles and sub-patches, which can be different sizes.
[in] | ground_origin | x-, y-, and z-position of the ground center point. |
[in] | ground_extent | Width of the ground in the x- and y-directions. |
[in] | texture_subtiles | Number of sub-divisions of the ground into texture map tiles in the x- and y-directions. |
[in] | texture_subpatches | Number of sub-divisions of each texture tile into sub-patches in the x- and y-directions. |
[in] | ground_texture_file | Path to file used for tile texture mapping. |
Definition at line 2114 of file CanopyGenerator.cpp.
void CanopyGenerator::buildGround | ( | const helios::vec3 & | ground_origin, |
const helios::vec2 & | ground_extent, | ||
const helios::int2 & | texture_subtiles, | ||
const helios::int2 & | texture_subpatches, | ||
const char * | ground_texture_file, | ||
float | ground_rotation | ||
) |
Build a ground with azimuthal rotation consisting of texture sub-tiles and sub-patches, which can be different sizes.
[in] | ground_origin | x-, y-, and z-position of the ground center point. |
[in] | ground_extent | Width of the ground in the x- and y-directions. |
[in] | texture_subtiles | Number of sub-divisions of the ground into texture map tiles in the x- and y-directions. |
[in] | texture_subpatches | Number of sub-divisions of each texture tile into sub-patches in the x- and y-directions. |
[in] | ground_texture_file | Path to file used for tile texture mapping. |
[in] | ground_rotation | Azimuthal rotation angle of ground in radians. |
Definition at line 2118 of file CanopyGenerator.cpp.
void CanopyGenerator::buildIndividualPlants | ( | ) |
Builds individual plants based on the stored canopy parameters (using canopy_origin as the position)
Definition at line 3007 of file CanopyGenerator.cpp.
void CanopyGenerator::buildIndividualPlants | ( | helios::vec3 | position | ) |
Builds individual plants based on the stored canopy parameters, at the given position.
Definition at line 3001 of file CanopyGenerator.cpp.
void CanopyGenerator::createElementLabels | ( | ) |
Create primitive data that explicitly labels all primitives according to the plant element they correspond to.
Definition at line 3130 of file CanopyGenerator.cpp.
void CanopyGenerator::disableElementLabels | ( | ) |
Toggle off primitive data element type labels.
Definition at line 3134 of file CanopyGenerator.cpp.
void CanopyGenerator::disableMessages | ( | ) |
Disable standard messages from being printed to screen (default is to enable messages)
Definition at line 2993 of file CanopyGenerator.cpp.
void CanopyGenerator::enableMessages | ( | ) |
Enable standard messages to be printed to screen (default is to enable messages)
Definition at line 2997 of file CanopyGenerator.cpp.
Get the unique universal identifiers (UUIDs) for all primitives that make up the tree.
[in] | PlantID | Identifier of tree. |
Definition at line 2959 of file CanopyGenerator.cpp.
std::vector< uint > CanopyGenerator::getBranchUUIDs | ( | ) |
Get the unique universal identifiers (UUIDs) for all branch primitives in a single 1D vector.
Definition at line 2900 of file CanopyGenerator.cpp.
Get the unique universal identifiers (UUIDs) for the primitives that make up the plant branches.
[in] | PlantID | Identifier of plant. |
Definition at line 2890 of file CanopyGenerator.cpp.
std::vector< std::shared_ptr< BaseCanopyParameters > > CanopyGenerator::getCanopyParametersList | ( | ) |
Definition at line 1898 of file CanopyGenerator.cpp.
std::vector< uint > CanopyGenerator::getFruitUUIDs | ( | ) |
Get the unique universal identifiers (UUIDs) for all fruit primitives in a single 1D vector.
Definition at line 2932 of file CanopyGenerator.cpp.
Get the unique universal identifiers (UUIDs) for the primitives that make up the tree fruit.
[in] | PlantID | Identifier of tree. |
Definition at line 2922 of file CanopyGenerator.cpp.
std::vector< uint > CanopyGenerator::getGroundUUIDs | ( | ) |
Get the unique universal identifiers (UUIDs) for the primitives that make up the ground.
Definition at line 2945 of file CanopyGenerator.cpp.
std::vector< uint > CanopyGenerator::getLeafUUIDs | ( | ) |
Get the unique universal identifiers (UUIDs) for all leaf primitives in a single 1D vector.
Definition at line 2916 of file CanopyGenerator.cpp.
Get the unique universal identifiers (UUIDs) for the primitives that make up the plant leaves.
[in] | PlantID | Identifier of plant. |
Definition at line 2906 of file CanopyGenerator.cpp.
uint CanopyGenerator::getPlantCount | ( | ) |
Get the current number of plants added to the Canopy Generator.
Definition at line 2985 of file CanopyGenerator.cpp.
std::vector< uint > CanopyGenerator::getTrunkUUIDs | ( | ) |
Get the unique universal identifiers (UUIDs) for all trunk primitives in a single 1D vector.
Definition at line 2884 of file CanopyGenerator.cpp.
Get the unique universal identifiers (UUIDs) for the primitives that make up the plant trunk.
[in] | PlantID | Identifier of plant. |
Definition at line 2874 of file CanopyGenerator.cpp.
uint CanopyGenerator::grapevineGoblet | ( | const GobletGrapevineParameters & | params, |
const helios::vec3 & | origin | ||
) |
Function to add an individual grapevine plant on a goblet (vent a taille) trellis.
[in] | params | Set of parameters defining grapevine plant. |
[in] | origin | Cartesian (x,y,z) position of the center of the canopy. |
Definition at line 1047 of file grapevine.cpp.
uint CanopyGenerator::grapevineSplit | ( | const SplitGrapevineParameters & | params, |
const helios::vec3 & | origin | ||
) |
Function to add an individual grapevine plant on a split trellis.
[in] | params | Set of parameters defining grapevine plant. |
[in] | origin | Cartesian (x,y,z) position of the center of the canopy. |
Definition at line 455 of file grapevine.cpp.
uint CanopyGenerator::grapevineUnilateral | ( | const UnilateralGrapevineParameters & | params, |
const helios::vec3 & | origin | ||
) |
Function to add an individual grapevine plant on a unilateral trellis.
[in] | params | Set of parameters defining grapevine plant. |
[in] | origin | Cartesian (x,y,z) position of the center of the canopy. |
Definition at line 816 of file grapevine.cpp.
uint CanopyGenerator::grapevineVSP | ( | const VSPGrapevineParameters & | params, |
const helios::vec3 & | origin | ||
) |
Function to add an individual grapevine plant on a vertical shoot positioned (VSP) trellis.
[in] | params | Set of parameters defining grapevine plant. |
[in] | origin | Cartesian (x,y,z) position of the center of the canopy. |
Definition at line 146 of file grapevine.cpp.
void CanopyGenerator::loadXML | ( | const char * | filename, |
bool | build = true |
||
) |
Reads the XML file of the given name and stores all the configured canopy parameters.
[in] | filename | Path to XML file to be read |
[in] | build | true if we should build all the canopies for which we read parameters in the XML file |
Definition at line 1906 of file CanopyGenerator.cpp.
void CanopyGenerator::seedRandomGenerator | ( | uint | seed | ) |
Seed the random number generator. This can be useful for generating repeatable trees, say, within a loop.
[in] | seed | Random number seed |
Definition at line 2989 of file CanopyGenerator.cpp.
|
static |
Unit testing routine.
Definition at line 184 of file selfTest.cpp.
uint CanopyGenerator::sorghum | ( | const SorghumCanopyParameters & | params, |
const helios::vec3 & | origin | ||
) |
Function to add an individual sorghum plant.
[in] | params | Set of parameters defining sorghum plants/canopy. |
[in] | origin | Cartesian (x,y,z) position of the center of the canopy. |
Definition at line 8 of file sorghum.cpp.
void CanopyGenerator::storeCanopyParameters | ( | Args &&... | args | ) |
Stores the given canopy parameters.
Definition at line 1893 of file CanopyGenerator.cpp.
uint CanopyGenerator::strawberry | ( | const StrawberryParameters & | params, |
const helios::vec3 & | origin | ||
) |
Function to add an individual strawberry plant.
[in] | params | Set of parameters defining strawberry plants/canopy. |
[in] | origin | Cartesian (x,y,z) position of the center of the canopy. |
Definition at line 203 of file strawberry.cpp.
uint CanopyGenerator::tomato | ( | const TomatoParameters & | params, |
const helios::vec3 & | origin | ||
) |
Function to add an individual tomato plant.
[in] | params | Set of parameters defining tomato plants/canopy. |
[in] | origin | Cartesian (x,y,z) position of the center of the canopy. |
Definition at line 130 of file tomato.cpp.
uint CanopyGenerator::walnut | ( | const WalnutCanopyParameters & | params, |
const helios::vec3 & | origin | ||
) |
Function to add an individual walnut tree.
[in] | params | Set of parameters defining walnut trees/canopy. |
[in] | origin | Cartesian (x,y,z) position of the center of the canopy. |
Definition at line 316 of file walnut.cpp.
uint CanopyGenerator::whitespruce | ( | const WhiteSpruceCanopyParameters & | params, |
const helios::vec3 & | origin | ||
) |
Function to add an individual white spruce tree.
[in] | params | Set of parameters defining white spruce tree. |
[in] | origin | Cartesian (x,y,z) position of the center of the canopy. |
Definition at line 6 of file whitespruce.cpp.